1/*! For license information please see main.4b6bfb1e.js.LICENSE.txt */ 2(()=>{var e={56:(e,t,n)=>{"use strict";var r=n(27767);n.o(r,"IJsonRpcProvider")&&n.d(t,{IJsonRpcProvider:function(){return r.IJsonRpcProvider}}),n.o(r,"formatJsonRpcError")&&n.d(t,{formatJsonRpcError:function(){return r.formatJsonRpcError}}),n.o(r,"formatJsonRpcRequest")&&n.d(t,{formatJsonRpcRequest:function(){return r.formatJsonRpcRequest}}),n.o(r,"formatJsonRpcResult")&&n.d(t,{formatJsonRpcResult:function(){return r.formatJsonRpcResult}}),n.o(r,"getBigIntRpcId")&&n.d(t,{getBigIntRpcId:function(){return r.getBigIntRpcId}}),n.o(r,"isHttpUrl")&&n.d(t,{isHttpUrl:function(){return r.isHttpUrl}}),n.o(r,"isJsonRpcError")&&n.d(t,{isJsonRpcError:function(){return r.isJsonRpcError}}),n.o(r,"isJsonRpcRequest")&&n.d(t,{isJsonRpcRequest:function(){return r.isJsonRpcRequest}}),n.o(r,"isJsonRpcResponse")&&n.d(t,{isJsonRpcResponse:function(){return r.isJsonRpcResponse}}),n.o(r,"isJsonRpcResult")&&n.d(t,{isJsonRpcResult:function(){return r.isJsonRpcResult}}),n.o(r,"isLocalhostUrl")&&n.d(t,{isLocalhostUrl:function(){return r.isLocalhostUrl}}),n.o(r,"isReactNative")&&n.d(t,{isReactNative:function(){return r.isReactNative}}),n.o(r,"isWsUrl")&&n.d(t,{isWsUrl:function(){return r.isWsUrl}}),n.o(r,"payloadId")&&n.d(t,{payloadId:function(){return r.payloadId}})},175:(e,t,n)=>{"use strict";n.d(t,{EQ:()=>a});var r=n(51659),i=n(32326),s=n(91638),o=n(652);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hex";const n=c(e),r=(0,i.l)(new Uint8Array(n.length));return n.encode(r),"hex"===t?(0,o.My)(r.bytes):r.bytes}function c(e){return Array.isArray(e)?function(e){const t=e.reduce((e,t)=>e+t.length,0),n=l(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),1===n?r.pushUint8(t):2===n?r.pushUint16(t):3===n?r.pushUint24(t):r.pushUint32(t));for(const{encode:t}of e)t(r)}}}(e.map(e=>c(e))):function(e){const t="string"===typeof e?(0,s.aT)(e):e,n=l(t.length),r=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:r,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function l(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new r.C("Length is too large.")}}
2,652:(e,t,n)=>{"use strict";n.d(t,{$P:()=>c,My:()=>l,cK:()=>u,i3:()=>h,nj:()=>a});var r=n(14393),i=n(61398),s=n(63015);const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"number"===typeof e||"bigint"===typeof e?u(e,t):"string"===typeof e?h(e,t):"boolean"===typeof e?c(e,t):l(e,t)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n="0x".concat(Number(e));return"number"===typeof t.size?((0,s.Sl)(n,{size:t.size}),(0,i.eV)(n,{size:t.size})):n}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="";for(let i=0;i<e.length;i++)n+=o[e[i]];const r="0x".concat(n);return"number"===typeof t.size?((0,s.Sl)(r,{size:t.size}),(0,i.eV)(r,{dir:"right",size:t.size})):r}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{signed:n,size:s}=t,o=BigInt(e);let a;s?a=n?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"===typeof e&&(a=BigInt(Number.MAX_SAFE_INTEGER));const c="bigint"===typeof a&&n?-a-1n:0;if(a&&o>a||o<c){const t="bigint"===typeof e?"n":"";throw new r.Ty({max:a?"".concat(a).concat(t):void 0,min:"".concat(c).concat(t),signed:n,size:s,value:"".concat(e).concat(t)})}const l="0x".concat((n&&o<0?(1n<<BigInt(8*s))+BigInt(o):o).toString(16));return s?(0,i.eV)(l,{size:s}):l}const d=new TextEncoder;function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(d.encode(e),t)}},1207:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});class r extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(e=>{if(t.cause instanceof r){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"===typeof t.cause.details?t.cause.details:null!==(e=t.cause)&&void 0!==e&&e.message?t.cause.message:t.details})(),i=t.cause instanceof r&&t.cause.docsPath||t.docsPath,s="".concat("https://oxlib.sh").concat(null!==i&&void 0!==i?i:"");super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...n||i?["",n?"Details: ".concat(n):void 0,i?"See: ".concat(s):void 0]:[]].filter(e=>"string"===typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"ox@".concat("0.1.1")}),this.cause=t.cause,this.details=n,this.docs=s,this.docsPath=i,this.shortMessage=e}walk(e){return i(this,e)}}function i(e,t){return null!==t&&void 0!==t&&t(e)?e:e&&"object"===typeof e&&"cause"in e&&e.cause?i(e.cause,t):t?null:e}},1212:(e,t,n)=>{"use strict";n.d(t,{n:()=>f});var r=n(36231),i=n(41226),s=n(44288),o=n(38274),a=n(70495),c=n(77354),l=n(73251),u=n(11383),d=n(27610),h=n(24428),p=n(83923);async function f(e,t){const{checkReplacement:n=!0,confirmations:f=1,hash:g,onReplaced:m,retryCount:y=6,retryDelay:v=e=>{let{count:t}=e;return 200*(1<<t)},timeout:w=18e4}=t,b=(0,l.A)(["waitForTransactionReceipt",e.uid,g]),A=t.pollingInterval?t.pollingInterval:null!==(_=e.chain)&&void 0!==_&&_.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval;var _;let x,E,k,S,I,T=!1;const{promise:C,resolve:P,reject:O}=(0,a.Y)(),N=w?setTimeout(()=>{var e,t;null===(e=I)||void 0===e||e(),null===(t=S)||void 0===t||t(),O(new i.WA({hash:g}))},w):void 0;return S=(0,o.lB)(b,{onReplaced:m,resolve:P,reject:O},async t=>{var o;if(k=await(0,s.T)(e,h.h,"getTransactionReceipt")({hash:g}).catch(()=>{}),k&&f<=1)return clearTimeout(N),t.resolve(k),void(null===(o=S)||void 0===o||o());I=(0,s.T)(e,p.q,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:A,async onBlockNumber(o){const a=e=>{var t,n;clearTimeout(N),null===(t=I)||void 0===t||t(),e(),null===(n=S)||void 0===n||n()};let l=o;if(!T)try{if(k){if(f>1&&(!k.blockNumber||l-k.blockNumber+1n<f))return;return void a(()=>t.resolve(k))}if(n&&!x&&(T=!0,await(0,c.b)(async()=>{x=await(0,s.T)(e,d.x,"getTransaction")({hash:g}),x.blockNumber&&(l=x.blockNumber)},{delay:v,retryCount:y}),T=!1),k=await(0,s.T)(e,h.h,"getTransactionReceipt")({hash:g}),f>1&&(!k.blockNumber||l-k.blockNumber+1n<f))return;a(()=>t.resolve(k))}catch(p){if(p instanceof i.Kz||p instanceof i.Kc){if(!x)return void(T=!1);try{E=x,T=!0;const n=await(0,c.b)(()=>(0,s.T)(e,u.g,"getBlock")({blockNumber:l,includeTransactions:!0}),{delay:v,retryCount:y,shouldRetry:e=>{let{error:t}=e;return t instanceof r.l}});T=!1;const i=n.transactions.find(e=>{let{from:t,nonce:n}=e;return t===E.from&&n===E.nonce});if(!i)return;if(k=await(0,s.T)(e,h.h,"getTransactionReceipt")({hash:i.hash}),f>1&&(!k.blockNumber||l-k.blockNumber+1n<f))return;let o="replaced";i.to===E.to&&i.value===E.value&&i.input===E.input?o="repriced":i.from===i.to&&0n===i.value&&(o="cancelled"),a(()=>{var e;null===(e=t.onReplaced)||void 0===e||e.call(t,{reason:o,replacedTransaction:E,transaction:i,transactionReceipt:k}),t.resolve(k)})}catch(m){a(()=>t.reject(m))}}else a(()=>t.reject(p))}}})}),C}},1490:(e,t,n)=>{"use strict";n.d(t,{E:()=>i});var r=n(6806);function i(e){return(0,r.q)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}}
2,1598:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__assign:()=>s,__asyncDelegator:()=>b,__asyncGenerator:()=>w,__asyncValues:()=>A,__await:()=>v,__awaiter:()=>u,__classPrivateFieldGet:()=>k,__classPrivateFieldSet:()=>S,__createBinding:()=>h,__decorate:()=>a,__exportStar:()=>p,__extends:()=>i,__generator:()=>d,__importDefault:()=>E,__importStar:()=>x,__makeTemplateObject:()=>_,__metadata:()=>l,__param:()=>c,__read:()=>g,__rest:()=>o,__spread:()=>m,__spreadArrays:()=>y,__values:()=>f});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function c(e,t){return function(n,r){t(n,r,e)}}function l(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{c(r.next(e))}catch(t){s(t)}}function a(e){try{c(r.throw(e))}catch(t){s(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((r=r.apply(e,t||[])).next())})}function d(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(a){s=[6,a],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function h(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function f(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function w(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){s.push([e,t,n,r])>1||a(e,t)})})}function a(e,t){try{!function(e){e.value instanceof v?Promise.resolve(e.value.v).then(c,l):u(s[0][2],e)}(i[e](t))}catch(n){u(s[0][3],n)}}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function b(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:v(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function A(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,i,(t=e[n](t)).done,t.value)})}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
2function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}function k(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},1688:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var r=n(57722);const i=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"===typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!==typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,s);return s},s=e=>e;const o=e=>{const t=(e=>e?i(e):i)(e),n=e=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;const n=r.useSyncExternalStore(e.subscribe,r.useCallback(()=>t(e.getState()),[e,t]),r.useCallback(()=>t(e.getInitialState()),[e,t]));return r.useDebugValue(n),n}(t,e);return Object.assign(n,t),n},a=e=>e?o(e):o},1991:(e,t,n)=>{"use strict";n.d(t,{$:()=>ie,D:()=>R,E:()=>Q,F:()=>Ce,G:()=>ge,H:()=>ae,K:()=>Me,L:()=>pe,M:()=>Oe,P:()=>Y,Q:()=>E,R:()=>ke,S:()=>Ae,T:()=>C,U:()=>se,V:()=>oe,W:()=>ce,X:()=>le,Y:()=>$,Z:()=>ne,_:()=>P,a:()=>W,a0:()=>ee,a1:()=>O,a2:()=>V,a3:()=>N,a4:()=>ue,a5:()=>q,a6:()=>M,a7:()=>fe,a8:()=>te,b:()=>A,c:()=>J,d:()=>x,e:()=>S,f:()=>G,g:()=>_,h:()=>z,i:()=>B,j:()=>K,k:()=>U,l:()=>xe,m:()=>H,n:()=>we,o:()=>F,p:()=>L,q:()=>ve,r:()=>Z,s:()=>D,t:()=>j,u:()=>X,v:()=>_e,w:()=>Pe,z:()=>Ne});var r=n(92030),i=n(24107),s=n(57722),o=n(1688),a=n(99844),c=n(52610),l=n(90034),u=n(2035),d=n(49080),h=n(17488),p=n(27133),f=n(10133),g=n(652),m=n(51380),y=n(12663),v=n(49931);const w=(0,o.v)(()=>({listings:[],loading:!1})),b=w.setState,A=e=>w.getState().listings.find(t=>{let{slug:n}=t;return k(n)===k(e)}),_=e=>{let t;try{t=new URL(e).hostname}catch(e){return}return w.getState().listings.find(e=>{let n,{homepage:r}=e;try{n=new URL(r).hostname}catch(r){return!1}return t.includes(n)})},x=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=(0,a.u)(),n=w(e=>e.listings),r=w(e=>e.loading),i=!!n.length;return(0,s.useEffect)(()=>
2{e&&!i&&(b({listings:[],loading:!0}),(async e=>{let t=new URL("v3/wallets","https://explorer-api.walletconnect.com");t.searchParams.append("projectId",e);let n=await fetch(t);return n.ok?Object.values((await n.json()).listings).sort((e,t)=>{let{slug:n}=e,{slug:r}=t;return"rainbow"===n&&"metamask"===r?1:"metamask"===n||"rainbow"===n?-1:1}):(console.debug("Failed to fetch WalletConnect listings: ".concat(await n.text().catch(()=>"No response."))),[])})(t.walletConnectCloudProjectId).then(e=>b({listings:e,loading:!1})).catch(e=>{console.error(e),b({listings:[],loading:!1})}))},[e,i,t.walletConnectCloudProjectId]),{listings:n,loading:r}},E=e=>{let{listings:t}=x();return t.find(t=>{let{slug:n}=t;return k(n)===k(e)})};function k(e){return"cryptocom"===e?"cryptocom-defi":"binance"===e?"binance-defi":e.replace(/[-_]wallet$/,"")}function S(e){return["wallet_connect","backpack","binance","binanceus","bitget_wallet","bybit_wallet","cryptocom","haha_wallet","jupiter","metamask","okx_wallet","phantom","rabby_wallet","rainbow","ronin_wallet","safe","solflare","uniswap","zerion","kraken_wallet"].some(t=>null===e||void 0===e?void 0:e.includes(t))}const I=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom||"isPhantom"in e?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,T=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==I(e))return!1;if(e.providers)for(let n of e.providers)if(!T(n))return!1;return!0},C=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},P=(e,t)=>{let n=[],r=[];for(let[i,s]of e.entries())i<t?n.push(s):r.push(s);return[n,r]},O=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),N=(e,t)=>{let n=e.slice(0),r=[];for(;n.length;)r.push(n.splice(0,t));return r},R=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;if(!e)return"";let r="ethereum"===(arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ethereum")?2:0;return t+n+r+3>=e.length?e:"".concat(e.slice(0,r+t),"...").concat(e.slice(e.length-n,e.length))},M=function(e){return R(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,"solana")},U=e=>new Promise(t=>setTimeout(t,e));function L(e){let{interval:t=100,timeout:n=5e3}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((r,i)=>{let s,o=0,a=()=>{o>=n?i("Max attempts reached without result"):(s=e(),o+=t,null==s?setTimeout(a,t):r(s))};a()})}const B=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.delayMs||150,r=t.maxAttempts||270;return new Promise(async(i,s)=>{let o=!1,a=0;for(;!o&&a<r;){var c;if(null!==(c=t.abortSignal)&&void 0!==c&&c.aborted)return;e().then(e=>{o=!0,i(e)},function(){o=!0,s(...arguments)}),a+=1,await U(n)}o||s(Error("Exceeded max attempts before resolving function"))})},D=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),j=e=>"string"==typeof e?e:"0x"+e.toString(16);async function F(e){let{store:t,walletList:n,externalWalletConfig:r,walletChainType:i,timeout:s=3e3}=e,o=!1,a=window;return new Promise(e=>{function c(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",c);let s=t.getProviders();console.debug("Detected injected providers:",s.map(e=>e.info));let a=[];for(let e of s)n.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===i&&"app.phantom"===e.info.rdns||a.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==i)for(let e of function(e){let t=window,n=t.ethereum;if(!n)return[];let r=[];if(null!==(e=n.providers)&&void 0!==e&&e.length)for(let i of n.providers)i&&r.push(i);return r.push(t.ethereum),r}()){let t=I(e);if(!s.some(e=>e.info.name===t)){if(T(e,!0)&&!a.find(e=>"metamask"===e.type)){a.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!a.find(e=>"phantom"===e.type)){a.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!a.find(e=>{var t;return"coinbase_wallet"===e.type&&"smartWalletOnly"!==(null===(t=r.coinbaseWallet)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.preference)||void 0===t?void 0:t.options)})){a.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}a.find(e=>"unknown_browser_extension"===e.type)||a.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}e(a)}a.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},s))})}function z(e){return"eip155:".concat(String(Number(e)))}const W=(e,t,n,r)=>{let i=Number(e),s=t.find(e=>e.id===i);if(!s)throw new m.P("Unsupported chainId ".concat(e),4901);return(0,y.a)(s,n,r)},q=(e,t)=>
2{var n;let r=Number(e),i=t.find(e=>e.id===r);if(!i)throw new m.P("Unsupported chainId ".concat(e),4901);return null===(n=i.blockExplorers)||void 0===n?void 0:n.default.url},H=e=>{var t;let n={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=null!==(t=e.types.EIP712Domain)&&void 0!==t?t:Object.entries(e.domain).map(e=>{let[t,r]=e;if(null!=r&&"string"==typeof t&&t in n)return{name:t,type:n[t]}}).filter(e=>void 0!==e);return(0,i.A)((0,i.A)({},e),{},{types:(0,i.A)((0,i.A)({},e.types),{},{EIP712Domain:r})})};function V(e,t){let{min:n,max:r}=t;return Math.min(Math.max(e,n),r)}function G(e){return"ethereum"===e.type}function K(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if((null===r||void 0===r?void 0:r.address)!==(null===i||void 0===i?void 0:i.address)||r&&i&&G(r)&&G(i)&&(null===r||void 0===r?void 0:r.chainId)!==(null===i||void 0===i?void 0:i.chainId)||(null===r||void 0===r?void 0:r.connectorType)!==(null===i||void 0===i?void 0:i.connectorType)||(null===r||void 0===r?void 0:r.connectedAt)!==(null===i||void 0===i?void 0:i.connectedAt)||(null===r||void 0===r?void 0:r.walletClientType)!==(null===i||void 0===i?void 0:i.walletClientType)||(null===r||void 0===r?void 0:r.isConnected)!==(null===i||void 0===i?void 0:i.isConnected)||(null===r||void 0===r?void 0:r.linked)!==(null===i||void 0===i?void 0:i.linked))return!1}return!0}const J=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||a.n;function Z(e){return"ethereum"===e.chainType}class Q extends d.c{buildConnectedWallet(e,t,n,r){let i=async()=>!!this.wallets.find(t=>(0,f.b)(t.address)===(0,f.b)(e));return{type:"ethereum",address:(0,f.b)(e),chainId:t,meta:n,imported:r,switchChain:async n=>{var r;let s,o;
2if(!i)throw new m.P("Wallet is not currently connected.");let a=null===(r=this.wallets.find(t=>(0,f.b)(t.address)===(0,f.b)(e)))||void 0===r?void 0:r.chainId;if(!a)throw new m.P("Unable to determine current chainId.");if("number"==typeof n?(s="0x".concat(n.toString(16)),o=n):(s=n,o=Number(n)),a===z(s))return;let c=this.chains.find(e=>e.id===o);if(!c)throw new m.P("Unsupported chainId: ".concat(n));let l=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await l()}catch(e){var u,d,h,p,g;if(((e,t,n)=>{switch(this.walletClientType){case"coinbase_wallet":case"base_account":return e.message.includes("addEthereumChain");case"rabby_wallet":return e.message.includes("Unrecognized chain ID");default:return 4902===e.code||(null===(n=e.message)||void 0===n?void 0:n.includes("4902"))}})(e))return"rabby_wallet"===this.walletClientType&&await U(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:c.name,nativeCurrency:c.nativeCurrency,rpcUrls:[null!==(u=null===(d=c.rpcUrls.default)||void 0===d?void 0:d.http[0])&&void 0!==u?u:""],blockExplorerUrls:[null!==(h=null===(p=c.blockExplorers)||void 0===p?void 0:p.default.url)&&void 0!==h?h:""]}]}),l();if("rainbow"===this.walletClientType&&null!==(g=e.message)&&void 0!==g&&g.includes("wallet_switchEthereumChain"))throw new m.P("Rainbow does not support the chainId ".concat(t));throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new m.P("Wallet is not currently connected.");return this.proxyProvider},sign:async e=>{if(!await i())throw new m.P("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t,n=e;try{if(void 0===n){let e=await B(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug("eth_accounts for ".concat(this.walletClientType,":"),e),Array.isArray(e)&&(n=e)}}catch(e){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!n||!Array.isArray(n)||n.length<=0||!n[0])return;let r=n[0];if(!(0,p.P)(r))return void console.warn("Invalid ethereum address reported by ".concat(this.walletClientType,": ").concat(r));let i=(0,f.b)(r),s=[];if("privy"===this.walletClientType){let n=d.u.get((0,a.o)(i));this.chains.find(e=>e.id===Number(n))||(d.u.del((0,a.o)(i)),n=null),t=n||"0x".concat(this.defaultChain.id.toString(16));try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){console.warn("Unable to switch embedded wallet to chain ID ".concat(t," on initialization"))}}else try{let e=await B(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug("eth_chainId for ".concat(this.walletClientType,":"),e),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t="0x".concat(e.toString(16))}}catch(e){console.warn("Failed to get chainId from provider, defaulting to ".concat(a.p),e),t=a.p}let o=z(t);if(!s.find(e=>(0,f.b)(e.address)===i)){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};s.push(this.buildConnectedWallet((0,f.b)(r),o,e,"embedded_imported"===this.connectorType))}K(s,this.wallets)||(this.wallets=s,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((e,t)=>t.connectedAt-e.connectedAt).find(t=>e.find(e=>(0,f.b)(e)===(0,f.b)(t.address)))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){var t;return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[(0,g.nj)(e),null===(t=this.wallets[0])||void 0===t?void 0:t.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,n,r){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>
2{this.wallets.forEach(t=>{t.chainId=z(e),"privy"===this.walletClientType&&d.u.put((0,a.o)(t.address),e)}),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=async()=>{"base_account"===this.connectorType&&this.connected||(this.connected=!0,"coinbase_wallet"===this.connectorType&&await U(500),this.syncAccounts())},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=n,this.rpcConfig=r,this.rpcTimeoutDuration=J(r,e),this.connected=!1,this.initialized=!1}}class Y{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new m.P("A wallet request of type ".concat(e.method," was made before setting a wallet provider."));return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch(e=>{throw(0,d.f)(e)})}constructor(e,t){var n=this;this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new d.d,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.rpcTimeoutDuration;return new Promise((n,r)=>setTimeout(()=>{r(e)},t))},this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach(e=>{this.removeListener(e.eventName,e.listener)}),this.walletProvider=e,this._subscriptions.forEach(e=>{var t;null===(t=this.walletProvider)||void 0===t||t.on(e.eventName,e.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=t||a.n,this._subscriptions=[]}}const X=e=>{let[t,n]=(0,s.useState)("auto");return(0,s.useEffect)(()=>{let t=new ResizeObserver(e=>{var t,r;n(null!==(t=null===(r=e[0])||void 0===r?void 0:r.contentRect.height)&&void 0!==t?t:"auto")});return e.current&&t.observe(e.current),()=>{e.current&&t.unobserve(e.current)}},[e.current]),t},$=c.I4.div.withConfig({displayName:"Grow",componentId:"sc-681ff332-0"})(["text-align:left;flex-grow:1;"]),ee=c.I4.div.withConfig({displayName:"AlignBottom",componentId:"sc-681ff332-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),te=c.I4.div.withConfig({displayName:"LoginMethodContainer",componentId:"sc-681ff332-2"})(["display:flex;flex-direction:column;gap:8px;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]),ne=(0,c.I4)(te).withConfig({displayName:"LoginMethodContainerWithScrollShadows",componentId:"sc-681ff332-3"})([""," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;max-height:400px;overflow-y:auto;scrollbar-width:none;padding:3px;"],e=>"light"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0);let re=(0,c.AH)(["&&{width:100%;font-size:16px;line-height:24px;min-height:56px;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;align-items:center;color:var(--privy-color-foreground);padding:10px 12px;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);transition:background-color 200ms ease;cursor:pointer;&:hover{background-color:var(--privy-color-background-2);}&:disabled{cursor:pointer;background-color:var(--privy-color-background-2);}}"]);const ie=c.I4.div.withConfig({displayName:"Subtitle",componentId:"sc-681ff332-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),se=c.I4.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-681ff332-5"})(["",""],re),oe=c.I4.div.withConfig({displayName:"LoginMethodIconWrapper",componentId:"sc-681ff332-7"})(["width:32px;height:32px;border-radius:",";background:",";display:flex;align-items:center;justify-content:center;flex-shrink:0;svg{width:",";height:",";color:",";}"],e=>e.$fullSize?"0":"4px",e=>e.$fullSize?"transparent":"var(--privy-color-background-2)",e=>e.$fullSize?"32px":"18px",e=>e.$fullSize?"32px":"18px",e=>e.$fullSize?"inherit":"var(--privy-color-icon-muted)"),ae=c.I4.div.withConfig({displayName:"Hide",componentId:"sc-681ff332-8"})(["width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;",""],e=>e.$if?"display: none;":""),ce=c.I4.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-681ff332-9"})(["width:100%;height:100%;padding:",";"],e=>e.$withPadding?"64px 0px":"0px"),le=c.I4.div.withConfig({displayName:"Header",componentId:"sc-681ff332-10"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:32px;gap:12px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),ue=e=>{let{success:t,fail:n}=e;return(0,l.jsxs)(he,{children:[(0,l.jsx)(de,{children:(0,l.jsx)(fe,{className:t?"success":n?"fail":""})}),(0,l.jsx)(de,{children:(0,l.jsx)(pe,{className:t?"success":n?"fail":""})})]})};let de=c.I4.span.withConfig({displayName:"PositionedAbsoluteLoader",componentId:"sc-aba6339d-0"})(["&&{position:absolute;top:0;left:0;z-index:2;}"]),he=c.I4.span.withConfig({displayName:"ConnectionLoaderContainer",componentId:"sc-aba6339d-1"})(["position:relative;width:82px;height:82px;display:inline-block;"]);const pe=c.I4.span.withConfig({displayName:"Loader",componentId:"sc-aba6339d-2"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-icon-success);border-bottom-color:var(--privy-color-icon-success);}&&&.fail{border-color:var(--privy-color-icon-error);border-bottom-color:var(--privy-color-icon-error);}"],e=>{var t;return null!==(t=e.color)&&void 0!==t?t:"var(--privy-color-icon-subtle)"}),fe=(0,c.I4)(pe).withConfig({displayName:"LoaderFaint",componentId:"sc-aba6339d-3"})(["&&{border-bottom-color:",";border-color:",";animation:none;opacity:0.5;}"],e=>{var t;return null!==(t=e.color)&&void 0!==t?t:"var(--privy-color-border-default)"},e=>{var t;return null!==(t=e.color)&&void 0!==t?t:"var(--privy-color-border-default)"}),ge=e=>(0,l.jsx)(me,{color:e.color||"var(--privy-color-foreground-3)"});let me=(0,c.I4)(pe).withConfig({displayName:"StyledButtonLoader",componentId:"sc-aba6339d-4"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const ye=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","crypto.com_wallet_extension","crypto.com_onchain","binance","bitget_wallet","coinbase_wallet","coinbase_smart_wallet","base_account","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitget_wallet","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","privy","unknown","phantom","solflare","glow","backpack","jupiter","mobile_wallet_adapter"],ve=Object.freeze({phantom:{client:"phantom",name:"Phantom",installLink:u.gm?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",chainTypes:["ethereum","solana"],get isInstalled(){if("phantom"in window){var e,t,n;let r=window;if(null!==r&&void 0!==r&&null!==(e=r.phantom)&&void 0!==e&&null!==(e=e.ethereum)&&void 0!==e&&e.isPhantom&&null!==r&&void 0!==r&&null!==(t=r.phantom)&&void 0!==t&&null!==(t=t.ethereum)&&void 0!==t&&t.chainId||null!==r&&void 0!==r&&null!==(n=r.phantom)&&void 0!==n&&null!==(n=n.solana)&&void 0!==n&&n.isPhantom)return!0}return!1},getMobileRedirect(e){let{useUniversalLink:t,isSolana:n,connectOnly:r}=e,i=be({client:this.client,isSolana:n,connectOnly:r});return"".concat(t?"phantom://":"https://phantom.app/ul/","browse/").concat(i,"?ref=").concat(i)}},solflare:{client:"solflare",name:"Solflare",installLink:u.gm?"https://addons.mozilla.org/es/firefox/addon/solflare-wallet/":"https://chromewebstore.google.com/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",chainTypes:["solana"],get isInstalled(){var e;return"solflare"in window&&!(null===(e=window)||void 0===e||null===(e=e.solflare)||void 0===e||!e.isSolflare)},getMobileRedirect(e){let{useUniversalLink:t,isSolana:n,connectOnly:r}=e,i=be({client:this.client,isSolana:n,connectOnly:r});return"".concat(t?"solflare://ul/v1/":"https://solflare.com/ul/v1/","browse/").concat(i,"?ref=").concat(i)}},backpack:{client:"backpack",name:"Backpack",installLink:"https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcb
2cmnbpgliof",chainTypes:["ethereum","solana"],get isInstalled(){var e,t;return!(!("backpack"in window)||(null===(e=window)||void 0===e||null===(e=e.backpack)||void 0===e||null===(e=e.ethereum)||void 0===e||!e.isBackpack)&&(null===(t=window)||void 0===t||null===(t=t.backpack)||void 0===t||null===(t=t.solana)||void 0===t||!t.isBackpack))},getMobileRedirect(e){let{useUniversalLink:t,isSolana:n,connectOnly:r}=e,i=be({client:this.client,isSolana:n,connectOnly:r});return"".concat(t?"backpack://ul/v1/":"https://backpack.app/ul/v1/","browse/").concat(i,"?ref=").concat(i)}},okx_wallet:{client:"okx_wallet",name:"OKX Wallet",installLink:"https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",chainTypes:["solana"],get isInstalled(){var e;return"okxwallet"in window&&!(null===(e=window)||void 0===e||null===(e=e.okxwallet)||void 0===e||!e.isOkxWallet)},getMobileRedirect(e){let{isSolana:t,connectOnly:n}=e;return"https://www.okx.com/download?deeplink="+encodeURIComponent("okx://wallet/dapp/url?dappUrl="+be({client:this.client,isSolana:t,connectOnly:n}))}}});function we(e){let{connectorType:t,walletClientType:n}=e;for(let r of ye)if(t===r||n===r)return ve[r]}function be(e){let{client:t,isSolana:n,connectOnly:r}=e,i=new URL(window.location.href);return i.searchParams.set("privy_connector",n?"solana_adapter":"injected"),i.searchParams.set("privy_wallet_client",t),i.searchParams.set("privy_connect_only",String(r)),encodeURIComponent(i.href.replace(/\/$/g,""))}class Ae extends d.S{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the SolanaNullConnector")}constructor(e){let{id:t,name:n,icon:r}=e;super({name:n},!1),this.connectorType="null",this.proxyProvider=new Y(void 0,a.n),this.disconnect=async()=>{throw Error("disconnect called for an uninstalled wallet via the SolanaNullConnector")},this.promptConnection=async()=>{throw Error("promptConnection called for an uninstalled wallet via the SolanaNullConnector")},this.id=t,this.name=n,this.icon=r}}function _e(e){return"solana"===e.chainType}function xe(e){return"solana"===e.type}let Ee=(0,s.createContext)({});const ke=e=>{let{children:t}=e,n=(0,a.u)(),[r,i]=(0,s.useState)({});return(0,h.u)("login",{onComplete:e=>{let{loginAccount:t}=e;t&&"passkey"!==t.type&&"cross_app"!==t.type&&("wallet"!==t.type||"privy"!==t.walletClientType)&&(d.u.put(Se(n.id),t.type),"wallet"===t.type?(d.u.put(Ie(n.id),t.walletClientType),d.u.put(Te(n.id),t.chainType),i({accountType:t.type,walletClientType:t.walletClientType,chainType:t.chainType})):(d.u.del(Ie(n.id)),d.u.del(Te(n.id)),i({accountType:t.type})))}}),(0,s.useEffect)(()=>{if(!n.id)return;let e=d.u.get(Se(n.id)),t=d.u.get(Ie(n.id)),r=d.u.get(Te(n.id));e&&i("wallet"===e?{accountType:e,walletClientType:t,chainType:r}:{accountType:e})},[n.id]),(0,l.jsx)(Ee.Provider,{value:r,children:t})};let Se=e=>"privy:".concat(e,":recent-login-method"),Ie=e=>"privy:".concat(e,":recent-login-wallet-client"),Te=e=>"privy:".concat(e,":recent-login-chain-type");const Ce=()=>(0,s.useContext)(Ee);class Pe extends Q{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the EthereumNullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the EthereumNullConnector")}promptConnection(e){throw Error("promptConnection called for an uninstalled wallet via the EthereumNullConnector for ".concat(e))}constructor(e){let{id:t,name:n,icon:r,walletClientType:i,defaultChain:s}=e;super(i,[],s,{}),this.connectorType="null",this.proxyProvider=new Y(void 0,a.n),this.id=t,this.name=n,this.icon=r}}const Oe=e=>{let t=Object.assign({},((0,r.A)(e),e));return(0,l.jsxs)("svg",(0,i.A)((0,i.A)({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none"},t),{},{children:[(0,l.jsx)("rect",{width:"32",height:"32",rx:"6",fill:"#121314"}),(0,l.jsx)("g",{transform:"translate(4, 4)",children:(0,l.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 318.6 318.6",children:[(0,l.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,l.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,l.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,l.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,l.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,l.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,l.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,l.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,l.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,l.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,l.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,l.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,l.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h4
26.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]})})]}))};function Ne(e){let{logout:t}=(0,s.useContext)(v.P);return(0,h.u)("logout",e),{logout:t}}const Re=(0,o.v)(()=>({isModalOpen:!1,resolvers:null}));(0,o.v)(()=>({}));const Me=e=>{let{address:t,client:n,appId:r}=e,i="".concat(n,":").concat(t);r&&d.u.put(Ue(r),i),Re.setState({wallet:i})},Ue=e=>"privy:".concat(e,":active-wallet-connection")},2035:(e,t,n)=>{"use strict";var r,i=n(57722),s=(r=i)&&"object"===typeof r&&"default"in r?r.default:r,o=n(28882),a=new o,c=a.getBrowser(),l=a.getCPU(),u=a.getDevice(),d=a.getEngine(),h=a.getOS(),p=a.getUA(),f=function(e){return a.setUA(e)},g=function(e){if(e){var t=new o(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},m=Object.freeze({ClientUAInstance:a,browser:c,cpu:l,device:u,engine:d,os:h,ua:p,setUa:f,parseUserAgent:g});function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){return v="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(){return A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A.apply(this,arguments)}function _(e){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_(e)}function x(e,t){return x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},x(e,t)}function E(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,s=[],o=!0,a=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(c){a=!0,i=c}finally{try{o||null==n.return||n.return()}finally{if(a)throw i}}return s}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var T="mobile",C="tablet",P="smarttv",O="console",N="wearable",R="embedded",M=void 0,U={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},L={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},B={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},D=function(e){return e||(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none")},j=function(){return!("undefined"===typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},F=function(e){var t=j();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},z=function(e,t,n,r){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?y(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e,{vendor:D(t.vendor),model:D(t.model),os:D(n.name),osVersion:D(n.version),ua:D(r)})};var W=function(e){return e.type===T},q=function(e){return e.type===C},H=function(e){var t=e.type;return t===T||t===C},V=function(e){return e.type===P},G=function(e){return e.type===M},K=function(e){return e.type===N},J=function(e){return e.type===O},Z=function(e){return e.type===R},Q=function(e){var t=e.vendor;return D(t)},Y=function(e){var t=e.model;return D(t)},X=function(e){var t=e.type;return D(t,"browser")},$=function(e){return e.name===L.Android},ee=function(e){return e.name===L.Windows},te=function(e){return e.name===L.MAC_OS},ne=function(e){return e.name===L.WindowsPhone},re=function(e){return e.name===L.IOS},ie=function(e){var t=e.version;return D(t)},se=function(e){var t=e.name;return D(t)},oe=function(e){return e.name===U.Chrome},ae=function(e){return e.name===U.Firefox},ce=function(e){return e.name===U.Chromium},le=function(e){return e.name===U.Edge},ue=function(e){return e.name===U.Yandex},de=function(e){var t=e.name;return t===U.Safari||t===U.MobileSafari},he=function(e){return e.name===U.MobileSafari},pe=function(e){return e.name===U.Opera},fe=function(e){var t=e.name;return t===U.InternetExplorer||t===U.Ie},ge=function(e){return e.name===U.MIUI},me=function(e){return e.name===U.SamsungBrowser},ye=function(e){var t=e.version;return D(t)},ve=function(e){var t=e.major;return D(t)},we=function(e){var t=e.name;return D(t)},be=function(e){var t=e.name;return D(t)},Ae=function(e){var t=e.version;return D(t)},_e=function(){var e=j(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"===typeof t&&/electron/.test(t)},xe=function(e){return"string"===typeof e&&-1!==e.indexOf("Edg/")},Ee=function(){var e=j();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},ke=function(){return F("iPad")},Se=function(){return F("iPhone")},Ie=function(){return F("iPod")},Te=function(e){return D(e)};function Ce(e){var t=e||m,n=t.device,r=t.browser,i=t.os,s=t.engine,o=t.ua;return{isSmartTV:V(n),isConsole:J(n),isWearable:K(n),isEmbedded:Z(n),isMobileSafari:he(r)||ke(),isChromium:ce(r),isMobile:H(n)||ke(),isMobileOnly:W(n),isTablet:q(n)||ke(),isBrowser:G(n),isDesktop:G(n),isAndroid:$(i),isWinPhone:ne(i),isIOS:re(i)||ke(),isChrome:oe(r),isFirefox:ae(r),isSafari:de(r),isOpera:pe(r),isIE:fe(r),osVersion:ie(i),osName:se(i),fullBrowserVersion:ye(r),browserVersion:ve(r),browserName:we(r),mobileVendor:Q(n),mobileModel:Y(n),engineName:be(s),engineVersion:Ae(s),getUA:Te(o),isEdge:le(r)||xe(o),isYandex:ue(r),deviceType:X(n),isIOS13:Ee(),isIPad13:ke(),isIPhone13:Se(),isIPod13:Ie(),isElectron:_e(),isEdgeChromium:xe(o),isLegacyEdge:le(r)&&!xe(o),isWindows:ee(i),isMacOs:te(i),isMIUI:ge(r),isSamsungBrowser:me(r)}}var Pe=V(u),Oe=J(u),Ne=K(u),Re=Z(u),Me=he(c)||ke(),Ue=ce(c),Le=H(u)||ke(),Be=W(u),De=q(u)||ke(),je=G(u),Fe=G(u),ze=$(h),We=ne(h),qe=re(h)||ke(),He=oe(c),Ve=ae(c),Ge=de(c),Ke=pe(c),Je=fe(c),Ze=ie(h),Qe=se(h),Ye=ye(c),Xe=ve(c),$e=we(c),et=Q(u),tt=Y(u),nt=be(d),rt=Ae(d),it=Te(p),st=le(c)||xe(p),ot=ue(c),at=X(u),ct=Ee(),lt=ke(),ut=Se(),dt=Ie(),ht=_e(),pt=xe(p),ft=le(c)&&!xe(p),gt=ee(h),mt=te(h),yt=ge(c),vt=me(c);function wt(e){var t=e||window.navigator.userAgent;return g(t)}t.m0=ze,t.gm=Ve,t.un=qe,t.Fr=Le,t.nr=Ge},2376:(e,t,n)=>{"use strict";function r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>t(e),e)}n.d(t,{F:()=>r})},2724:(e,t,n)=>{"use strict";n.d(t,{n:()=>r});const r={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0}},3717:(e,t,n)=>{"use strict";n.d(t,{T:()=>i,Z:()=>s});var r=n(51659);class i extends r.C{constructor(){let{docsPath:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join("\n"),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class s extends r.C{constructor(e){let{docsPath:t,metaMessages:n,type:r}=e;super('Account type "'.concat(r,'" is not supported.'),{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}},3756:(e,t,n)=>{"use strict";n.d(t,{r:()=>r});const r={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol
2:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}}},4386:(e,t,n)=>{"use strict";n.d(t,{MM:()=>_,ft:()=>k});var r=n(15882),i=n(24107),s=n(25741),o=n(65057),a=n(45334),c=n(11383),l=n(66719),u=n(94718),d=n(47563),h=n(36954),p=n(38314),f=n(80681),g=n(44288),m=n(6195),y=n(45226),v=n(41773),w=n(52431),b=n(97562);const A=["chainId","from","gas","gasPrice","nonce","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","type"],_=["blobVersionedHashes","chainId","fees","gas","nonce","type"],x=new Map,E=new m.A(128);async function k(e,t){var n,m,k;let S=t;const{account:I=e.account,chain:T=e.chain,nonceManager:C,parameters:P=_}=S,O="function"===typeof(null===T||void 0===T?void 0:T.prepareTransactionRequest)?{fn:T.prepareTransactionRequest,runAt:["beforeFillTransaction"]}:Array.isArray(null===T||void 0===T?void 0:T.prepareTransactionRequest)?{fn:T.prepareTransactionRequest[0],runAt:T.prepareTransactionRequest[1].runAt}:void 0;let N;async function R(){if(N)return N;if("undefined"!==typeof S.chainId)return S.chainId;if(T)return T.id;const t=await(0,g.T)(e,b.T,"getChainId")({});return N=t,N}const M=I?(0,s.J)(I):I;let U=S.nonce;if(P.includes("nonce")&&"undefined"===typeof U&&M&&C){const t=await R();U=await C.consume({address:M.address,chainId:t,client:e})}null!==O&&void 0!==O&&O.fn&&null!==(n=O.runAt)&&void 0!==n&&n.includes("beforeFillTransaction")&&(S=await O.fn(S,{phase:"beforeFillTransaction"}),null!==U&&void 0!==U||(U=S.nonce));const L=(()=>{if((P.includes("blobVersionedHashes")||P.includes("sidecars"))&&S.kzg&&S.blobs)return!1;if(!1===E.get(e.uid))return!1;return!!["fees","gas"].some(e=>P.includes(e))&&(!(!P.includes("chainId")||"number"===typeof S.chainId)||(!(!P.includes("nonce")||"number"===typeof U)||(!(!P.includes("fees")||"bigint"===typeof S.gasPrice||"bigint"===typeof S.maxFeePerGas&&"bigint"===typeof S.maxPriorityFeePerGas)||!(!P.includes("gas")||"bigint"===typeof S.gas))))})()?await(0,g.T)(e,w.a,"fillTransaction")((0,i.A)((0,i.A)({},S),{},{nonce:U})).then(t=>{const n=t.transaction,{chainId:s,from:o,gas:a,gasPrice:c,nonce:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,type:p}=n,f=(0,r.A)(n,A);return E.set(e.uid,!0),(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},S),o?{from:o}:{}),p?{type:p}:{}),"undefined"!==typeof s?{chainId:s}:{}),"undefined"!==typeof a?{gas:a}:{}),"undefined"!==typeof c?{gasPrice:c}:{}),"undefined"!==typeof l?{nonce:l}:{}),"undefined"!==typeof u?{maxFeePerBlobGas:u}:{}),"undefined"!==typeof d?{maxFeePerGas:d}:{}),"undefined"!==typeof h?{maxPriorityFeePerGas:h}:{}),"nonceKey"in f&&"undefined"!==typeof f.nonceKey?{nonceKey:f.nonceKey}:{})}).catch(t=>{var n;const r=t,i=null===(n=r.walk)||void 0===n?void 0:n.call(r,e=>{const t=e;return"MethodNotFoundRpcError"===t.name||"MethodNotSupportedRpcError"===t.name});return i&&E.set(e.uid,!1),S}):S;null!==U&&void 0!==U||(U=L.nonce),S=(0,i.A)((0,i.A)((0,i.A)({},L),M?{from:null===M||void 0===M?void 0:M.address}:{}),U?{nonce:U}:{});const{blobs:B,gas:D,kzg:j,type:F}=S;let z;async function W(){return z||(z=await(0,g.T)(e,c.g,"getBlock")({blockTag:"latest"}),z)}if(null!==O&&void 0!==O&&O.fn&&null!==(m=O.runAt)&&void 0!==m&&m.includes("beforeFillParameters")&&(S=await O.fn(S,{phase:"beforeFillParameters"})),P.includes("nonce")&&"undefined"===typeof U&&M&&!C&&(S.nonce=await(0,g.T)(e,l.y,"getTransactionCount")({address:M.address,blockTag:"pending"})),(P.includes("blobVersionedHashes")||P.includes("sidecars"))&&B&&j){const e=(0,d.S)({blobs:B,kzg:j});if(P.includes("blobVersionedHashes")){const t=(0,p.d)({commitments:e,to:"hex"});S.blobVersionedHashes=t}if(P.includes("sidecars")){const t=(0,h.t)({blobs:B,commitments:e,kzg:j}),n=(0,f.T)({blobs:B,commitments:e,proofs:t,to:"hex"});S.sidecars=n}}if(P.includes("chainId")&&(S.chainId=await R()),(P.includes("fees")||P.includes("type"))&&"undefined"===typeof F)try{S.type=(0,v.L)(S)}catch(q){let t=x.get(e.uid);if("undefined"===typeof t){const n=await W();t="bigint"===typeof(null===n||void 0===n?void 0:n.baseFeePerGas),x.set(e.uid,t)}S.type=t?"eip1559":"legacy"}if(P.includes("fees"))if("legacy"!==S.type&&"eip2930"!==S.type){if("undefined"===typeof S.maxFeePerGas||"undefined"===typeof S.maxPriorityFeePerGas){const t=await W(),{maxFeePerGas:n,maxPriorityFeePerGas:r}=await(0,o.O)(e,{block:t,chain:T,request:S});if("undefined"===typeof S.maxPriorityFeePerGas&&S.maxFeePerGas&&S.maxFeePerGas<r)throw new u.RR({maxPriorityFeePerGas:r});S.maxPriorityFeePerGas=r,S.maxFeePerGas=n}}else{if("undefined"!==typeof S.maxFeePerGas||"undefined"!==typeof S.maxPriorityFeePerGas)throw new u.pw;if("undefined"===typeof S.gasPrice){const t=await W(),{gasPrice:n}=await(0,o.O)(e,{block:t,chain:T,request:S,type:"legacy"});S.gasPrice=n}}return P.includes("gas")&&"undefined"===typeof D&&(S.gas=await(0,g.T)(e,a.Q,"estimateGas")((0,i.A)((0,i.A)({},S),{},{account:M,prepare:"local"===(null===M||void 0===M?void 0:M.type)?[]:["blobVersionedHashes"]}))),null!==O&&void 0!==O&&O.fn&&null!==(k=O.runAt)&&void 0!==k&&k.includes("afterFillParameters")&&(S=await O.fn(S,{phase:"afterFillParameters"})),(0,y.c)(S),delete S.parameters,S}}
2,4564:(e,t,n)=>{"use strict";n.d(t,{X:()=>m,J:()=>g});var r=n(42483),i=n(33809),s=n(49645),o=n(18656),a=n(73183),c=n(78203),l=n(70759),u=n(68419),d=n(44270);const h="/docs/contract/encodeErrorResult";function p(e){const{abi:t,errorName:n,args:r}=e;let i=t[0];if(n){const e=(0,d.iY)({abi:t,args:r,name:n});if(!e)throw new o.yy(n,{docsPath:h});i=e}if("error"!==i.type)throw new o.yy(void 0,{docsPath:h});const s=(0,u.B)(i),p=(0,c.V)(s);let f="0x";if(r&&r.length>0){if(!i.inputs)throw new o.ZP(i.name,{docsPath:h});f=(0,l.h)(i.inputs,r)}return(0,a.aP)([p,f])}const f="/docs/contract/encodeFunctionResult";const g="x-batch-gateway:true";async function m(e){const{data:t,ccipRequest:n}=e,{args:[a]}=(0,s.J)({abi:r.b2,data:t}),c=[],u=[];return await Promise.all(a.map(async(e,t)=>{try{u[t]=e.urls.includes(g)?await m({data:e.data,ccipRequest:n}):await n(e),c[t]=!1}catch(o){c[t]=!0,u[t]="HttpRequestError"===(s=o).name&&s.status?p({abi:r.b2,errorName:"HttpError",args:[s.status,s.shortMessage]}):p({abi:[i.Mc],errorName:"Error",args:["shortMessage"in s?s.shortMessage:s.message]})}var s})),function(e){const{abi:t,functionName:n,result:r}=e;let i=t[0];if(n){const e=(0,d.iY)({abi:t,name:n});if(!e)throw new o.Iz(n,{docsPath:f});i=e}if("function"!==i.type)throw new o.Iz(void 0,{docsPath:f});if(!i.outputs)throw new o.MR(i.name,{docsPath:f});const s=(()=>{if(0===i.outputs.length)return[];if(1===i.outputs.length)return[r];if(Array.isArray(r))return r;throw new o.dm(r)})();return(0,l.h)(i.outputs,s)}({abi:r.b2,functionName:"query",result:[c,u]})}},4750:(e,t,n)=>{"use strict";n.d(t,{Cq:()=>Ln,FA:()=>Dn,TZ:()=>Bn,UF:()=>Mn});var r=n(24107),i=n(77628),s=n(77101);function o(e){if(!function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function a(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const c="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,l=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function u(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),o(e),e}class d{clone(){return this._cloneInto()}}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(c&&"function"==typeof c.getRandomValues)return c.getRandomValues(new Uint8Array(e));if(c&&"function"==typeof c.randomBytes)return c.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class p extends d{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=l(this.buffer)}update(e){a(this);const{view:t,buffer:n,blockLen:r}=this,i=(e=u(e)).length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);if(o===r){const t=l(e);for(;r<=i-s;s+=r)this.process(t,s);continue}n.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){a(this),function(e,t){o(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:i}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>r-s&&(this.process(n,0),s=0);for(let o=s;o<r;o++)t[o]=0;(function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,a,r)})(n,r-8,BigInt(8*this.length),i),this.process(n,0);const c=l(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=u/4,h=this.get();if(d>h.length)throw new Error("_sha2: outputLen bigger than state");for(let o=0;o<d;o++)c.setUint32(4*o,h[o],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:i,destroyed:s,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=s,r%t&&e.buffer.set(n),e}}const f=BigInt(2**32-1),g=BigInt(32);function m(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(e&f),l:Number(e>>g&f)}:{h:0|Number(e>>g&f),l:0|Number(e&f)}}const y={fromBig:m,split:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(e.length),r=new
vendor: 1,830 bytes, line 2
2Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:s,l:o}=m(e[i],t);[n[i],r[i]]=[s,o]}return[n,r]},toBig:(e,t)=>BigInt(e>>>0)<<g|BigInt(t>>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<<n|t>>>32-n,rotlSL:(e,t,n)=>t<<n|e>>>32-n,rotlBH:(e,t,n)=>t<<n-32|e>>>64-n,rotlBL:(e,t,n)=>e<<n-32|t>>>64-n,add:function(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,s)=>t+n+r+i+s+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)},[v,w]=y.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
25771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),b=new Uint32Array(80),A=new Uint32Array(80);class _ extends p{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:s,Dh:o,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g]}set(e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|s,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let y=0;y<16;y++,t+=4)b[y]=e.getUint32(t),A[y]=e.getUint32(t+=4);for(let v=16;v<80;v++){const e=0|b[v-15],t=0|A[v-15],n=y.rotrSH(e,t,1)^y.rotrSH(e,t,8)^y.shrSH(e,t,7),r=y.rotrSL(e,t,1)^y.rotrSL(e,t,8)^y.shrSL(e,t,7),i=0|b[v-2],s=0|A[v-2],o=y.rotrSH(i,s,19)^y.rotrBH(i,s,61)^y.shrSH(i,s,6),a=y.rotrSL(i,s,19)^y.rotrBL(i,s,61)^y.shrSL(i,s,6),c=y.add4L(r,a,A[v-7],A[v-16]),l=y.add4H(c,n,o,b[v-7],b[v-16]);b[v]=0|l,A[v]=0|c}let{Ah:n,Al:r,Bh:i,Bl:s,Ch:o,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:p,Gh:f,Gl:g,Hh:m,Hl:_}=this;for(let x=0;x<80;x++){const e=y.rotrSH(u,d,14)^y.rotrSH(u,d,18)^y.rotrBH(u,d,41),t=y.rotrSL(u,d,14)^y.rotrSL(u,d,18)^y.rotrBL(u,d,41),E=u&h^~u&f,k=d&p^~d&g,S=y.add5L(_,t,k,w[x],A[x]),I=y.add5H(S,m,e,E,v[x],b[x]),T=0|S,C=y.rotrSH(n,r,28)^y.rotrBH(n,r,34)^y.rotrBH(n,r,39),P=y.rotrSL(n,r,28)^y.rotrBL(n,r,34)^y.rotrBL(n,r,39),O=n&i^n&o^i&o,N=r&s^r&a^s&a;m=0|f,_=0|g,f=0|h,g=0|p,h=0|u,p=0|d,({h:u,l:d}=y.add(0|c,0|l,0|I,0|T)),c=0|o,l=0|a,o=0|i,a=0|s,i=0|n,s=0|r;const R=y.add3L(T,P,N);n=y.add3H(R,I,C,O),r=0|R}({h:n,l:r}=y.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:s}=y.add(0|this.Bh,0|this.Bl,0|i,0|s)),({h:o,l:a}=y.add(0|this.Ch,0|this.Cl,0|o,0|a)),({h:c,l:l}=y.add(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=y.add(0|this.Eh,0|this.El,0|u,0|d)),({h:h,l:p}=y.add(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:g}=y.add(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:_}=y.add(0|this.Hh,0|this.Hl,0|m,0|_)),this.set(n,r,i,s,o,a,c,l,u,d,h,p,f,g,m,_)}roundClean(){b.fill(0),A.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const x=function(e){const t=t=>e().update(u(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}(()=>new _),E=BigInt(0),k=BigInt(1),S=BigInt(2);function I(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function T(e){if(!I(e))throw new Error("Uint8Array expected")}function C(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}const P=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function O(e){T(e);let t="";for(let n=0;n<e.length;n++)t+=P[e[n]];return t}function N(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?E:BigInt("0x"+e)}const R=48,M=57,U=65,L=70,B=97,D=102;function j(e){return e>=R&&e<=M?e-R:e>=U&&e<=L?e-(U-10):e>=B&&e<=D?e-(B-10):void 0}function F(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const t=j(e.charCodeAt(s)),n=j(e.charCodeAt(s+1));if(void 0===t||void 0===n){const t=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+s)}r[i]=16*t+n}return r}function z(e){return T(e),N(O(Uint8Array.from(e).reverse()))}function W(e,t){return F(e.toString(16).padStart(2*t,"0"))}function q(e,t){return W(e,t).reverse()}function H(e,t,n){let r;if("string"==typeof t)try{r=F(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else{if(!I(t))throw new Error(e+" must be hex string or Uint8Array");r=Uint8Array.from(t)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(e+" of length "+n+" expected, got "+i);return r}function V(){let e=0;for(let n=0;n<arguments.length;n++){const t=n<0||arguments.length<=n?void 0:arguments[n];T(t),e+=t.length}const t=new Uint8Array(e);for(let n=0,r=0;n<arguments.length;n++){const e=n<0||arguments.length<=n?void 0:arguments[n];t.set(e,r),r+=e.length}return t}const G=e=>"bigint"==typeof e&&E<=e;function K(e,t,n,r){if(!function(e,t,n){return G(e)&&G(t)&&G(n)&&t<=e&&e<n}(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}const J=e=>(S<<BigInt(e-1))-k,Z={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||I(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Q(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(t,n,r)=>{const i=Z[n];if("function"!=typeof i)throw new Error("invalid validator function");const s=e[t];if((!r||void 0!==s)&&!i(s,e))throw new Error("param "+String(t)+" is invali
2d. Expected "+n+", got "+s)};for(const[i,s]of Object.entries(t))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return e}function Y(e){const t=new WeakMap;return function(n){const r=t.get(n);if(void 0!==r)return r;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];const a=e(n,...s);return t.set(n,a),a}}const X=BigInt(0),$=BigInt(1),ee=BigInt(2),te=BigInt(3),ne=BigInt(4),re=BigInt(5),ie=BigInt(8);function se(e,t){const n=e%t;return n>=X?n:t+n}function oe(e,t,n){if(t<X)throw new Error("invalid exponent, negatives unsupported");if(n<=X)throw new Error("invalid modulus");if(n===$)return X;let r=$;for(;t>X;)t&$&&(r=r*e%n),e=e*e%n,t>>=$;return r}function ae(e,t,n){let r=e;for(;t-- >X;)r*=r,r%=n;return r}function ce(e,t){if(e===X)throw new Error("invert: expected non-zero number");if(t<=X)throw new Error("invert: expected positive modulus, got "+t);let n=se(e,t),r=t,i=X,s=$;for(;n!==X;){const e=r%n,t=i-s*(r/n);r=n,n=e,i=s,s=t}if(r!==$)throw new Error("invert: does not exist");return se(i,t)}function le(e){if(e%ne===te){const t=(e+$)/ne;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%ie===re){const t=(e-re)/ie;return function(e,n){const r=e.mul(n,ee),i=e.pow(r,t),s=e.mul(n,i),o=e.mul(e.mul(s,ee),i),a=e.mul(s,e.sub(o,e.ONE));if(!e.eql(e.sqr(a),n))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-$)/ee;let n,r,i;for(n=e-$,r=0;n%ee===X;n/=ee,r++);for(i=ee;i<e&&oe(i,t,e)!==e-$;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===r){const t=(e+$)/ne;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}const s=(n+$)/ee;return function(e,o){if(e.pow(o,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=r,c=e.pow(e.mul(e.ONE,i),n),l=e.pow(o,s),u=e.pow(o,n);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(u);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const n=e.pow(c,$<<BigInt(a-t-1));c=e.sqr(n),l=e.mul(l,n),u=e.mul(u,c),a=t}return l}}(e)}const ue=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function de(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function he(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e<=X)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:i,nByteLength:s}=de(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:e,isLE:n,BITS:i,BYTES:s,MASK:J(i),ZERO:X,ONE:$,create:t=>se(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return X<=t&&t<e},is0:e=>e===X,isOdd:e=>(e&$)===$,neg:t=>se(-t,e),eql:(e,t)=>e===t,sqr:t=>se(t*t,e),add:(t,n)=>se(t+n,e),sub:(t,n)=>se(t-n,e),mul:(t,n)=>se(t*n,e),pow:(e,t)=>function(e,t,n){if(n<X)throw new Error("invalid exponent, negatives unsupported");if(n===X)return e.ONE;if(n===$)return t;let r=e.ONE,i=t;for(;n>X;)n&$&&(r=e.mul(r,i)),i=e.sqr(i),n>>=$;return r}(a,e,t),div:(t,n)=>se(t*ce(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>ce(t,e),sqrt:r.sqrt||(t=>(o||(o=le(e)),o(a,t))),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}(a,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?q(e,s):W(e,s),fromBytes:e=>{if(e.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return n?z(e):function(e){return N(O(e))}(e)}});return Object.freeze(a)}const pe=BigInt(0),fe=BigInt(1);function ge(e,t){const n=t.negate();return e?n:t}function me(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ye(e,t){me(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}const ve=new WeakMap,we=new WeakMap;function be(e){return we.get(e)||1}function Ae(e,t,n,r){if(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}(n,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,s=function(e){let t;for(t=0;e>E;e>>=k,t+=1);return t}(BigInt(n.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<<o)-1,c=new Array(a+1).fill(i);let l=i;for(let u=Math.floor((t.BITS-1)/o)*o;u>=0;u-=o){c.fill(i);for(let t=0;t<r.length;t++){const e=r[t],i=Number(e>>BigInt(u)&BigInt(a));c[i]=c[i].add(n[t])}let e=i;for(let t=c.length-1,n=i;t>0;t--)n=n.add(c[t]),e=e.add(n);if(l=l.add(e),0!==u)for(let t=0;t<o;t++)l=l.double()}return l}function _e(e){return function(e){Q(e,ue.reduce((e,t)=>
2(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),Q(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze((0,r.A)((0,r.A)((0,r.A)({},de(e.n,e.nBitLength)),e),{},{p:e.Fp.ORDER}))}const xe=BigInt(0),Ee=BigInt(1),ke=BigInt(2),Se=BigInt(8),Ie={zip215:!0};function Te(e){const t=function(e){const t=_e(e);return Q(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze((0,r.A)({},t))}(e),{Fp:n,n:i,prehash:s,hash:o,randomBytes:a,nByteLength:c,h:l}=t,u=ke<<BigInt(8*c)-Ee,d=n.create,h=he(t.n,t.nBitLength),p=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch(r){return{isValid:!1,value:xe}}}),f=t.adjustScalarBytes||(e=>e),g=t.domain||((e,t,n)=>{if(C("phflag",n),t.length||n)throw new Error("Contexts/pre-hash are not supported");return e});function m(e,t){K("coordinate "+e,t,xe,u)}function y(e){if(!(e instanceof b))throw new Error("ExtendedPoint expected")}const v=Y((e,t)=>{const{ex:r,ey:i,ez:s}=e,o=e.is0();null==t&&(t=o?Se:n.inv(s));const a=d(r*t),c=d(i*t),l=d(s*t);if(o)return{x:xe,y:Ee};if(l!==Ee)throw new Error("invZ was invalid");return{x:a,y:c}}),w=Y(e=>{const{a:n,d:r}=t;if(e.is0())throw new Error("bad point: ZERO");const{ex:i,ey:s,ez:o,et:a}=e,c=d(i*i),l=d(s*s),u=d(o*o),h=d(u*u),p=d(c*n);if(d(u*d(p+l))!==d(h+d(r*d(c*l))))throw new Error("bad point: equation left != right (1)");if(d(i*s)!==d(o*a))throw new Error("bad point: equation left != right (2)");return!0});class b{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r,m("x",e),m("y",t),m("z",n),m("t",r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof b)throw new Error("extended point not allowed");const{x:t,y:n}=e||{};return m("x",t),m("y",n),new b(t,n,Ee,d(t*n))}static normalizeZ(e){const t=n.invertBatch(e.map(e=>e.ez));return e.map((e,n)=>e.toAffine(t[n])).map(b.fromAffine)}static msm(e,t){return Ae(b,h,e,t)}_setWindowSize(e){x.setWindowSize(this,e)}assertValidity(){w(this)}equals(e){y(e);const{ex:t,ey:n,ez:r}=this,{ex:i,ey:s,ez:o}=e,a=d(t*o),c=d(i*r),l=d(n*o),u=d(s*r);return a===c&&l===u}is0(){return this.equals(b.ZERO)}negate(){return new b(d(-this.ex),this.ey,this.ez,d(-this.et))}double(){const{a:e}=t,{ex:n,ey:r,ez:i}=this,s=d(n*n),o=d(r*r),a=d(ke*d(i*i)),c=d(e*s),l=n+r,u=d(d(l*l)-s-o),h=c+o,p=h-a,f=c-o,g=d(u*p),m=d(h*f),y=d(u*f),v=d(p*h);return new b(g,m,v,y)}add(e){y(e);const{a:n,d:r}=t,{ex:i,ey:s,ez:o,et:a}=this,{ex:c,ey:l,ez:u,et:h}=e;if(n===BigInt(-1)){const e=d((s-i)*(l+c)),t=d((s+i)*(l-c)),n=d(t-e);if(n===xe)return this.double();const r=d(o*ke*h),p=d(a*ke*u),f=p+r,g=t+e,m=p-r,y=d(f*n),v=d(g*m),w=d(f*m),A=d(n*g);return new b(y,v,A,w)}const p=d(i*c),f=d(s*l),g=d(a*r*h),m=d(o*u),v=d((i+s)*(c+l)-p-f),w=m-g,A=m+g,_=d(f-n*p),x=d(v*w),E=d(A*_),k=d(v*_),S=d(w*A);return new b(x,E,S,k)}subtract(e){return this.add(e.negate())}wNAF(e){return x.wNAFCached(this,e,b.normalizeZ)}multiply(e){const t=e;K("scalar",t,Ee,i);const{p:n,f:r}=this.wNAF(t);return b.normalizeZ([n,r])[0]}multiplyUnsafe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.ZERO;const n=e;return K("scalar",n,xe,i),n===xe?_:this.is0()||n===Ee?this:x.wNAFCachedUnsafe(this,n,b.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return x.unsafeLadder(this,i).is0()}toAffine(e){return v(this,e)}clearCofactor(){const{h:e}=t;return e===Ee?this:this.multiplyUnsafe(e)}static fromHex(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{d:i,a:s}=t,o=n.BYTES;e=H("pointHex",e,o),C("zip215",r);const a=e.slice(),c=e[o-1];a[o-1]=-129&c;const l=z(a),h=r?u:n.ORDER;K("pointHex.y",l,xe,h);const f=d(l*l),g=d(f-Ee),m=d(i*f-s);let{isValid:y,value:v}=p(g,m);if(!y)throw new Error("Point.fromHex: invalid y coordinate");const w=(v&Ee)===Ee,A=0!==(128&c);if(!r&&v===xe&&A)throw new Error("Point.fromHex: x=0 and x_0=1");return A!==w&&(v=d(-v)),b.fromAffine({x:v,y:l})}static fromPrivateKey(e){return S(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),r=q(t,n.BYTES);return r[r.length-1]|=e&Ee?128:0,r}toHex(){return O(this.toRawBytes())}}b.BASE=new b(t.Gx,t.Gy,Ee,d(t.Gx*t.Gy)),b.ZERO=new b(xe,Ee,Ee,xe);const{BASE:A,ZERO:_}=b,x=function(e,t){return{constTimeNegate:ge,hasPrecomputes:e=>1!==be(e),unsafeLadder(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.ZERO,i=t;
2for(;n>pe;)n&fe&&(r=r.add(i)),i=i.double(),n>>=fe;return r},precomputeWindow(e,n){const{windows:r,windowSize:i}=ye(n,t),s=[];let o=e,a=o;for(let t=0;t<r;t++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(n,r,i){const{windows:s,windowSize:o}=ye(n,t);let a=e.ZERO,c=e.BASE;const l=BigInt(2**n-1),u=2**n,d=BigInt(n);for(let e=0;e<s;e++){const t=e*o;let n=Number(i&l);i>>=d,n>o&&(n-=u,i+=fe);const s=t,h=t+Math.abs(n)-1,p=e%2!==0,f=n<0;0===n?c=c.add(ge(p,r[s])):a=a.add(ge(f,r[h]))}return{p:a,f:c}},wNAFUnsafe(n,r,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.ZERO;const{windows:o,windowSize:a}=ye(n,t),c=BigInt(2**n-1),l=2**n,u=BigInt(n);for(let e=0;e<o;e++){const t=e*a;if(i===pe)break;let n=Number(i&c);if(i>>=u,n>a&&(n-=l,i+=fe),0===n)continue;let o=r[t+Math.abs(n)-1];n<0&&(o=o.negate()),s=s.add(o)}return s},getPrecomputes(e,t,n){let r=ve.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&ve.set(t,n(r))),r},wNAFCached(e,t,n){const r=be(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const i=be(e);return 1===i?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){me(n,t),we.set(e,n),ve.delete(e)}}}(b,8*c);function E(e){return se(e,i)}function k(e){return E(z(e))}function S(e){const t=n.BYTES;e=H("private key",e,t);const r=H("hashed private key",o(e),2*t),i=f(r.slice(0,t)),s=r.slice(t,2*t),a=k(i),c=A.multiply(a),l=c.toRawBytes();return{head:i,prefix:s,scalar:a,point:c,pointBytes:l}}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=V(...n);return k(o(g(i,H("context",e),!!s)))}const T=Ie;return A._setWindowSize(8),{CURVE:t,getPublicKey:function(e){return S(e).pointBytes},sign:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=H("message",e),s&&(e=s(e));const{prefix:o,scalar:a,pointBytes:c}=S(t),l=I(r.context,o,e),u=A.multiply(l).toRawBytes(),d=E(l+I(r.context,u,c,e)*a);return K("signature.s",d,xe,i),H("result",V(u,q(d,n.BYTES)),2*n.BYTES)},verify:function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:T;const{context:o,zip215:a}=i,c=n.BYTES;e=H("signature",e,2*c),t=H("message",t),r=H("publicKey",r,c),void 0!==a&&C("zip215",a),s&&(t=s(t));const l=z(e.slice(c,2*c));let u,d,h;try{u=b.fromHex(r,a),d=b.fromHex(e.slice(0,c),a),h=A.multiplyUnsafe(l)}catch(f){return!1}if(!a&&u.isSmallOrder())return!1;const p=I(o,d.toRawBytes(),u.toRawBytes(),t);return d.add(u.multiplyUnsafe(p)).subtract(h).clearCofactor().equals(b.ZERO)},ExtendedPoint:b,utils:{getExtendedPublicKey:S,randomPrivateKey:()=>a(n.BYTES),precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}}}}BigInt(0),BigInt(1);const Ce=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Pe=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const Oe=BigInt(1),Ne=BigInt(2);BigInt(3);const Re=BigInt(5),Me=BigInt(8);function Ue(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function Le(e,t){const n=Ce,r=se(t*t*t,n),i=function(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=Ce,o=e*e%s*e%s,a=ae(o,Ne,s)*o%s,c=ae(a,Oe,s)*e%s,l=ae(c,Re,s)*c%s,u=ae(l,t,s)*l%s,d=ae(u,n,s)*u%s,h=ae(d,r,s)*d%s,p=ae(h,i,s)*h%s,f=ae(p,i,s)*h%s,g=ae(f,t,s)*l%s;return{pow_p_5_8:ae(g,Ne,s)*e%s,b2:o}}(e*se(r*r*t,n)).pow_p_5_8;let s=se(e*r*i,n);const o=se(t*s*s,n),a=s,c=se(s*Pe,n),l=o===e,u=o===se(-e,n),d=o===se(-e*Pe,n);return l&&(s=a),(u||d)&&(s=c),((e,t)=>(se(e,t)&$)===$)(s,n)&&(s=se(-s,n)),{isValid:l||u,value:s}}const Be=he(Ce,void 0,!0),De=Te({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Be,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Me,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:x,randomBytes:h,adju
2stScalarBytes:Ue,uvRatio:Le}),je="EdDSA",Fe="JWT",ze=".",We="base64url",qe="utf8",He="utf8",Ve=":",Ge="did",Ke="key",Je="base58btc",Ze="z",Qe="K36",Ye=32;function Xe(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function $e(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Xe(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function et(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));const n=$e(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return Xe(n)}var tt=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(255!==n[o])throw new TypeError(s+" is ambiguous");n[o]=i}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var s=(e.length-t)*l+1>>>0,o=new Uint8Array(s);e[t];){var u=n[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=s-1;(0!==u||d<i)&&-1!==h;h--,d++)u+=a*o[h]>>>0,o[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var p=s-i;p!==s&&0===o[p];)p++;for(var f=new Uint8Array(r+(s-p)),g=r;p!==s;)f[g++]=o[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,s=t.length;i!==s&&0===t[i];)i++,n++;for(var o=(s-i)*u+1>>>0,l=new Uint8Array(o);i!==s;){for(var d=t[i],h=0,p=o-1;(0!==d||h<r)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=o-r;f!==o&&0===l[f];)f++;for(var g=c.repeat(n);f<o;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:d,decode:function(e){var n=d(e);if(n)return n;throw new Error("Non-".concat(t," character"))}}};const nt=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class rt{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(e));throw Error("Unknown type, must be binary type")}}class it{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(e),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix));return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return ot(this,e)}}class st{constructor(e){this.decoders=e}or(e){return ot(this,e)}decode(e){const t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(e),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}const ot=(e,t)=>new st((0,r.A)((0,r.A)({},e.decoders||{[e.prefix]:e}),t.decoders||{[t.prefix]:t}));class at{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new rt(e,t,n),this.decoder=new it(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ct=e=>{let{name:t,prefix:n,encode:r,decode:i}=e;return new at(t,n,r,i)},lt=e=>{let{prefix:t,name:n,alphabet:r}=e;const{encode:i,decode:s}=tt(r,n);return ct({prefix:t,name:n,encode:i,decode:e=>nt(s(e))})},ut=e=>{let{name:t,prefix:n,bitsPerChar:r,alphabet:i}=e;return ct({prefix:n,name:t,encode:e=>((e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let s="",o=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],o+=8;o>n;)o-=n,s+=t[i&a>>o];if(o&&(s+=t[i&a<<n-o]),r)for(;s.length*n&7;)s+="=";return s})(e,i,r),decode:e=>((e,t,n,r)=>{const i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let s=e.length;for(;"="===e[s-1];)--s;const o=new Uint8Array(s*n/8|0);let a=0,c=0,l=0;for(let u=0;u<s;
2++u){const t=i[e[u]];if(void 0===t)throw new SyntaxError("Non-".concat(r," character"));c=c<<n|t,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o})(e,i,r,t)})},dt=ct({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var ht=Object.freeze({__proto__:null,identity:dt});const pt=ut({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ft=Object.freeze({__proto__:null,base2:pt});const gt=ut({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var mt=Object.freeze({__proto__:null,base8:gt});const yt=lt({prefix:"9",name:"base10",alphabet:"0123456789"});var vt=Object.freeze({__proto__:null,base10:yt});const wt=ut({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),bt=ut({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var At=Object.freeze({__proto__:null,base16:wt,base16upper:bt});const _t=ut({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),xt=ut({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Et=ut({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),kt=ut({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),St=ut({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),It=ut({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Tt=ut({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ct=ut({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Pt=ut({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ot=Object.freeze({__proto__:null,base32:_t,base32upper:xt,base32pad:Et,base32padupper:kt,base32hex:St,base32hexupper:It,base32hexpad:Tt,base32hexpadupper:Ct,base32z:Pt});const Nt=lt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Rt=lt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Mt=Object.freeze({__proto__:null,base36:Nt,base36upper:Rt});const Ut=lt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Lt=lt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Bt=Object.freeze({__proto__:null,base58btc:Ut,base58flickr:Lt});const Dt=ut({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jt=ut({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ft=ut({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),zt=ut({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Wt=Object.freeze({__proto__:null,base64:Dt,base64pad:jt,base64url:Ft,base64urlpad:zt});const qt=Array.from("\ud83d\ude80\ud83e\ude90\u2604\ud83d\udef0\ud83c\udf0c\ud83c\udf11\ud83c\udf12\ud83c\udf13\ud83c\udf14\ud83c\udf15\ud83c\udf16\ud83c\udf17\ud83c\udf18\ud83c\udf0d\ud83c\udf0f\ud83c\udf0e\ud83d\udc09\u2600\ud83d\udcbb\ud83d\udda5\ud83d\udcbe\ud83d\udcbf\ud83d\ude02\u2764\ud83d\ude0d\ud83e\udd23\ud83d\ude0a\ud83d\ude4f\ud83d\udc95\ud83d\ude2d\ud83d\ude18\ud83d\udc4d\ud83d\ude05\ud83d\udc4f\ud83d\ude01\ud83d\udd25\ud83e\udd70\ud83d\udc94\ud83d\udc96\ud83d\udc99\ud83d\ude22\ud83e\udd14\ud83d\ude06\ud83d\ude44\ud83d\udcaa\ud83d\ude09\u263a\ud83d\udc4c\ud83e\udd17\ud83d\udc9c\ud83d\ude14\ud83d\ude0e\ud83d\ude07\ud83c\udf39\ud83e\udd26\ud83c\udf89\ud83d\udc9e\u270c\u2728\ud83e\udd37\ud83d\ude31\ud83d\ude0c\ud83c\udf38\ud83d\ude4c\ud83d\ude0b\ud83d\udc97\ud83d\udc9a\ud83d\ude0f\ud83d\udc9b\ud83d\ude42\ud83d\udc93\ud83e\udd29\ud83d\ude04\ud83d\ude00\ud83d\udda4\ud83d\ude03\ud83d\udcaf\ud83d\ude48\ud83d\udc47\ud83c\udfb6\ud83d\ude12\ud83e\udd2d\u2763\ud83d\ude1c\ud83d\udc8b\ud83d\udc40\ud83d\ude2a\ud83d\ude11\ud83d\udca5\ud83d\ude4b\ud83d\ude1e\ud83d\ude29\ud83d\ude21\ud83e\udd2a\ud83d\udc4a\ud83e\udd73\ud83d\ude25\ud83e\udd24\ud83d\udc49\ud83d\udc83\ud83d\ude33\u270b\ud83d\ude1a\ud83d\ude1d\ud83d\ude34\ud83c\udf1f\ud83d\ude2c\ud83d\ude43\ud83c\udf40\ud83c\udf37\ud83d\ude3b\ud83d\ude13\u2b50\u2705\ud83e\udd7a\ud83c\udf08\ud83d\ude08\ud83e\udd18\ud83d\udca6\u2714\ud83d\ude23\ud83c\udfc3\ud83d\udc90\u2639\ud83c\udf8a\ud83d\udc98\ud83d\ude20\u261d\ud83d\ude15\ud83c\udf3a\ud83c\udf82\ud83c\udf3b\ud83d\ude10\ud83d\udd95\ud83d\udc9d\ud83d\ude4a\ud83d\ude39\ud83d\udde3\ud83d\udcab\ud83d\udc80\ud83d\udc51\ud83c\udfb5\ud83e\udd1e\ud83d\ude1b\ud83d\udd34\ud83d\ude24\ud83c\udf3c\ud83d\ude2b\u26bd\ud83e\udd19\u2615\ud83c\udfc6\ud83e\udd2b\ud83d\udc48\ud83d\ude2e\ud83d\ude46\ud83c\udf7b\ud83c\udf43\ud83d\udc36\ud83d\udc81\ud83d\ude32\ud83c\udf3f\ud83e\udde1\ud83c\udf81\u26a1\ud83c\udf1e\ud83c\udf88\u274c\u270a\ud83d\udc4b\ud83d\ude30\ud83e\udd28\ud83d\ude36\ud83e\udd1d\ud83d\udeb6\ud83d\udcb0\ud83c\udf53\ud83d\udca2\ud83e\udd1f\ud83d\ude41\ud83d\udea8\ud83d\udca8\ud83e\udd2c\u2708\ud83c\udf80\ud83c\udf7a\ud83e\udd13\ud83d\ude19\ud83d\udc9f\ud83c\udf31\ud83d\ude16\ud83d\udc76\ud83e\udd74\u25b6\u27a1\u2753\ud83d\udc8e\ud83d\udcb8\u2b07\ud83d\ude28\ud83c\udf1a\ud83e\udd8b\ud83d\ude37\ud83d\udd7a\u26a0\ud83d\ude45\ud83d\ude1f\ud83d\ude35\ud83d\udc4e\ud83e\udd32\ud83e\udd20\ud83e\udd27\ud83d\udccc\ud83d\udd35\ud83d\udc85\ud83e\uddd0\ud83d\udc3e\ud83c\udf52\ud83d\ude17\ud83e\udd11\ud83c\udf0a\ud83e\udd2f\ud83d\udc37\u260e\ud83d\udca7\ud83d\ude2f\ud83d\udc86\ud83d\udc46\ud83c\udfa4\ud83d\ude47\ud83c\udf51\u2744\ud83c\udf34\ud83d\udca3\ud83d\udc38\ud83d\udc8c\ud83d\udccd\ud83e\udd40\ud83e\udd22\ud83d\udc45\ud83d\udca1\ud83d\udca9\ud83d\udc50\ud83d\udcf8\ud83d\udc7b\ud83e\udd10\ud83e\udd2e\ud83c\udfbc\ud83e\udd75\ud83d\udea9\ud83c\udf4e\ud83c\udf4a\ud83d\udc7c\ud83d\udc8d\ud83d\udce3\ud83e\udd42"),Ht=qt.reduce((e,t,n
2)=>(e[n]=t,e),[]),Vt=qt.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);const Gt=ct({prefix:"\ud83d\ude80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=Ht[t],"")},decode:function(e){const t=[];for(const n of e){const e=Vt[n.codePointAt(0)];if(void 0===e)throw new Error("Non-base256emoji character: ".concat(n));t.push(e)}return new Uint8Array(t)}});var Kt=Object.freeze({__proto__:null,base256emoji:Gt}),Jt=function e(t,n,r){n=n||[];for(var i=r=r||0;t>=Yt;)n[r++]=255&t|Zt,t/=128;for(;t&Qt;)n[r++]=255&t|Zt,t>>>=7;return n[r]=0|t,e.bytes=r-i+1,n},Zt=128,Qt=-128,Yt=Math.pow(2,31);var Xt=function e(t,n){var r,i=0,s=0,o=n=n||0,a=t.length;do{if(o>=a)throw e.bytes=0,new RangeError("Could not decode varint");r=t[o++],i+=s<28?(r&en)<<s:(r&en)*Math.pow(2,s),s+=7}while(r>=$t);return e.bytes=o-n,i},$t=128,en=127;var tn=Math.pow(2,7),nn=Math.pow(2,14),rn=Math.pow(2,21),sn=Math.pow(2,28),on=Math.pow(2,35),an=Math.pow(2,42),cn=Math.pow(2,49),ln=Math.pow(2,56),un=Math.pow(2,63),dn={encode:Jt,decode:Xt,encodingLength:function(e){return e<tn?1:e<nn?2:e<rn?3:e<sn?4:e<on?5:e<an?6:e<cn?7:e<ln?8:e<un?9:10}};const hn=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return dn.encode(e,t,n),t},pn=e=>dn.encodingLength(e),fn=(e,t)=>{const n=t.byteLength,r=pn(e),i=r+pn(n),s=new Uint8Array(i+n);return hn(e,s,0),hn(n,s,r),s.set(t,i),new gn(e,n,t,s)};class gn{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const mn=e=>{let{name:t,code:n,encode:r}=e;return new yn(t,n,r)};class yn{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?fn(this.code,t):t.then(e=>fn(this.code,e))}throw Error("Unknown type, must be binary type")}}const vn=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),wn=mn({name:"sha2-256",code:18,encode:vn("SHA-256")}),bn=mn({name:"sha2-512",code:19,encode:vn("SHA-512")});var An=Object.freeze({__proto__:null,sha256:wn,sha512:bn});const _n=nt,xn={code:0,name:"identity",encode:_n,digest:e=>fn(0,_n(e))};var En=Object.freeze({__proto__:null,identity:xn});new TextEncoder,new TextDecoder;const kn=(0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)({},ht),ft),mt),vt),At),Ot),Mt),Bt),Wt),Kt);function Sn(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}(0,r.A)((0,r.A)({},An),En);const In=Sn("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>(new TextEncoder).encode(e.substring(1))),Tn=Sn("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{const t=$e((e=e.substring(1)).length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),Cn=(0,r.A)({utf8:In,"utf-8":In,hex:kn.base16,latin1:Tn,ascii:Tn,binary:Tn},kn);function Pn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const n=Cn[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}function On(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const n=Cn[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode("".concat(n.prefix).concat(e)):Xe(globalThis.Buffer.from(e,"utf-8"))}function Nn(e){return(0,s.j)(Pn(On(e,We),qe))}function Rn(e){return Pn(On((0,s.h)(e),qe),We)}function Mn(e){const t=On(Qe,Je),n=Ze+Pn(et([t,e]),Je);return[Ge,Ke,n].join(Ve)}function Un(e){return Pn(e,We)}function Ln(e){const t=e.split(ze),n=Nn(t[0]),r=Nn(t[1]),i=function(e){return On(e,We)}(t[2]);return{header:n,payload:r,signature:i,data:On(t.slice(0,2).join(ze),He)}}function Bn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h(Ye);const t=De.getPublicKey(e);return{secretKey:et([e,t]),publicKey:t}}async function Dn(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(0,i.fromMiliseconds)(Date.now());const o={alg:je,typ:Fe},a={iss:Mn(r.publicKey),sub:e,aud:t,iat:s,exp:s+n},c=function(e){return On([Rn(e.header),Rn(e.payload)].join(ze),He)}({header:o,payload:a});return function(e){return[Rn(e.header),Rn(e.payload),Un(e.signature)].join(ze)}({header:o,payload:a,signature:De.sign(c,r.secretKey.slice(0,32))})}}
2,4983:(e,t,n)=>{"use strict";n.d(t,{PK:()=>c,iq:()=>s,uP:()=>a,zF:()=>o});var r=n(75408),i=n(51659);class s extends i.C{constructor(e){let{maxSize:t,size:n}=e;super("Blob size is too large.",{metaMessages:["Max: ".concat(t," bytes"),"Given: ".concat(n," bytes")],name:"BlobSizeTooLargeError"})}}class o extends i.C{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class a extends i.C{constructor(e){let{hash:t,size:n}=e;super('Versioned hash "'.concat(t,'" size is invalid.'),{metaMessages:["Expected: 32","Received: ".concat(n)],name:"InvalidVersionedHashSizeError"})}}class c extends i.C{constructor(e){let{hash:t,version:n}=e;super('Versioned hash "'.concat(t,'" version is invalid.'),{metaMessages:["Expected: ".concat(r.E),"Received: ".concat(n)],name:"InvalidVersionedHashVersionError"})}}},5269:(e,t,n)=>{"use strict";n.d(t,{k:()=>d});var r=n(24107),i=n(15882),s=n(14061),o=n(65747),a=n(63015),c=n(96550),l=n(21839);const u=["atomic","chainId","receipts","version"];async function d(e,t){var n;const d=await async function(t){if(t.endsWith(l.vB.slice(2))){const n=(0,o.B)((0,s.iN)(t,-64,-32)),r=(0,s.iN)(t,0,-64).slice(2).match(/.{1,64}/g),i=await Promise.all(r.map(t=>l.BH.slice(2)!==t?e.request({method:"eth_getTransactionReceipt",params:["0x".concat(t)]},{dedupe:!0}):void 0)),c=i.some(e=>null===e)?100:i.every(e=>"0x1"===(null===e||void 0===e?void 0:e.status))?200:i.every(e=>"0x0"===(null===e||void 0===e?void 0:e.status))?500:600;return{atomic:!1,chainId:(0,a.ME)(n),receipts:i.filter(Boolean),status:c,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[t]})}(t.id),{atomic:h=!1,chainId:p,receipts:f,version:g="2.0.0"}=d,m=(0,i.A)(d,u),[y,v]=(()=>{const e=m.status;return e>=100&&e<200?["pending",e]:e>=200&&e<300?["success",e]:e>=300&&e<700?["failure",e]:"CONFIRMED"===e?["success",200]:"PENDING"===e?["pending",100]:[void 0,e]})();return(0,r.A)((0,r.A)({},m),{},{atomic:h,chainId:p?(0,a.ME)(p):void 0,receipts:null!==(n=null===f||void 0===f?void 0:f.map(e=>(0,r.A)((0,r.A)({},e),{},{blockNumber:(0,a.uU)(e.blockNumber),gasUsed:(0,a.uU)(e.gasUsed),status:c.Lj[e.status]})))&&void 0!==n?n:[],statusCode:v,status:y,version:g})}},5282:(e,t,n)=>{"use strict";n.d(t,{Vw:()=>S,DO:()=>o,CC:()=>c,sd:()=>a,Fe:()=>s,Ht:()=>l,My:()=>w,uH:()=>d,Id:()=>k,qj:()=>I,O8:()=>h,aT:()=>_,aY:()=>i,po:()=>T,Ow:()=>p,fd:()=>m,ZJ:()=>E,DH:()=>u});const r="object"===typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function o(e){if(!i(e))throw new Error("Uint8Array expected");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function a(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");s(e.outputLen),s(e.blockLen)}function c(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function l(e,t){o(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function u(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(let r=0;r<t.length;r++)t[r].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function p(e,t){return e<<32-t|e>>>t}const f=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function g(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const m=f?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=g(e[t]);return e},y=(()=>"function"===typeof Uint8Array.from([]).toHex&&"function"===typeof Uint8Array.fromHex)(),v=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function w(e){if(o(e),y)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=v[e[n]];return t}const b={_0:48,_9:57,A:65,F:70,a:97,f:102};function A(e){return e>=b._0&&e<=b._9?e-b._0:e>=b.A&&e<=b.F?e-(b.A-10):e>=b.a&&e<=b.f?e-(b.a-10):void 0}function _(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);if(y)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);
2const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const t=A(e.charCodeAt(s)),n=A(e.charCodeAt(s+1));if(void 0===t||void 0===n){const t=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+s)}r[i]=16*t+n}return r}function x(e){if("string"!==typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function E(e){return"string"===typeof e&&(e=x(e)),o(e),e}function k(){let e=0;for(let n=0;n<arguments.length;n++){const t=n<0||arguments.length<=n?void 0:arguments[n];o(t),e+=t.length}const t=new Uint8Array(e);for(let n=0,r=0;n<arguments.length;n++){const e=n<0||arguments.length<=n?void 0:arguments[n];t.set(e,r),r+=e.length}return t}class S{}function I(e){const t=t=>e().update(E(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(r&&"function"===typeof r.getRandomValues)return r.getRandomValues(new Uint8Array(e));if(r&&"function"===typeof r.randomBytes)return Uint8Array.from(r.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}},5618:(e,t,n)=>{"use strict";n.d(t,{eL:()=>r,sz:()=>i});const r={gwei:9,wei:18},i={ether:-9,wei:9}},5708:(e,t,n)=>{"use strict";n.d(t,{PW:()=>u,Tq:()=>C,Vm:()=>d,XF:()=>m,Xg:()=>f,hl:()=>h,jw:()=>p,o0:()=>T});var r,i,s=n(41684),o=n(77654),a=n(10860),c=n(19812);function l(){return r||(r=(0,o.nZ)()),r}function u(e){if(e.length<32||e.length>44)return!1;const t=l();try{return 32===t.encode(e).byteLength}catch(n){return!1}}function d(e){if(e.length<32||e.length>44)throw new a.tsw(a.VCG,{actualLength:e.length});const t=l().encode(e).byteLength;if(32!==t)throw new a.tsw(a.ncp,{actualLength:t})}function h(e){return d(e),e}function p(){return(0,s.FU)((0,s.Ns)(l(),32),e=>h(e))}function f(){return(0,s.pI)((i||(i=(0,o.BC)()),i),32)}function g(){return(0,s.mC)(p(),f())}function m(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}var y=37095705934669439343138083508754565189542113879843219016388785533085940283555n,v=57896044618658097711785492504343953926634992332820282019728792003956564819949n,w=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function b(e){const t=e%v;return t>=0n?t:v+t}function A(e,t){let n=e;for(;t-- >0n;)n*=n,n%=v;return n}function _(e,t){const n=b(t*t*t),r=function(e){const t=e*e%v*e%v,n=A(t,2n)*t%v,r=A(n,1n)*e%v,i=A(r,5n)*r%v,s=A(i,10n)*i%v,o=A(s,20n)*s%v,a=A(o,40n)*o%v,c=A(a,80n)*a%v,l=A(c,80n)*a%v,u=A(l,10n)*i%v;return A(u,2n)*e%v}(e*b(n*n*t));let i=b(e*n*r);const s=b(t*i*i),o=i,a=b(i*w),c=s===e,l=s===b(-e),u=s===b(-e*w);return c&&(i=o),(l||u)&&(i=a),1n===(1n&b(i))&&(i=b(-i)),c||l?i:null}function x(e){if(32!==e.byteLength)return!1;const t=function(e){const t=e.reduce((e,t,n)=>"".concat(function(e){const t=e.toString(16);return 1===t.length?"0".concat(t):t}(31===n?-129&t:t)).concat(e),""),n="0x".concat(t);return BigInt(n)}(e);return function(e,t){const n=b(e*e),r=_(b(n-1n),b(y*n+1n));return null!==r&&(0n!==r||!(0!==(128&t)))}(t,e[31])}var E=32,k=16,S=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,100,114,101,115,115];async function I(e){let t,{programAddress:n,seeds:r}=e;if((0,c.cr)(),r.length>k)throw new a.tsw(a.R_T,{actual:r.length,maxSeeds:k});const i=r.reduce((e,n,r)=>{const i="string"===typeof n?(t||(t=new TextEncoder)).encode(n):n;if(i.byteLength>E)throw new a.tsw(a.nNU,{actual:i.byteLength,index:r,maxSeedLength:E});return e.push(...i),e},[]),s=g(),o=s.encode(n),l=await crypto.subtle.digest("SHA-256",new Uint8Array([...i,...o,...S])),u=new Uint8Array(l);if(x(u))throw new a.tsw(a.Ji6);return s.decode(u)}async function T(e){let{programAddress:t,seeds:n}=e,r=255;for(;r>0;)try{return[await I({programAddress:t,seeds:[...n,new Uint8Array([r])]}),r]}catch(i){if(!(0,a.zbS)(i,a.Ji6))throw i;r--}throw new a.tsw(a.Y0g)}async function C(e){if((0,c.sw)(),"public"!==e.type||"Ed25519"!==e.algorithm.name)throw new a.tsw(a.xZX);const t=await crypto.subtle.exportKey("raw",e);return f().decode(new Uint8Array(t))}},5824:(e,t,n)=>{"use strict";n.d(t,{B:()=>u,p:()=>d});var r=n(57722),i=n(42922),s=n(43157);var o,a,c=n(73660);"undefined"!=typeof process&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&"test"===(null==(o=null==process?void 0:{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0})?void 0:o.NODE_ENV)&&"undefined"==typeof(null==(a=null==Element?void 0:Element.prototype)?void 0:a.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join("\n")),[]});var l=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(l||{});function u(e){let t={};for(let n in e)!0===e[n]&&(t["data-".concat(n)]="");return t}function d(e,t,n,o){let[a,l]=(0,r.useState)(n),{hasFlag:u,addFlag:d,removeFlag:h}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[t,n]=(0,r.useState)(e),i=(0,r.useCallback)(e=>n(e),[]),s=(0,r.useCallback)(e=>n(t=>t|e),[]),o=(0,r.useCallback)(e=>(t&e)===e,[t]),a=(0,r.useCallback)(e=>n(t=>t&~e),[]),c=(0,r.useCallback)(e=>n(t=>t^e),[]);return{flags:t,setFlag:i,addFlag:s,hasFlag:o,removeFlag:a,toggleFlag:c}}(e&&a?3:0),p=(0,r.useRef)(!1),f=(0,r.useRef)(!1),g=(0,s.L)();return(0,c.s)(()=>{var r;if(e)return n&&l(!0),t?(null==(r=null==o?void 0:o.start)||r.call(o,n),function(e,t){let{prepare:n,run:r,done:s,inFlight:o}=t,a=(0,i.e)();return function(e,t){let{inFlight:n,prepare:r}=t;if(null!=n&&n.current)return void r();let i=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=i}(e,{prepare:n,inFlight:o}),a.nextFrame(()=>{r(),a.requestAnimationFrame(()=>{a.add(function(e,t){var n,r;let s=(0,i.e)();if(!e)return s.dispose;let o=!1;s.add(()=>{o=!0});let a=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter(e=>e instanceof CSSTransition))?r:[];return 0===a.length?(t(),s.dispose):(Promise.allSettled(a.map(e=>e.finished)).then(()=>{o||t()}),s.dispose)}(e,s))})}),a.dispose}(t,{inFlight:p,prepare(){f.current?f.current=!1:f.current=p.current,p.current=!0,!f.current&&(n?(d(3),h(4)):(d(4),h(2)))},run(){f.current?n?(h(3),d(4)):(h(4),d(3)):n?h(1):d(1)},done(){var e;f.current&&function(e){var t,n;return(null!=(n=null==(t=e.getAnimations)?void 0:t.call(e))?n:[]).some(e=>e instanceof CSSTransition&&"finished"!==e.playState)}(t)||(p.current=!1,h(7),n||l(!1),null==(e=null==o?void 0:o.end)||e.call(o,n))}})):void(n&&d(3))},[e,n,t,g]),e?[a,{closed:u(1),enter:u(2),leave:u(4),transition:u(2)||u(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}}
2,5843:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1}},5890:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});const r=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let a=0;a<t.length;a++)t[a]=255;for(let a=0;a<e.length;a++){const n=e.charAt(a),r=n.charCodeAt(0);if(255!==t[r])throw new TypeError(n+" is ambiguous");t[r]=a}const n=e.length,r=e.charAt(0),i=Math.log(n)/Math.log(256),s=Math.log(256)/Math.log(n);function o(e){if("string"!==typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;let s=0,o=0,a=0;for(;e[s]===r;)o++,s++;const c=(e.length-s)*i+1>>>0,l=new Uint8Array(c);for(;s<e.length;){const r=e.charCodeAt(s);if(r>255)return;let i=t[r];if(255===i)return;let o=0;for(let e=c-1;(0!==i||o<a)&&-1!==e;e--,o++)i+=n*l[e]>>>0,l[e]=i%256>>>0,i=i/256>>>0;if(0!==i)throw new Error("Non-zero carry");a=o,s++}let u=c-a;for(;u!==c&&0===l[u];)u++;const d=new Uint8Array(o+(c-u));let h=o;for(;u!==c;)d[h++]=l[u++];return d}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";let i=0,o=0,a=0;const c=t.length;for(;a!==c&&0===t[a];)a++,i++;const l=(c-a)*s+1>>>0,u=new Uint8Array(l);for(;a!==c;){let e=t[a],r=0;for(let t=l-1;(0!==e||r<o)&&-1!==t;t--,r++)e+=256*u[t]>>>0,u[t]=e%n>>>0,e=e/n>>>0;if(0!==e)throw new Error("Non-zero carry");o=r,a++}let d=l-o;for(;d!==l&&0===u[d];)d++;let h=r.repeat(i);for(;d<l;++d)h+=e.charAt(u[d]);return h},decodeUnsafe:o,decode:function(e){const t=o(e);if(t)return t;throw new Error("Non-base"+n+" character")}}};const i=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},6195:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});class r extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}},6259:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var r=n(93551),i=n(42509);async function s(e){const{authorization:t,signature:n}=e;return(0,r.x)({hash:(0,i.C)(t),signature:null!==n&&void 0!==n?n:t})}},6642:(e,t,n)=>{"use strict";n.d(t,{P:()=>a,a:()=>o});var r=n(57722),i=n(72582);let s=Symbol();function o(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Object.assign(e,{[s]:t})}function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let o=(0,r.useRef)(t);(0,r.useEffect)(()=>{o.current=t},[t]);let a=(0,i._)(e=>{for(let t of o.current)null!=t&&("function"==typeof t?t(e):t.current=e)});return t.every(e=>null==e||(null==e?void 0:e[s]))?void 0:a}},6806:(e,t,n)=>{"use strict";function r(e){let{strict:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!e&&("string"===typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}n.d(t,{q:()=>r})},7488:(e,t,n)=>{"use strict";n.d(t,{D:()=>s,l:()=>i});var r=n(61307);const i=e=>(e=>{let t=e;"string"===typeof t&&(t=r.Rd.encode(t));const n=[];for(let r=0;r<t.length;r+=32768)n.push(String.fromCharCode.apply(null,t.subarray(r,r+32768)));return btoa(n.join(""))})(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),s=e=>{let t=e;t instanceof Uint8Array&&(t=r.D0.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}}},7856:(e,t,n)=>{"use strict";n.d(t,{secp256k1:()=>De});var r=n(36457),i=n(24107),s=n(38420),o=n(5282);const a=BigInt(0),c=BigInt(1);function l(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function u(e){if(!l(e))throw new Error("Uint8Array expected")}function d(e,t){if("boolean"!==typeof t)throw new Error(e+" boolean expected, got "+t)}function h(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function p(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?a:BigInt("0x"+e)}const f="function"===typeof Uint8Array.from([]).toHex&&"function"===typeof Uint8Array.fromHex,g=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function m(e){if(u(e),f)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=g[e[n]];return t}const y=48,v=57,w=65,b=70,A=97,_=102;function x(e){return e>=y&&e<=v?e-y:e>=w&&e<=b?e-(w-10):e>=A&&e<=_?e-(A-10):void 0}function E(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);if(f)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);
2const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const t=x(e.charCodeAt(s)),n=x(e.charCodeAt(s+1));if(void 0===t||void 0===n){const t=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+s)}r[i]=16*t+n}return r}function k(e){return p(m(e))}function S(e){return u(e),p(m(Uint8Array.from(e).reverse()))}function I(e,t){return E(e.toString(16).padStart(2*t,"0"))}function T(e,t){return I(e,t).reverse()}function C(e,t,n){let r;if("string"===typeof t)try{r=E(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else{if(!l(t))throw new Error(e+" must be hex string or Uint8Array");r=Uint8Array.from(t)}const i=r.length;if("number"===typeof n&&i!==n)throw new Error(e+" of length "+n+" expected, got "+i);return r}function P(){let e=0;for(let n=0;n<arguments.length;n++){const t=n<0||arguments.length<=n?void 0:arguments[n];u(t),e+=t.length}const t=new Uint8Array(e);for(let n=0,r=0;n<arguments.length;n++){const e=n<0||arguments.length<=n?void 0:arguments[n];t.set(e,r),r+=e.length}return t}const O=e=>"bigint"===typeof e&&a<=e;function N(e,t,n){return O(e)&&O(t)&&O(n)&&t<=e&&e<n}function R(e,t,n,r){if(!N(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}const M=e=>(c<<BigInt(e))-c,U=e=>new Uint8Array(e),L=e=>Uint8Array.from(e);const B={bigint:e=>"bigint"===typeof e,function:e=>"function"===typeof e,boolean:e=>"boolean"===typeof e,string:e=>"string"===typeof e,stringOrUint8Array:e=>"string"===typeof e||l(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"===typeof e&&Number.isSafeInteger(e.outputLen)};function D(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(t,n,r)=>{const i=B[n];if("function"!==typeof i)throw new Error("invalid validator function");const s=e[t];if((!r||void 0!==s)&&!i(s,e))throw new Error("param "+String(t)+" is invalid. Expected "+n+", got "+s)};for(const[i,s]of Object.entries(t))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return e}function j(e){const t=new WeakMap;return function(n){const r=t.get(n);if(void 0!==r)return r;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];const a=e(n,...s);return t.set(n,a),a}}const F=BigInt(0),z=BigInt(1),W=BigInt(2),q=BigInt(3),H=BigInt(4),V=BigInt(5),G=BigInt(8);function K(e,t){const n=e%t;return n>=F?n:t+n}function J(e,t,n){let r=e;for(;t-- >F;)r*=r,r%=n;return r}function Z(e,t){if(e===F)throw new Error("invert: expected non-zero number");if(t<=F)throw new Error("invert: expected positive modulus, got "+t);let n=K(e,t),r=t,i=F,s=z,o=z,a=F;for(;n!==F;){const e=r/n,t=r%n,c=i-o*e,l=s-a*e;r=n,n=t,i=o,s=a,o=c,a=l}if(r!==z)throw new Error("invert: does not exist");return K(i,t)}function Q(e,t){const n=(e.ORDER+z)/H,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function Y(e,t){const n=(e.ORDER-V)/G,r=e.mul(t,W),i=e.pow(r,n),s=e.mul(t,i),o=e.mul(e.mul(s,W),i),a=e.mul(s,e.sub(o,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function X(e){return e%H===q?Q:e%G===V?Y:function(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-z,n=0;for(;t%W===F;)t/=W,n++;let r=W;const i=ie(e);for(;1===ne(i,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return Q;let s=i.pow(r,t);const o=(t+z)/W;return function(e,r){if(e.is0(r))return r;if(1!==ne(e,r))throw new Error("Cannot find square root");let i=n,a=e.mul(e.ONE,s),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw new Error("Cannot find square root");const r=z<<BigInt(i-t-1),s=e.pow(a,r);i=t,a=e.sqr(s),c=e.mul(c,a),l=e.mul(l,s)}return l}}(e)}const $=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ee(e,t,n){if(n<F)throw new Error("invalid exponent, negatives unsupported");if(n===F)return e.ONE;if(n===z)return t;let r=e.ONE,i=t;for(;n>F;)n&z&&(r=e.mul(r,i)),i=e.sqr(i),n>>=z;return r}function te(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=new Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),s=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),s),r}function ne(e,t){const n=(e.ORDER-z)/W,r=e.pow(t,n),i=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function re(e,t){void 0!==t&&(0,o.Fe)(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function ie(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e<=F)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:i,nByteLength:s}=re(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:e,isLE:n,BITS:i,BYTES:s,MASK:M(i),ZERO:F,ONE:z,create:t=>K(t,e),isValid:t=>{if("bigint"!==typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return F<=t&&t<e},is0:e=>e===F,isOdd:e=>(e&z)===z,neg:t=>K(-t,e),eql:(e,t)=>
vendor: 9,018 bytes, line 2
2e===t,sqr:t=>K(t*t,e),add:(t,n)=>K(t+n,e),sub:(t,n)=>K(t-n,e),mul:(t,n)=>K(t*n,e),pow:(e,t)=>ee(a,e,t),div:(t,n)=>K(t*Z(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Z(t,e),sqrt:r.sqrt||(t=>(o||(o=X(e)),o(a,t))),toBytes:e=>n?T(e,s):I(e,s),fromBytes:e=>{if(e.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return n?S(e):k(e)},invertBatch:e=>te(a,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(a)}function se(e){if("bigint"!==typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function oe(e){const t=se(e);return t+Math.ceil(t/2)}const ae=BigInt(0),ce=BigInt(1);function le(e,t){const n=t.negate();return e?n:t}function ue(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function de(e,t){ue(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:M(e),maxNumber:n,shiftBy:BigInt(e)}}function he(e,t,n){const{windowSize:r,mask:i,maxNumber:s,shiftBy:o}=n;let a=Number(e&i),c=e>>o;a>r&&(a-=s,c+=ce);const l=t*r;return{nextN:c,offset:l+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!==0,offsetF:l}}function pe(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}function fe(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}const ge=new WeakMap,me=new WeakMap;function ye(e){return me.get(e)||1}function ve(e,t,n,r){pe(n,e),fe(r,t);const i=n.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,l=function(e){let t;for(t=0;e>a;e>>=c,t+=1);return t}(BigInt(i));let u=1;l>12?u=l-3:l>4?u=l-2:l>0&&(u=2);const d=M(u),h=new Array(Number(d)+1).fill(o);let p=o;for(let a=Math.floor((t.BITS-1)/u)*u;a>=0;a-=u){h.fill(o);for(let t=0;t<s;t++){const e=r[t],i=Number(e>>BigInt(a)&d);h[i]=h[i].add(n[t])}let e=o;for(let t=h.length-1,n=o;t>0;t--)n=n.add(h[t]),e=e.add(n);if(p=p.add(e),0!==a)for(let t=0;t<u;t++)p=p.double()}return p}function we(e){return D(e.Fp,$.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),D(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze((0,i.A)((0,i.A)((0,i.A)({},re(e.n,e.nBitLength)),e),{p:e.Fp.ORDER}))}function be(e){void 0!==e.lowS&&d("lowS",e.lowS),void 0!==e.prehash&&d("prehash",e.prehash)}class Ae extends Error{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}}const _e={Err:Ae,_tlv:{encode:(e,t)=>{const{Err:n}=_e;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(1&t.length)throw new n("tlv.encode: unpadded data");const r=t.length/2,i=h(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?h(i.length/2|128):"";return h(e)+s+i+t},decode(e,t){const{Err:n}=_e;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const i=t[r++];let s=0;if(!!(128&i)){const e=127&i;if(!e)throw new n("tlv.decode(long): indefinite length not supported");if(e>4)throw new n("tlv.decode(long): byte length is too big");const o=t.subarray(r,r+e);if(o.length!==e)throw new n("tlv.decode: length bytes not complete");if(0===o[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of o)s=s<<8|t;if(r+=e,s<128)throw new n("tlv.decode(long): not minimal encoding")}else s=i;const o=t.subarray(r,r+s);if(o.length!==s)throw new n("tlv.decode: wrong value length");return{v:o,l:t.subarray(r+s)}}},_int:{encode(e){const{Err:t}=_e;if(e<Ee)throw new t("integer: negative integers are not allowed");let n=h(e);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=_e;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return k(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=_e,i=C("signature",e),{v:s,l:o}=r.decode(48,i);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=_e,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}};function xe(e,t){return m(I(e,t))}const Ee=BigInt(0),ke=BigInt(1),Se=(BigInt(2),BigInt(3)),Ie=BigInt(4);function Te(e){const t=function(e){const t=we(e);D(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if("object"!==typeof n||"bigint"!==typeof n.beta||"function"!==typeof n.splitScalar)throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze((0,i.A)({},t))}(e),{Fp:n}=t,r=ie(t.n,t.nBitLength),s=t.toBytes||((e,t,r)=>{const i=t.toAffine();return P(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),o=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){const{a:r,b:i}=t,s=n.sqr(e),o=n.mul(s,e);return n.add(n.add(o,n.mul(e,r)),i)}function c(e,t){const r=n.sqr(t),i=a(e);return n.eql(r,i)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const u=n.mul(n.pow(t.a,Se),Ie),h=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(u,h)))throw new Error("bad curve params: a or b");function p(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:s}=t;if(n&&"bigint"!==typeof e){if(l(e)&&(e=m(e)),"string"!==typeof e||!n.includes(e.length))throw new Error("invalid private key");e=e.padStart(2*r,"0")}let o;try{o="bigint"===typeof e?e:k(C("private key",e,r))}catch(a){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof e)}return i&&(o=K(o,s)),R("private key",o,ke,s),o}function f(e){if(!(e instanceof v))throw new Error("ProjectivePoint expected")}const g=j((e,t)=>{const{px:r,py:i,pz:s}=e;if(n.eql(s,n.ONE))return{x:r,y:i};const o=e.is0();null==t&&(t=o?n.ONE:n.inv(s));const a=n.mul(r,t),c=n.mul(i,t),l=n.mul(s,t);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(l,n.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),y=j(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.py))return;throw new Error("bad point: ZERO")}const{x:r,y:i}=e.toAffine();if(!n.isValid(r)||!n.isValid(i))throw new Error("bad point: x or y not FE");if(!c(r,i))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class v{constructor(e,t,r){if(null==e||!n.isValid(e))throw new Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof v)throw new Error("projective point not allowed");const i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?v.ZERO:new v(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=te(n,e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(v.fromAffine)}static fromHex(e){const t=v.fromAffine(o(C("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return v.BASE.multiply(p(e))}static msm(e,t){return ve(v,r,e,t)}_setWindowSize(e){A.setWindowSize(this,e)}assertValidity(){y(this)}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){f(e);const{px:t,py:r,pz:i}=this,{px:s,py:o,pz:a}=e,c=n.eql(n.mul(t,a),n.mul(s,i)),l=n.eql(n.mul(r,a),n.mul(o,i));return c&&l}negate(){return new v(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,i=n.mul(r,Se),{px:s,py:o,pz:a}=this;let c=n.ZERO,l=n.ZERO,u=n.ZERO,d=n.mul(s,s),h=n.mul(o,o),p=n.mul(a,a),f=n.mul(s,o);return f=n.add(f,f),u=n.mul(s,a),u=n.add(u,u),c=n.mul(e,u),l=n.mul(i,p),l=n.add(c,l),c=n.sub(h,l),l=n.add(h,l),l=n.mul(c,l),c=n.mul(f,c),u=n.mul(i,u),p=n.mul(e,p),f=n.sub(d,p),f=n.mul(e,f),f=n.add(f,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,p),d=n.mul(d,f),l=n.add(l,d),p=n.mul(o,a),p=n.add(p,p),d=n.mul(p,f),c=n.sub(c,d),u=n.mul(p,h),u=n.add(u,u),u=n.add(u,u),new v(c,l,u)}add(e){f(e);const{px:r,py:i,pz:s}=this,{px:o,py:a,pz:c}=e;let l=n.ZERO,u=n.ZERO,d=n.ZERO;const h=t.a,p=n.mul(t.b,Se);let g=n.mul(r,o),m=n.mul(i,a),y=n.mul(s,c),w=n.add(r,i),b=n.add(o,a);w=n.mul(w,b),b=n.add(g,m),w=n.sub(w,b),b=n.add(r,s);let A=n.add(o,c);
vendor: 2,983 bytes, line 2
2return b=n.mul(b,A),A=n.add(g,y),b=n.sub(b,A),A=n.add(i,s),l=n.add(a,c),A=n.mul(A,l),l=n.add(m,y),A=n.sub(A,l),d=n.mul(h,b),l=n.mul(p,y),d=n.add(l,d),l=n.sub(m,d),d=n.add(m,d),u=n.mul(l,d),m=n.add(g,g),m=n.add(m,g),y=n.mul(h,y),b=n.mul(p,b),m=n.add(m,y),y=n.sub(g,y),y=n.mul(h,y),b=n.add(b,y),g=n.mul(m,b),u=n.add(u,g),g=n.mul(A,b),l=n.mul(w,l),l=n.sub(l,g),g=n.mul(w,m),d=n.mul(A,d),d=n.add(d,g),new v(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(v.ZERO)}wNAF(e){return A.wNAFCached(this,e,v.normalizeZ)}multiplyUnsafe(e){const{endo:r,n:i}=t;R("scalar",e,Ee,i);const s=v.ZERO;if(e===Ee)return s;if(this.is0()||e===ke)return this;if(!r||A.hasPrecomputes(this))return A.wNAFCachedUnsafe(this,e,v.normalizeZ);let{k1neg:o,k1:a,k2neg:c,k2:l}=r.splitScalar(e),u=s,d=s,h=this;for(;a>Ee||l>Ee;)a&ke&&(u=u.add(h)),l&ke&&(d=d.add(h)),h=h.double(),a>>=ke,l>>=ke;return o&&(u=u.negate()),c&&(d=d.negate()),d=new v(n.mul(d.px,r.beta),d.py,d.pz),u.add(d)}multiply(e){const{endo:r,n:i}=t;let s,o;if(R("scalar",e,ke,i),r){const{k1neg:t,k1:i,k2neg:a,k2:c}=r.splitScalar(e);let{p:l,f:u}=this.wNAF(i),{p:d,f:h}=this.wNAF(c);l=A.constTimeNegate(t,l),d=A.constTimeNegate(a,d),d=new v(n.mul(d.px,r.beta),d.py,d.pz),s=l.add(d),o=u.add(h)}else{const{p:t,f:n}=this.wNAF(e);s=t,o=n}return v.normalizeZ([s,o])[0]}multiplyAndAddUnsafe(e,t,n){const r=v.BASE,i=(e,t)=>t!==Ee&&t!==ke&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,n));return s.is0()?void 0:s}toAffine(e){return g(this,e)}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===ke)return!0;if(n)return n(v,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===ke?this:n?n(v,this):this.multiplyUnsafe(t.h)}toRawBytes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return d("isCompressed",e),this.assertValidity(),s(v,this,e)}toHex(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return d("isCompressed",e),m(this.toRawBytes(e))}}v.BASE=new v(t.Gx,t.Gy,n.ONE),v.ZERO=new v(n.ZERO,n.ONE,n.ZERO);const{endo:w,nBitLength:b}=t,A=function(e,t){return{constTimeNegate:le,hasPrecomputes:e=>1!==ye(e),unsafeLadder(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.ZERO,i=t;for(;n>ae;)n&ce&&(r=r.add(i)),i=i.double(),n>>=ce;return r},precomputeWindow(e,n){const{windows:r,windowSize:i}=de(n,t),s=[];let o=e,a=o;for(let t=0;t<r;t++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(n,r,i){let s=e.ZERO,o=e.BASE;const a=de(n,t);for(let e=0;e<a.windows;e++){const{nextN:t,offset:n,isZero:c,isNeg:l,isNegF:u,offsetF:d}=he(i,e,a);i=t,c?o=o.add(le(u,r[d])):s=s.add(le(l,r[n]))}return{p:s,f:o}},wNAFUnsafe(n,r,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.ZERO;const o=de(n,t);for(let e=0;e<o.windows&&i!==ae;e++){const{nextN:t,offset:n,isZero:a,isNeg:c}=he(i,e,o);if(i=t,!a){const e=r[n];s=s.add(c?e.negate():e)}}return s}
2,getPrecomputes(e,t,n){let r=ge.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&ge.set(t,n(r))),r},wNAFCached(e,t,n){const r=ye(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const i=ye(e);return 1===i?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){ue(n,t),me.set(e,n),ge.delete(e)}}}(v,w?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:v,normPrivateKeyToScalar:p,weierstrassEquation:a,isWithinCurveOrder:function(e){return N(e,ke,t.n)}}}function Ce(e){const t=function(e){const t=we(e);return D(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze((0,i.A)({lowS:!0},t))}(e),{Fp:n,n:r,nByteLength:s,nBitLength:o}=t,a=n.BYTES+1,c=2*n.BYTES+1;function u(e){return K(e,r)}function h(e){return Z(e,r)}const{ProjectivePoint:p,normPrivateKeyToScalar:f,weierstrassEquation:g,isWithinCurveOrder:m}=Te((0,i.A)((0,i.A)({},t),{},{toBytes(e,t,r){const i=t.toAffine(),s=n.toBytes(i.x),o=P;return d("isCompressed",r),r?o(Uint8Array.from([t.hasEvenY()?2:3]),s):o(Uint8Array.from([4]),s,n.toBytes(i.y))},fromBytes(e){const t=e.length,r=e[0],i=e.subarray(1);if(t!==a||2!==r&&3!==r){if(t===c&&4===r){return{x:n.fromBytes(i.subarray(0,n.BYTES)),y:n.fromBytes(i.subarray(n.BYTES,2*n.BYTES))}}throw new Error("invalid Point, expected length of "+a+", or uncompressed "+c+", got "+t)}{const e=k(i);if(!N(e,ke,n.ORDER))throw new Error("Point is not on curve");const t=g(e);let o;try{o=n.sqrt(t)}catch(s){const e=s instanceof Error?": "+s.message:"";throw new Error("Point is not on curve"+e)}return 1===(1&r)!==((o&ke)===ke)&&(o=n.neg(o)),{x:e,y:o}}}}));function y(e){return e>r>>ke}const v=(e,t,n)=>k(e.slice(t,n));class w{constructor(e,t,n){R("r",e,ke,r),R("s",t,ke,r),this.r=e,this.s=t,null!=n&&(this.recovery=n),Object.freeze(this)}static fromCompact(e){const t=s;return e=C("compactSignature",e,2*t),new w(v(e,0,t),v(e,t,2*t))}static fromDER(e){const{r:t,s:n}=_e.toSig(C("DER",e));return new w(t,n)}assertValidity(){}addRecoveryBit(e){return new w(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:i,recovery:s}=this,o=x(C("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw new Error("recovery id invalid");const a=2===s||3===s?r+t.n:r;if(a>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const c=0===(1&s)?"02":"03",l=p.fromHex(c+xe(a,n.BYTES)),d=h(a),f=u(-o*d),g=u(i*d),m=p.BASE.multiplyAndAddUnsafe(l,f,g);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return y(this.s)}normalizeS(){return this.hasHighS()?new w(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return E(this.toDERHex())}toDERHex(){return _e.hexFromSig(this)}toCompactRawBytes(){return E(this.toCompactHex())}toCompactHex(){const e=s;return xe(this.r,e)+xe(this.s,e)}}const b={isValidPrivateKey(e){try{return f(e),!0}catch(t){return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const e=oe(t.n);return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.length,i=se(t),s=oe(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=K(n?S(e):k(e),t-z)+z;return n?T(o,i):I(o,i)}(t.randomBytes(e),t.n)},precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function A(e){if("bigint"===typeof e)return!1;if(e instanceof p)return!0;const r=C("key",e).length,i=n.BYTES,o=i+1,a=2*i+1;return t.allowedPrivateKeyLengths||s===o?void 0:r===o||r===a}const _=t.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=k(e),n=8*e.length-o;return n>0?t>>BigInt(n):t},x=t.bits2int_modN||function(e){return u(_(e))},O=M(o);function B(e){return R("num < 2^"+o,e,Ee,O),I(e,s)}function j(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:F;if(["recovered","canonical"].some(e=>e in i))throw new Error("sign() legacy options not supported");const{hash:s,randomBytes:o}=t;let{lowS:a,prehash:c,extraEntropy:l}=i;null==a&&(a=!0),e=C("msgHash",e),be(i),c&&(e=C("prehashed msgHash",s(e)));const d=x(e),g=f(r),v=[B(g),B(d)];if(null!=l&&!1!==l){const e=!0===l?o(n.BYTES):l;v.push(C("extraEntropy",e))}const b=P(...v),A=d;return{seed:b,k2sig:function(e){const t=_(e);if(!m(t))return;const n=h(t),r=p.BASE.multiply(t).toAffine(),i=u(r.x);if(i===Ee)return;const s=u(n*u(A+i*g));if(s===Ee)return;let o=(r.x===i?0:2)|Number(r.y&ke),c=s;return a&&y(s)&&(c=function(e){return y(e)?u(-e):e}(s),o^=1),new w(i,c,o)}}}const F={lowS:t.lowS,prehash:!1},W={lowS:t.lowS,prehash:!1};return p.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return p.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!0===A(e))throw new Error("first arg must be private key");if(!1===A(t))throw new Error("second arg must be public key");return p.fromHex(t).multiply(f(e)).toRawBytes(n)},sign:function(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:F;const{seed:i,k2sig:s}=j(e,n,r),o=t,a=function(e,t,n){if("number"!==typeof e||e<2)throw new Error("hashLen must be a number");if("number"!==typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!==typeof n)throw new Error("hmacFn must be a function");let r=U(e),i=U(e),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return n(i,r,...t)},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U(0);i=a(L([0]),e),r=a(),0!==e.length&&(i=a(L([1]),e),r=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=a();const t=r.slice();n.push(t),e+=r.length}return P(...n)};return(e,t)=>{let n;for(o(),c(e);!(n=t(l()));)c();return o(),n}}(o.hash.outputLen,o.nByteLength,o.hmac);return a(i,s)},verify:function(e,n,r){var i;let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:W;const o=e;n=C("msgHash",n),r=C("publicKey",r);const{lowS:a,prehash:c,format:d}=s;
2if(be(s),"strict"in s)throw new Error("options.strict was renamed to lowS");if(void 0!==d&&"compact"!==d&&"der"!==d)throw new Error("format must be compact or der");const f="string"===typeof o||l(o),g=!f&&!d&&"object"===typeof o&&null!==o&&"bigint"===typeof o.r&&"bigint"===typeof o.s;if(!f&&!g)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let m,y;try{if(g&&(m=new w(o.r,o.s)),f){try{"compact"!==d&&(m=w.fromDER(o))}catch(I){if(!(I instanceof _e.Err))throw I}m||"der"===d||(m=w.fromCompact(o))}y=p.fromHex(r)}catch(T){return!1}if(!m)return!1;if(a&&m.hasHighS())return!1;c&&(n=t.hash(n));const{r:v,s:b}=m,A=x(n),_=h(b),E=u(A*_),k=u(v*_),S=null===(i=p.BASE.multiplyAndAddUnsafe(y,E,k))||void 0===i?void 0:i.toAffine();return!!S&&u(S.x)===v},ProjectivePoint:p,Signature:w,utils:b}}const Pe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Oe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ne=BigInt(0),Re=BigInt(1),Me=BigInt(2),Ue=(e,t)=>(e+t/Me)/t;function Le(e){const t=Pe,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=J(u,n,t)*u%t,h=J(d,n,t)*u%t,p=J(h,Me,t)*l%t,f=J(p,i,t)*p%t,g=J(f,s,t)*f%t,m=J(g,a,t)*g%t,y=J(m,c,t)*m%t,v=J(y,a,t)*g%t,w=J(v,n,t)*u%t,b=J(w,o,t)*f%t,A=J(b,r,t)*l%t,_=J(A,Me,t);if(!Be.eql(Be.sqr(_),e))throw new Error("Cannot find square root");return _}const Be=ie(Pe,void 0,void 0,{sqrt:Le}),De=function(e,t){const n=t=>Ce((0,i.A)((0,i.A)({},e),function(e){return{hash:e,hmac:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return(0,s.w)(e,t,(0,o.Id)(...r))},randomBytes:o.po}}(t)));return(0,i.A)((0,i.A)({},n(t)),{},{create:n})}({a:Ne,b:BigInt(7),Fp:Be,n:Oe,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Oe,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Re*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),a=Ue(s*e,t),c=Ue(-r*e,t);let l=K(e-a*n-c*i,t),u=K(-a*r-c*s,t);const d=l>o,h=u>o;if(d&&(l=t-l),h&&(u=t-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:h,k2:u}}}},r.sc)},7919:(e,t,n)=>{"use strict";n.d(t,{yH:()=>h});var r=n(15882),i=n(23422),s=n(56388),o=n(85847),a=n(27133),c=n(652);const l=["address"];function u(e){if(e&&0!==e.length)return e.reduce((e,t)=>{let{slot:n,value:r}=t;if(66!==n.length)throw new s.NV({size:n.length,targetSize:66,type:"hex"});if(66!==r.length)throw new s.NV({size:r.length,targetSize:66,type:"hex"});return e[n]=r,e},{})}function d(e){const{balance:t,nonce:n,state:r,stateDiff:i,code:s}=e,a={};if(void 0!==s&&(a.code=s),void 0!==t&&(a.balance=(0,c.cK)(t)),void 0!==n&&(a.nonce=(0,c.cK)(n)),void 0!==r&&(a.state=u(r)),void 0!==i){if(a.state)throw new o.ft;a.stateDiff=u(i)}return a}function h(e){if(!e)return;const t={};for(const n of e){const{address:e}=n,s=(0,r.A)(n,l);if(!(0,a.P)(e,{strict:!1}))throw new i.M({address:e});if(t[e])throw new o.Hi({address:e});t[e]=d(s)}return t}},8447:(e,t,n)=>{"use strict";n.d(t,{o:()=>p});var r=n(24107),i=n(51659),s=n(65015),o=n(41661),a=n(652);const c=new(n(6195).A)(8192);var l=n(77354),u=n(73251);function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async function(n){var d;let h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{dedupe:p=!1,methods:f,retryDelay:g=150,retryCount:m=3,uid:y}=(0,r.A)((0,r.A)({},t),h),{method:v}=n;if(null!==f&&void 0!==f&&null!==(d=f.exclude)&&void 0!==d&&d.includes(v))throw new o.ab(new Error("method not supported"),{method:v});if(null!==f&&void 0!==f&&f.include&&!f.include.includes(v))throw new o.ab(new Error("method not supported"),{method:v});return function(e,t){let{enabled:n=!0,id:r}=t;if(!n||!r)return e();if(c.get(r))return c.get(r);const i=e().finally(()=>c.delete(r));return c.set(r,i),i}(()=>(0,l.b)(async()=>{try{return await e(n)}catch(t){const e=t;switch(e.code){case o.XU.code:throw new o.XU(e);case o.CL.code:throw new o.CL(e);case o.Gi.code:throw new o.Gi(e,{method:n.method});case o.D5.code:throw new o.D5(e);case o.bq.code:throw new o.bq(e);case o.Di.code:throw new o.Di(e);case o.hA.code:throw new o.hA(e);case o.qZ.code:throw new o.qZ(e);case o.YW.code:throw new o.YW(e);case o.ab.code:throw new o.ab(e,{method:n.method});case o.s0.code:throw new o.s0(e);case o.xQ.code:throw new o.xQ(e);case o.vx.code:throw new o.vx(e);case o.sV.code:throw new o.sV(e);case o.Sf.code:throw new o.Sf(e);case o.RV.code:throw new o.RV(e);case o.xq.code:throw new o.xq(e);case o.ch.code:throw new o.ch(e);case o.L5.code:throw new o.L5(e);case o.WT.code:throw new o.WT(e);case o.hl.code:throw new o.hl(e);case o.cg.code:throw new o.cg(e);case o.uL.code:throw new o.uL(e);case o.G1.code:throw new o.G1(e);case o.jz.code:throw new o.jz(e);case 5e3:throw new o.vx(e);default:if(t instanceof i.C)throw t;throw new o.MI(e)}}},{delay:e=>{let{count:t,error:n}=e;if(n&&n instanceof s.Ci){var r;const e=null===n||void 0===n||null===(r=n.headers)||void 0===r?void 0:r.get("Retry-After");if(null!==e&&void 0!==e&&e.match(/\d/))return 1e3*Number.parseInt(e,10)}return(1<<t)*g},retryCount:m,shouldRetry:e=>{let{error:t}=e;return function(e){if("code"in e&&"number"===typeof e.code)return-1===e.code||(e.code===o.s0.code||e.code===o.bq.code);
2if(e instanceof s.Ci&&e.status)return 403===e.status||(408===e.status||(413===e.status||(429===e.status||(500===e.status||(502===e.status||(503===e.status||504===e.status))))));return!0}(t)}}),{enabled:p,id:p?(0,a.i3)("".concat(y,".").concat((0,u.A)(n))):void 0})}}var h=n(55128);function p(e,t){let{key:n,methods:r,name:i,request:s,retryCount:o=3,retryDelay:a=150,timeout:c,type:l}=e;return{config:{key:n,methods:r,name:i,request:s,retryCount:o,retryDelay:a,timeout:c,type:l},request:d(s,{methods:r,retryCount:o,retryDelay:a,uid:(0,h.L)()}),value:t}}},8448:(e,t,n)=>{"use strict";n.d(t,{d:()=>l});var r=n(24107),i=n(15882),s=n(82281),o=n(14764),a=n(66320);const c=["docsPath"];function l(e,t){let{docsPath:n}=t,l=(0,i.A)(t,c);const u=(()=>{const t=(0,a.l)(e,l);return t instanceof o.RM?e:t})();return new s.zX(u,(0,r.A)({docsPath:n},l))}},8776:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(69692),i=n(77101),s=n(64655);const o=e=>e.split("?")[0],a=typeof WebSocket<"u"?WebSocket:typeof n.g<"u"&&typeof n.g.WebSocket<"u"?n.g.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:n(44464);class c{constructor(e){if(this.url=e,this.events=new r.EventEmitter,this.registering=!1,!(0,s.isWsUrl)(e))throw new Error("Provided URL is not compatible with WebSocket connection: ".concat(e));this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;await this.register(e)}async close(){return new Promise((e,t)=>{typeof this.socket>"u"?t(new Error("Connection already closed")):(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close())})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send((0,i.h)(e))}catch(t){this.onError(e.id,t)}}register(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;if(!(0,s.isWsUrl)(e))throw new Error("Provided URL is not compatible with WebSocket connection: ".concat(e));if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(new Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{const i=(0,s.isReactNative)()?void 0:{rejectUnauthorized:!(0,s.isLocalhostUrl)(e)},o=new a(e,[],i);typeof WebSocket<"u"||typeof n.g<"u"&&typeof n.g.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u"?o.onerror=e=>{const t=e;r(this.emitError(t.error))}:o.on("error",e=>{r(this.emitError(e))}),o.onopen=()=>{this.onOpen(o),t(o)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?(0,i.j)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=n.message||n.toString(),i=(0,s.formatJsonRpcError)(e,r);this.events.emit("payload",i)}parseError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return(0,s.parseConnectionError)(e,o(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){const t=this.parseError(new Error((null===e||void 0===e?void 0:e.message)||"WebSocket connection failed for host: ".concat(o(this.url))));return this.events.emit("register_error",t),t}}},9670:(e,t,n)=>{"use strict";n.d(t,{Q:()=>c});var r=n(24107),i=n(87999),s=n(81232);const o=(0,i.A)(/^tuple((\[(\d*)\])*)$/,{array:1});function a(e){let t=e.type;if(o.test(e.type)&&"components"in e){var n;t="(";const i=e.components.length;for(let n=0;n<i;n++){t+=a(e.components[n]),n<i-1&&(t+=", ")}const c=(0,s.Yv)(o,e.type);return t+=")".concat(null!==(n=null===c||void 0===c?void 0:c.array)&&void 0!==n?n:""),a((0,r.A)((0,r.A)({},e),{},{type:t}))}
2return"indexed"in e&&e.indexed&&(t="".concat(t," indexed")),e.name?"".concat(t," ").concat(e.name):t}function c(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=a(e[r]),r!==n-1&&(t+=", ")}return t}},9953:(e,t,n)=>{"use strict";n.d(t,{I:()=>r,t:()=>i});const r="0x6492649264926492649264926492649264926492649264926492649264926492",i="0x0000000000000000000000000000000000000000000000000000000000000000"},10133:(e,t,n)=>{"use strict";n.d(t,{b:()=>u,o:()=>l});var r=n(23422),i=n(91638),s=n(59892),o=n(6195),a=n(27133);const c=new o.A(8192);function l(e,t){if(c.has("".concat(e,".").concat(t)))return c.get("".concat(e,".").concat(t));const n=t?"".concat(t).concat(e.toLowerCase()):e.substring(2).toLowerCase(),r=(0,s.S)((0,i.Af)(n),"bytes"),o=(t?n.substring("".concat(t,"0x").length):n).split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(15&r[i>>1])>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const a="0x".concat(o.join(""));return c.set("".concat(e,".").concat(t),a),a}function u(e,t){if(!(0,a.P)(e,{strict:!1}))throw new r.M({address:e});return l(e,t)}}
2,10802:(e,t,n)=>{"use strict";n.d(t,{Q:()=>s});var r=n(5618),i=n(97811);function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"wei";return(0,i.J)(e,r.sz[t])}},10860:(e,t,n)=>{"use strict";n.d(t,{BUQ:()=>X,CvZ:()=>ae,DAJ:()=>ee,Da$:()=>G,Dgp:()=>F,Ipf:()=>$,JOu:()=>Se,Ji6:()=>T,JsK:()=>R,LzQ:()=>Ee,MQP:()=>Z,Ngb:()=>Y,O7$:()=>me,Ot7:()=>se,R_T:()=>S,SHY:()=>le,Tsv:()=>V,Uq4:()=>ce,UwC:()=>Ae,Uyo:()=>oe,VCG:()=>E,VO0:()=>z,Vjw:()=>K,XNQ:()=>H,XzN:()=>L,Y0g:()=>C,Y5q:()=>j,_jo:()=>ve,_yh:()=>ye,aYZ:()=>be,bg4:()=>ge,eZ6:()=>Q,evr:()=>De,f$j:()=>U,gF:()=>xe,hMG:()=>de,iOv:()=>D,ibr:()=>ke,kz9:()=>M,lUj:()=>ue,mMN:()=>P,mZ_:()=>he,nNU:()=>I,ncp:()=>x,pFb:()=>_e,qTc:()=>N,rIW:()=>pe,rMr:()=>Ne,rXw:()=>B,sf7:()=>O,t_l:()=>J,tsw:()=>Oe,uWs:()=>we,v8P:()=>fe,xZX:()=>k,zbS:()=>Pe});var r=n(15882),i=n(19371),s=n(24107);const o=["err"];var a=10,c=-32700,l=-32603,u=-32602,d=-32601,h=-32600,p=-32015,f=-32014,g=-32012,m=-32010,y=-32009,v=-32007,w=-32006,b=-32004,A=-32002,_=-32001,x=28e5,E=2800001,k=2800003,S=2800006,I=2800007,T=2800008,C=2800009,P=32300001,O=3230004,N=361e4,R=3610001,M=3610003,U=3610005,L=3610006,B=3610007,D=3611e3,j=3704e3,F=3704001,z=3704004,W=4615e3,q=4615026,H=5663e3,V=5663001,G=5663004,K=5663005,J=5663006,Z=5663007,Q=5663008,Y=5663015,X=5663016,$=5663017,ee=5663021,te=705e4,ne=7050030,re=7050031,ie=7050035,se=8078e3,oe=8078001,ae=8078004,ce=8078005,le=8078006,ue=8078007,de=8078011,he=8078012,pe=8078013,fe=8078014,ge=8078017,me=81e5,ye=8100002,ve=8100003,we=819e4,be=8190001,Ae=8190002,_e=8190003,xe=8190004,Ee=99e5,ke=9900001,Se=9900004;function Ie(e){if(Array.isArray(e)){return"%5B"+e.map(Ie).join("%2C%20")+"%5D"}return"bigint"===typeof e?"".concat(e,"n"):encodeURIComponent(String(null!=e&&null===Object.getPrototypeOf(e)?(0,s.A)({},e):e))}function Te(e){let[t,n]=e;return"".concat(t,"=").concat(Ie(n))}function Ce(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};{let n="Solana error #".concat(e,"; Decode this error by running `npx @solana/errors decode -- ").concat(e);return Object.keys(t).length&&(n+=" '".concat(function(e){const t=Object.entries(e).map(Te).join("&");return btoa(t)}(t),"'")),"".concat(n,"`")}}function Pe(e,t){return!!(e instanceof Error&&"SolanaError"===e.name)&&(void 0===t||e.context.__code===t)}var Oe=class extends Error{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r,s,[o,a]=t;a&&Object.entries(Object.getOwnPropertyDescriptors(a)).forEach(e=>{let[t,n]=e;"cause"===t?s={cause:n.value}:(void 0===r&&(r={}),Object.defineProperty(r,t,n))});super(Ce(o,r),s),(0,i.A)(this,"cause",this.cause),(0,i.A)(this,"context",void 0),this.context=void 0===r?{}:r,this.context.__code=o,this.name="SolanaError"}};function Ne(){"captureStackTrace"in Error&&"function"===typeof Error.captureStackTrace&&Error.captureStackTrace(...arguments)}function Re(e,t){let n,r,{errorCodeBaseOffset:i,getErrorContext:s,orderedErrorNames:o,rpcEnumError:a}=e;"string"===typeof a?n=a:(n=Object.keys(a)[0],r=a[n]);const c=i+o.indexOf(n),l=s(c,n,r),u=new Oe(c,l);return Ne(u,t),u}var Me=["GenericError","InvalidArgument","InvalidInstructionData","InvalidAccountData","AccountDataTooSmall","InsufficientFunds","IncorrectProgramId","MissingRequiredSignature","AccountAlreadyInitialized","UninitializedAccount","UnbalancedInstruction","ModifiedProgramId","ExternalAccountLamportSpend","ExternalAccountDataModified","ReadonlyLamportChange","ReadonlyDataModified","DuplicateAccountIndex","ExecutableModified","RentEpochModified","NotEnoughAccountKeys","AccountDataSizeChanged","AccountNotExecutable","AccountBorrowFailed","AccountBorrowOutstanding","DuplicateAccountOutOfSync","Custom","InvalidError","ExecutableDataModified","ExecutableLamportChange","ExecutableAccountNotRentExempt","UnsupportedProgramId","CallDepth","MissingAccount","ReentrancyNotAllowed","MaxSeedLengthExceeded","InvalidSeeds","InvalidRealloc","ComputationalBudgetExceeded","PrivilegeEscalation","ProgramEnvironmentSetupFailure","ProgramFailedToComplete","ProgramFailedToCompile","Immutable","IncorrectAuthority","BorshIoError","AccountNotRentExempt","InvalidAccountOwner","ArithmeticOverflow","UnsupportedSysvar","IllegalOwner","MaxAccountsDataAllocationsExceeded","MaxAccountsExceeded","MaxInstructionTraceLengthExceeded","BuiltinProgramsMustConsumeComputeUnits"];function Ue(e,t){const n=Number(e);return Re({errorCodeBaseOffset:4615001,getErrorContext:(e,t,r)=>e===W?(0,s.A)({errorName:t,index:n},void 0!==r?{instructionErrorContext:r}:null):e===q?{code:Number(r),index:n}:{index:n},orderedErrorNames:Me,rpcEnumError:t},Ue)}var Le=["AccountInUse","AccountLoadedTwice","AccountNotFound","ProgramAccountNotFound","InsufficientFundsForFee","InvalidAccountForFee","AlreadyProcessed","BlockhashNotFound","CallChainTooDeep","MissingSignatureForFee","InvalidAccountIndex","SignatureFailure","InvalidProgramForExecution","SanitizeFailure","ClusterMaintenance","AccountBorrowOutstanding","WouldExceedMaxBlockCostLimit","UnsupportedVersion","InvalidWritableAccount","WouldExceedMaxAccountCostLimit","WouldExceedAccountDataBlockLimit","TooManyAccountLocks","AddressLookupTableNotFound","InvalidAddressLookupTableOwner","InvalidAddressLookupTableData","InvalidAddressLookupTableIndex","InvalidRentPayingAccount","WouldExceedMaxVoteCostLimit","WouldExceedAccountDataTotalLimit","DuplicateInstruction","InsufficientFundsForRent","MaxLoadedAccountsDataSizeExceeded","InvalidLoadedAccountsDataSizeLimit","ResanitizationNeeded","ProgramExecutionTemporarilyRestricted","UnbalancedTransaction"];function Be(e){return"object"===typeof e&&"InstructionError"in e?Ue(...e.Instru
2ctionError):Re({errorCodeBaseOffset:7050001,getErrorContext:(e,t,n)=>e===te?(0,s.A)({errorName:t},void 0!==n?{transactionErrorContext:n}:null):e===ne?{index:Number(n)}:e===re||e===ie?{accountIndex:Number(n.account_index)}:void 0,orderedErrorNames:Le,rpcEnumError:e},Be)}function De(e){let t;if("object"===typeof(n=e)&&null!==n&&"code"in n&&"message"in n&&("number"===typeof n.code||"bigint"===typeof n.code)&&"string"===typeof n.message){const{code:n,data:i,message:a}=e,x=Number(n);if(x===A){const{err:e}=i,n=(0,r.A)(i,o),a=e?{cause:Be(e)}:null;t=new Oe(A,(0,s.A)((0,s.A)({},n),a))}else{let e;switch(x){case l:case u:case h:case d:case c:case g:case _:case b:case f:case m:case y:case v:case w:case p:e={__serverMessage:a};break;default:"object"!==typeof i||Array.isArray(i)||(e=i)}t=new Oe(x,e)}}else{const n="object"===typeof e&&null!==e&&"message"in e&&"string"===typeof e.message?e.message:"Malformed JSON-RPC error with no message attribute";t=new Oe(a,{error:e,message:n})}var n;return Ne(t,De),t}},11383:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r=n(36231),i=n(652),s=n(29213);async function o(e){var t,n;let{blockHash:o,blockNumber:a,blockTag:c=(null!==(t=e.experimental_blockTag)&&void 0!==t?t:"latest"),includeTransactions:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const u=null!==l&&void 0!==l&&l,d=void 0!==a?(0,i.cK)(a):void 0;let h=null;if(h=o?await e.request({method:"eth_getBlockByHash",params:[o,u]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[d||c,u]},{dedupe:Boolean(d)}),!h)throw new r.l({blockHash:o,blockNumber:a});return((null===(n=e.chain)||void 0===n||null===(n=n.formatters)||void 0===n||null===(n=n.block)||void 0===n?void 0:n.format)||s.$)(h,"getBlock")}},12005:(e,t,n)=>{"use strict";n.d(t,{A9:()=>i,NO:()=>a,Pj:()=>c,dV:()=>s,nx:()=>l,zd:()=>o});var r=n(12379);r.C;class i extends r.C{constructor(e){let{params:t}=e;super("Failed to parse ABI parameters.",{details:"parseAbiParameters(".concat(JSON.stringify(t,null,2),")"),docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class s extends r.C{constructor(e){let{param:t}=e;super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class o extends r.C{constructor(e){let{param:t,name:n}=e;super("Invalid ABI parameter.",{details:t,metaMessages:['"'.concat(n,'" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html')]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class a extends r.C{constructor(e){let{param:t,type:n,modifier:r}=e;super("Invalid ABI parameter.",{details:t,metaMessages:['Modifier "'.concat(r,'" not allowed').concat(n?' in "'.concat(n,'" type'):"",".")]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class c extends r.C{constructor(e){let{param:t,type:n,modifier:r}=e;super("Invalid ABI parameter.",{details:t,metaMessages:['Modifier "'.concat(r,'" not allowed').concat(n?' in "'.concat(n,'" type'):"","."),'Data location can only be specified for array, struct, or mapping types, but "'.concat(r,'" was given.')]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class l extends r.C{constructor(e){let{abiParameter:t}=e;super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}},12379:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});class r extends Error{constructor(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=n.cause instanceof r?n.cause.details:null!==(t=n.cause)&&void 0!==t&&t.message?n.cause.message:n.details,s=n.cause instanceof r&&n.cause.docsPath||n.docsPath;super([e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?["Docs: https://abitype.dev".concat(s)]:[],...i?["Details: ".concat(i)]:[],"Version: abitype@".concat("1.1.0")].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=i,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=e}}},12663:(e,t,n)=>{"use strict";n.d(t,{a:()=>a,g:()=>o});var r=n(75581),i=n(46755),s=n(51380);const o=(e,t,n,o)=>{let c=Number(e),l=t.find(e=>e.id===c);if(!l)throw new s.P("Unsupported chainId ".concat(e),4901);return(0,r.l)({transport:(0,i.L)(a(l,n,o.appId)),chain:l})},a=(e,t,n)=>{var r,i,o;let a,c=e.id,l=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])a=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[l])a=t.rpcUrls[l];else if(null!==(r=e.rpcUrls.privy)&&void 0!==r&&r.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",n),a=t.toString()}else a=null!==(i=e.rpcUrls.public)&&void 0!==i&&i.http[0]?e.rpcUrls.public.http[0]:null===(o=e.rpcUrls.default)||void 0===o?void 0:o.http[0];if(!a)throw new s.P("No RPC url found for ".concat(c));return a}},14061:(e,t,n)=>{"use strict";n.d(t,{A1:()=>l,di:()=>o,iN:()=>u});var r=n(56388),i=n(6806),s=n(1490);function o(e,t,n){let{strict:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,i.q)(e,{strict:!1})?u(e,t,n,{strict:r}):l(e,t,n,{strict:r})}function a(e,t){if("number"===typeof t&&t>0&&t>(0,s.E)(e)-1)throw new r.ii({offset:t,position:"start",size:(0,s.E)(e)})}
2function c(e,t,n){if("number"===typeof t&&"number"===typeof n&&(0,s.E)(e)!==n-t)throw new r.ii({offset:n,position:"end",size:(0,s.E)(e)})}function l(e,t,n){let{strict:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};a(e,t);const i=e.slice(t,n);return r&&c(i,t,n),i}function u(e,t,n){let{strict:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};a(e,t);const i="0x".concat(e.replace("0x","").slice(2*(null!==t&&void 0!==t?t:0),2*(null!==n&&void 0!==n?n:e.length)));return r&&c(i,t,n),i}},14177:(e,t,n)=>{"use strict";n.d(t,{c:()=>h});var r=n(51659);class i extends r.C{constructor(e){super("Call bundle failed with status: ".concat(e.statusCode),{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}var s=n(44288),o=n(38274),a=n(68337),c=n(70495),l=n(77354),u=n(73251),d=n(5269);async function h(e,t){const{id:n,pollingInterval:r=e.pollingInterval,status:h=e=>{let{statusCode:t}=e;return 200===t||t>=300},retryCount:f=4,retryDelay:g=e=>{let{count:t}=e;return 200*(1<<t)},timeout:m=6e4,throwOnFailure:y=!1}=t,v=(0,u.A)(["waitForCallsStatus",e.uid,n]),{promise:w,resolve:b,reject:A}=(0,c.Y)();let _;const x=(0,o.lB)(v,{resolve:b,reject:A},t=>{const o=(0,a.w)(async()=>{const r=e=>{clearTimeout(_),o(),e(),x()};try{const o=await(0,l.b)(async()=>{const t=await(0,s.T)(e,d.k,"getCallsStatus")({id:n});if(y&&"failure"===t.status)throw new i(t);return t},{retryCount:f,delay:g});if(!h(o))return;r(()=>t.resolve(o))}catch(a){r(()=>t.reject(a))}},{interval:r,emitOnBegin:!0});return o});return _=m?setTimeout(()=>{x(),clearTimeout(_),A(new p({id:n}))},m):void 0,await w}class p extends r.C{constructor(e){let{id:t}=e;super('Timed out while waiting for call bundle with id "'.concat(t,'" to be confirmed.'),{name:"WaitForCallsStatusTimeoutError"})}}},14393:(e,t,n)=>{"use strict";n.d(t,{H2:()=>o,Ty:()=>i,u:()=>a,xO:()=>s});var r=n(51659);class i extends r.C{constructor(e){let{max:t,min:n,signed:r,size:i,value:s}=e;super('Number "'.concat(s,'" is not in safe ').concat(i?"".concat(8*i,"-bit ").concat(r?"signed":"unsigned"," "):"","integer range ").concat(t?"(".concat(n," to ").concat(t,")"):"(above ".concat(n,")")),{name:"IntegerOutOfRangeError"})}}class s extends r.C{constructor(e){super('Bytes value "'.concat(e,'" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.'),{name:"InvalidBytesBooleanError"})}}class o extends r.C{constructor(e){super('Hex value "'.concat(e,'" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).'),{name:"InvalidHexBooleanError"})}}r.C;class a extends r.C{constructor(e){let{givenSize:t,maxSize:n}=e;super("Size cannot exceed ".concat(n," bytes. Given size: ").concat(t," bytes."),{name:"SizeOverflowError"})}}},14674:(e,t,n)=>{"use strict";n.d(t,{N0:()=>D,S$:()=>y,az:()=>se,dU:()=>W,fr:()=>q,mN:()=>X,mm:()=>oe,q0:()=>m,rt:()=>Y,vm:()=>re});var r=n(15882),i=n(24107),s=n(10860),o=n(48106),a=n(5708),c=n(41684),l=n(64740),u=n(69314),d=n(24464),h=n(2376);const p=["accountIndices","data"],f=["addressTableLookups"],g=["address"];function m(e){return"lifetimeConstraint"in e&&"string"===typeof e.lifetimeConstraint.blockhash&&"bigint"===typeof e.lifetimeConstraint.lastValidBlockHeight&&(0,o.yF)(e.lifetimeConstraint.blockhash)}function y(e,t){return"lifetimeConstraint"in t&&t.lifetimeConstraint&&"blockhash"in t.lifetimeConstraint&&t.lifetimeConstraint.blockhash===e.blockhash&&t.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight?t:Object.freeze((0,i.A)((0,i.A)({},t),{},{lifetimeConstraint:Object.freeze(e)}))}var v=e=>(0,c.xv)({getSizeFromValue:t=>{const[n,r]=b(t,e[0]);if(!r)return t.length;const i=A(r,e);return n.length+Math.ceil(i.toString(16).length/2)},write(t,n,r){if(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!t.match(new RegExp("^[".concat(e,"]*$"))))throw new s.tsw(s.mZ_,{alphabet:e,base:e.length,value:n})}(e,t),""===t)return r;const[i,o]=b(t,e[0]);if(!o)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let a=A(o,e);const c=[];for(;a>0n;)c.unshift(Number(a%256n)),a/=256n;const l=[...Array(i.length).fill(0),...c];return n.set(l,r),r+l.length}}),w=e=>(0,c.$C)({read(t,n){const r=0===n?t:t.slice(n);if(0===r.length)return["",0];let i=r.findIndex(e=>0!==e);i=-1===i?r.length:i;const s=e[0].repeat(i);if(i===r.length)return[s,t.length];const o=function(e,t){const n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join("")}(r.slice(i).reduce((e,t)=>
2256n*e+BigInt(t),0n),e);return[s+o,t.length]}});function b(e,t){const[n,r]=e.split(new RegExp("((?!".concat(t,").*)")));return[n,r]}function A(e,t){const n=BigInt(t.length);let r=0n;for(const i of e)r*=n,r+=BigInt(t.indexOf(i));return r}var _,x,E,k,S,I,T="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",C=()=>v(T),P=()=>w(T);function O(){if(!_){const e=(0,l.is)((0,u.Qe)(),{size:(0,u.tD)()});_=(0,l.a5)([["lookupTableAddress",(0,a.jw)()],["writableIndexes",e],["readonlyIndexes",e]])}return _}function N(){if(!x){const e=(0,l.O_)((0,u.eh)(),{size:(0,u.vU)()});x=(0,l.ci)([["lookupTableAddress",(0,a.Xg)()],["writableIndexes",e],["readonlyIndexes",e]])}return x}function R(){return E||(E=(0,u.Qe)()),E}function M(){return k||(k=(0,u.eh)()),k}var U=0,L=128;function B(){return(0,c.xv)({getSizeFromValue:e=>"legacy"===e?0:1,maxSize:1,write:(e,t,n)=>{if("legacy"===e)return n;if(e<0||e>127)throw new s.tsw(s.Da$,{actualVersion:e});if(e>U)throw new s.tsw(s.DAJ,{unsupportedVersion:e});return t.set([e|L],n),n+1}})}function D(){return(0,c.$C)({maxSize:1,read:(e,t)=>{const n=e[t];if(0===(n&L))return["legacy",t];{const e=n^L;if(e>U)throw new s.tsw(s.DAJ,{unsupportedVersion:e});return[e,t+1]}}})}function j(){return(0,l.a5)(z())}function F(){return(0,c.FU)((0,l.a5)([...z(),["addressTableLookups",(0,l.is)(O(),{size:(0,u.tD)()})]]),e=>{var t;return"legacy"===e.version?e:(0,i.A)((0,i.A)({},e),{},{addressTableLookups:null!==(t=e.addressTableLookups)&&void 0!==t?t:[]})})}function z(){const e=(0,l.md)([(0,l.J8)(new Uint8Array(32)),(0,c.Ns)(C(),32)],e=>void 0===e?0:1);return[["version",B()],["header",(0,l.a5)([["numSignerAccounts",R()],["numReadonlySignerAccounts",R()],["numReadonlyNonSignerAccounts",R()]])],["staticAccounts",(0,l.is)((0,a.jw)(),{size:(0,u.tD)()})],["lifetimeToken",e],["instructions",(0,l.is)((S||(S=(0,c.FU)((0,l.a5)([["programAddressIndex",(0,u.Qe)()],["accountIndices",(0,l.is)((0,u.Qe)(),{size:(0,u.tD)()})],["data",(0,c.Bq)((0,l.Im)(),(0,u.tD)())]]),e=>{var t,n;return void 0!==e.accountIndices&&void 0!==e.data?e:(0,i.A)((0,i.A)({},e),{},{accountIndices:null!==(t=e.accountIndices)&&void 0!==t?t:[],data:null!==(n=e.data)&&void 0!==n?n:new Uint8Array(0)})})),S),{size:(0,u.tD)()})]]}function W(){return(0,c.xv)({getSizeFromValue:e=>"legacy"===e.version?j().getSizeFromValue(e):F().getSizeFromValue(e),write:(e,t,n)=>"legacy"===e.version?j().write(e,t,n):F().write(e,t,n)})}function q(){return(0,c.vt)((0,l.ci)([["version",D()],["header",(0,l.ci)([["numSignerAccounts",M()],["numReadonlySignerAccounts",M()],["numReadonlyNonSignerAccounts",M()]])],["staticAccounts",(0,l.O_)((0,a.Xg)(),{size:(0,u.vU)()})],["lifetimeToken",(0,c.pI)(P(),32)],["instructions",(0,l.O_)((I||(I=(0,c.vt)((0,l.ci)([["programAddressIndex",(0,u.eh)()],["accountIndices",(0,l.O_)((0,u.eh)(),{size:(0,u.vU)()})],["data",(0,c.Ru)((0,l.EK)(),(0,u.vU)())]]),e=>{if(e.accountIndices.length&&e.data.byteLength)return e;const{accountIndices:t,data:n}=e,s=(0,r.A)(e,p);return(0,i.A)((0,i.A)((0,i.A)({},s),t.length?{accountIndices:t}:null),n.byteLength?{data:n}:null)})),I),{size:(0,u.vU)()})],["addressTableLookups",(0,l.O_)(N(),{size:(0,u.vU)()})]]),e=>{let{addressTableLookups:t}=e,n=(0,r.A)(e,f);return"legacy"!==n.version&&null!==t&&void 0!==t&&t.length?(0,i.A)((0,i.A)({},n),{},{addressTableLookups:t}):n})}function H(e,t,n){var r;e[t]=n(null!==(r=e[t])&&void 0!==r?r:{role:d.Uv.READONLY})}var V=Symbol("AddressMapTypeProperty");function G(e){const t={};for(const r of e){var n;if(!("lookupTableAddress"in r))continue;const e=t[n=r.lookupTableAddress]||(t[n]={readonlyIndexes:[],writableIndexes:[]});r.role===d.Uv.WRITABLE?e.writableIndexes.push(r.addressIndex):e.readonlyIndexes.push(r.addressIndex)}return Object.keys(t).sort((0,a.XF)()).map(e=>(0,i.A)({lookupTableAddress:e},t[e]))}function K(e){let t=0,n=0,r=0;for(const i of e){if("lookupTableAddress"in i)break;const e=(0,d.TN)(i.role);(0,d.tZ)(i.role)?(r++,e||n++):e||t++}return{numReadonlyNonSignerAccounts:t,numReadonlySignerAccounts:n,numSignerAccounts:r}}function J(e,t){const n=function(e){const t={};for(const[n,r]of e.entries())t[r.address]=n;return t}(t);return e.map(e=>{let{accounts:t,data:r,programAddress:s}=e;return(0,i.A)((0,i.A)({programAddressIndex:n[s]},t?{accountIndices:t.map(e=>{let{address:t}=e;return n[t]})}:null),r?{data:r}:null)})}function Z(e){return"nonce"in e?e.nonce:e.blockhash}function Q(e){const t=e.findIndex(e=>"lookupTableAddress"in e);return(-1===t?e:e.slice(0,t)).map(e=>{let{address:t}=e;return t})}function Y(e){const t=function(e){let t;return Object.entries(e).sort((e,n)=>{let[r,i]=e,[s,o]=n;
2if(i[V]!==o[V]){if(0===i[V])return-1;if(0===o[V])return 1;if(2===i[V])return-1;if(2===o[V])return 1}const c=(0,d.tZ)(i.role);if(c!==(0,d.tZ)(o.role))return c?-1:1;const l=(0,d.TN)(i.role);return l!==(0,d.TN)(o.role)?l?-1:1:(t||(t=(0,a.XF)()),1===i[V]&&1===o[V]&&i.lookupTableAddress!==o.lookupTableAddress?t(i.lookupTableAddress,o.lookupTableAddress):t(r,s))}).map(e=>{let[t,n]=e;return(0,i.A)({address:t},n)})}(function(e,t){const n={[e]:{[V]:0,role:d.Uv.WRITABLE_SIGNER}},o=new Set;for(const c of t){let e;if(H(n,c.programAddress,e=>{if(o.add(c.programAddress),V in e){if((0,d.TN)(e.role)){if(0===e[V])throw new s.tsw(s.XNQ,{programAddress:c.programAddress});throw new s.tsw(s.Tsv,{programAddress:c.programAddress})}if(2===e[V])return e}return{[V]:2,role:d.Uv.READONLY}}),c.accounts)for(const t of c.accounts)H(n,t.address,n=>{const{address:c}=t,l=(0,r.A)(t,g);if(V in n)switch(n[V]){case 0:return n;case 1:{const t=(0,d.Wq)(n.role,l.role);if("lookupTableAddress"in l){if(n.lookupTableAddress!==l.lookupTableAddress&&(e||(e=(0,a.XF)()))(l.lookupTableAddress,n.lookupTableAddress)<0)return(0,i.A)((0,i.A)({[V]:1},l),{},{role:t})}else if((0,d.tZ)(l.role))return{[V]:2,role:t};return n.role!==t?(0,i.A)((0,i.A)({},n),{},{role:t}):n}case 2:{const e=(0,d.Wq)(n.role,l.role);if(o.has(t.address)){if((0,d.TN)(l.role))throw new s.tsw(s.Tsv,{programAddress:t.address});return n.role!==e?(0,i.A)((0,i.A)({},n),{},{role:e}):n}return"lookupTableAddress"in l&&!(0,d.tZ)(n.role)?(0,i.A)((0,i.A)({},l),{},{[V]:1,role:e}):n.role!==e?(0,i.A)((0,i.A)({},n),{},{role:e}):n}}return"lookupTableAddress"in l?(0,i.A)((0,i.A)({},l),{},{[V]:1}):(0,i.A)((0,i.A)({},l),{},{[V]:2})})}return n}(e.feePayer.address,e.instructions)),n=e.lifetimeConstraint;return(0,i.A)((0,i.A)((0,i.A)({},"legacy"!==e.version?{addressTableLookups:G(t)}:null),n?{lifetimeToken:Z(n)}:null),{},{header:K(t),instructions:J(e.instructions,t),staticAccounts:Q(t),version:e.version})}function X(e){return Object.freeze({instructions:Object.freeze([]),version:e.version})}var $="SysvarRecentB1ockHashes11111111111111111111",ee="11111111111111111111111111111111";function te(e,t){return{accounts:[{address:e,role:d.Uv.WRITABLE},{address:$,role:d.Uv.READONLY},{address:t,role:d.Uv.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:ee}}function ne(e){var t,n;return e.programAddress===ee&&null!=e.data&&(4===(n=e.data).byteLength&&4===n[0]&&0===n[1]&&0===n[2]&&0===n[3])&&3===(null===(t=e.accounts)||void 0===t?void 0:t.length)&&null!=e.accounts[0].address&&e.accounts[0].role===d.Uv.WRITABLE&&e.accounts[1].address===$&&e.accounts[1].role===d.Uv.READONLY&&null!=e.accounts[2].address&&(0,d.tZ)(e.accounts[2].role)}function re(e){return"lifetimeConstraint"in e&&"string"===typeof e.lifetimeConstraint.nonce&&null!=e.instructions[0]&&ne(e.instructions[0])}function ie(e,t){var n;if("feePayer"in t&&e===(null===(n=t.feePayer)||void 0===n?void 0:n.address)&&function(e){return!!e&&"address"in e&&"string"===typeof e.address&&1===Object.keys(e).length}(t.feePayer))return t;const r=(0,i.A)((0,i.A)({},t),{},{feePayer:Object.freeze({address:e})});return Object.freeze(r),r}function se(e,t){return function(e,t){return Object.freeze((0,i.A)((0,i.A)({},t),{},{instructions:Object.freeze([...t.instructions,...e])}))}([e],t)}function oe(e,t){var n;const r=e.staticAccounts[0];if(!r)throw new s.tsw(s.eZ6);const o=[...function(e){const{header:t}=e,n=t.numSignerAccounts-t.numReadonlySignerAccounts,r=e.staticAccounts.length-t.numSignerAccounts-t.numReadonlyNonSignerAccounts,i=[];let s=0;for(let o=0;o<n;o++)i.push({address:e.staticAccounts[s],role:d.Uv.WRITABLE_SIGNER}),s++;for(let o=0;o<t.numReadonlySignerAccounts;o++)i.push({address:e.staticAccounts[s],role:d.Uv.READONLY_SIGNER}),s++;for(let o=0;o<r;o++)i.push({address:e.staticAccounts[s],role:d.Uv.WRITABLE}),s++;for(let o=0;o<t.numReadonlyNonSignerAccounts;o++)i.push({address:e.staticAccounts[s],role:d.Uv.READONLY}),s++;return i}(e),..."addressTableLookups"in e&&void 0!==e.addressTableLookups&&e.addressTableLookups.length>0?function(e,t){const n=e.map(e=>e.lookupTableAddress).filter(e=>void 0===t[e]);if(n.length>0)throw new s.tsw(s.Vjw,{lookupTableAddresses:n});const r=[],i=[];for(const o of e){const e=t[o.lookupTableAddress],n=o.readonlyIndexes,a=o.writableIndexes,c=Math.max(...n,...a);if(c>
2=e.length)throw new s.tsw(s.t_l,{highestKnownIndex:e.length-1,highestRequestedIndex:c,lookupTableAddress:o.lookupTableAddress});const l=n.map(t=>({address:e[t],addressIndex:t,lookupTableAddress:o.lookupTableAddress,role:d.Uv.READONLY}));r.push(...l);const u=a.map(t=>({address:e[t],addressIndex:t,lookupTableAddress:o.lookupTableAddress,role:d.Uv.WRITABLE}));i.push(...u)}return[...i,...r]}(e.addressTableLookups,null!==(n=null===t||void 0===t?void 0:t.addressesByLookupTableAddress)&&void 0!==n?n:{}):[]],c=e.instructions.map(e=>function(e,t){var n,r;const o=null===(n=t[e.programAddressIndex])||void 0===n?void 0:n.address;if(!o)throw new s.tsw(s.MQP,{index:e.programAddressIndex});const a=null===(r=e.accountIndices)||void 0===r?void 0:r.map(e=>t[e]),{data:c}=e;return Object.freeze((0,i.A)((0,i.A)({programAddress:o},a&&a.length?{accounts:Object.freeze(a)}:{}),c&&c.length?{data:c}:{}))}(e,o)),l=c[0],u=function(e,t,n){if(t&&ne(t)){const n=t.accounts[0].address;(0,a.Vm)(n);const r=t.accounts[2].address;return(0,a.Vm)(r),{nonce:e,nonceAccountAddress:n,nonceAuthorityAddress:r}}return{blockhash:e,lastValidBlockHeight:null!==n&&void 0!==n?n:2n**64n-1n}}(e.lifetimeToken,l,null===t||void 0===t?void 0:t.lastValidBlockHeight);return(0,h.F)(X({version:e.version}),e=>ie(r,e),e=>c.reduce((e,t)=>se(t,e),e),e=>"blockhash"in u?y(u,e):function(e,t){let n,{nonce:r,nonceAccountAddress:s,nonceAuthorityAddress:o}=e;const a=t.instructions[0];if(a&&ne(a))if(function(e,t,n){return e.accounts[0].address===t&&e.accounts[2].address===n}(a,s,o)){if(re(t)&&t.lifetimeConstraint.nonce===r)return t;n=[a,...t.instructions.slice(1)]}else n=[Object.freeze(te(s,o)),...t.instructions.slice(1)];else n=[Object.freeze(te(s,o)),...t.instructions];return Object.freeze((0,i.A)((0,i.A)({},t),{},{instructions:Object.freeze(n),lifetimeConstraint:Object.freeze({nonce:r})}))}(u,e))}},14764:(e,t,n)=>{"use strict";n.d(t,{A7:()=>s,BG:()=>o,Fo:()=>p,K0:()=>c,Oh:()=>l,RM:()=>m,jj:()=>a,k5:()=>d,lN:()=>g,lY:()=>h,uC:()=>f,vW:()=>u});var r=n(10802),i=n(51659);class s extends i.C{constructor(){var e;let{cause:t,message:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=null===n||void 0===n||null===(e=n.replace("execution reverted: ",""))||void 0===e?void 0:e.replace("execution reverted","");super("Execution reverted ".concat(r?"with reason: ".concat(r):"for an unknown reason","."),{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class o extends i.C{constructor(){let{cause:e,maxFeePerGas:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("The fee cap (`maxFeePerGas`".concat(t?" = ".concat((0,r.Q)(t)," gwei"):"",") cannot be higher than the maximum allowed value (2^256-1)."),{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class a extends i.C{constructor(){let{cause:e,maxFeePerGas:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("The fee cap (`maxFeePerGas`".concat(t?" = ".concat((0,r.Q)(t)):""," gwei) cannot be lower than the block base fee."),{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class c extends i.C{constructor(){let{cause:e,nonce:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("Nonce provided for the transaction ".concat(t?"(".concat(t,") "):"","is higher than the next one expected."),{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class l extends i.C{constructor(){let{cause:e,nonce:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(["Nonce provided for the transaction ".concat(t?"(".concat(t,") "):"","is lower than the current nonce of the account."),"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class u extends i.C{constructor(){let{cause:e,nonce:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("Nonce provided for the transaction ".concat(t?"(".concat(t,") "):"","exceeds the maximum allowed nonce."),{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class d extends i.C{constructor(){let{cause:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class h extends i.C{constructor(){let{cause:e,gas:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("The amount of gas ".concat(t?"(".concat(t,") "):"","provided for the transaction exceeds the limit allowed for the block."),{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class p extends i.C{constructor(){let{cause:e,gas:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("The amount of gas ".concat(t?"(".concat(t,") "):"","provided for the transaction is too low."),{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class f extends i.C{constructor(e){let{cause:t}=e;super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}
2Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class g extends i.C{constructor(){let{cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(["The provided tip (`maxPriorityFeePerGas`".concat(t?" = ".concat((0,r.Q)(t)," gwei"):"",") cannot be higher than the fee cap (`maxFeePerGas`").concat(n?" = ".concat((0,r.Q)(n)," gwei"):"",").")].join("\n"),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(g,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class m extends i.C{constructor(e){let{cause:t}=e;super("An error occurred while executing: ".concat(null===t||void 0===t?void 0:t.shortMessage),{cause:t,name:"UnknownNodeError"})}}},14825:(e,t,n)=>{"use strict";async function r(e){return new Promise(t=>setTimeout(t,e))}n.d(t,{u:()=>r})},15208:(e,t,n)=>{"use strict";n.d(t,{e:()=>a});var r=n(18656),i=n(90934),s=n(44270);const o="/docs/contract/decodeFunctionResult";function a(e){const{abi:t,args:n,functionName:a,data:c}=e;let l=t[0];if(a){const e=(0,s.iY)({abi:t,args:n,name:a});if(!e)throw new r.Iz(a,{docsPath:o});l=e}if("function"!==l.type)throw new r.Iz(void 0,{docsPath:o});if(!l.outputs)throw new r.MR(l.name,{docsPath:o});const u=(0,i.n)(l.outputs,c);return u&&u.length>1?u:u&&1===u.length?u[0]:void 0}},15548:(e,t,n)=>{"use strict";n.d(t,{GK:()=>r,H_:()=>i,xh:()=>s});const r={path:"/api/v1/wallets",method:"POST"},i={path:"/api/v1/wallets/:wallet_id/rpc",method:"POST"},s={path:"/api/v1/wallets/revoke",method:"POST"}},15882:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,{A:()=>r})},15957:(e,t,n)=>{"use strict";function r(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e){if(!r(e))throw new Error("Uint8Array expected");for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function s(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"===typeof e):t.every(e=>Number.isSafeInteger(e))))}function o(e){if("function"!==typeof e)throw new Error("function expected");return!0}function a(e,t){if("string"!==typeof t)throw new Error("".concat(e,": string expected"));return!0}function c(e){if(!Number.isSafeInteger(e))throw new Error("invalid integer: ".concat(e))}function l(e){if(!Array.isArray(e))throw new Error("array expected")}function u(e,t){if(!s(!0,t))throw new Error("".concat(e,": array of strings expected"))}function d(e,t){if(!s(!1,t))throw new Error("".concat(e,": array of numbers expected"))}function h(){const e=e=>e,t=(e,t)=>n=>e(t(n));for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return{encode:r.map(e=>e.encode).reduceRight(t,e),decode:r.map(e=>e.decode).reduce(t,e)}}function p(e){const t="string"===typeof e?e.split(""):e,n=t.length;u("alphabet",t);const r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(l(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw new Error('alphabet.encode: digit index outside alphabet "'.concat(r,'". Allowed: ').concat(e));return t[r]})),decode:t=>(l(t),t.map(t=>{a("alphabet.decode",t);const n=r.get(t);if(void 0===n)throw new Error('Unknown letter: "'.concat(t,'". Allowed: ').concat(e));return n}))}}function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return a("join",e),{encode:t=>(u("join.decode",t),t.join(e)),decode:t=>(a("join.decode",t),t.split(e))}}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"=";return c(e),a("padding",t),{encode(n){for(u("padding.encode",n);n.length*e%8;)n.push(t);return n},decode(n){u("padding.decode",n);let r=n.length;if(r*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--){if((r-1)*e%8===0)throw new Error("padding: invalid, string has too much padding")}return n.slice(0,r)}}}function m(e){return o(e),{encode:e=>e,decode:t=>e(t)}}
2function y(e,t,n){if(t<2)throw new Error("convertRadix: invalid from=".concat(t,", base cannot be less than 2"));if(n<2)throw new Error("convertRadix: invalid to=".concat(n,", base cannot be less than 2"));if(l(e),!e.length)return[];let r=0;const i=[],s=Array.from(e,e=>{if(c(e),e<0||e>=t)throw new Error("invalid integer: ".concat(e));return e}),o=s.length;for(;;){let e=0,a=!0;for(let i=r;i<o;i++){const o=s[i],c=t*e,l=c+o;if(!Number.isSafeInteger(l)||c/t!==e||l-o!==c)throw new Error("convertRadix: carry overflow");const u=l/n;e=l%n;const d=Math.floor(u);if(s[i]=d,!Number.isSafeInteger(d)||d*n+e!==l)throw new Error("convertRadix: carry overflow");a&&(d?a=!1:r=i)}if(i.push(e),a)break}for(let a=0;a<e.length-1&&0===e[a];a++)i.push(0);return i.reverse()}n.d(t,{K3:()=>C,RG:()=>S,tw:()=>N});const v=(e,t)=>0===t?e:v(t,e%t),w=(e,t)=>e+(t-v(e,t)),b=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function A(e,t,n,r){if(l(e),t<=0||t>32)throw new Error("convertRadix2: wrong from=".concat(t));if(n<=0||n>32)throw new Error("convertRadix2: wrong to=".concat(n));if(w(t,n)>32)throw new Error("convertRadix2: carry overflow from=".concat(t," to=").concat(n," carryBits=").concat(w(t,n)));let i=0,s=0;const o=b[t],a=b[n]-1,u=[];for(const l of e){if(c(l),l>=o)throw new Error("convertRadix2: invalid data word=".concat(l," from=").concat(t));if(i=i<<t|l,s+t>32)throw new Error("convertRadix2: carry overflow pos=".concat(s," from=").concat(t));for(s+=t;s>=n;s-=n)u.push((i>>s-n&a)>>>0);const e=b[s];if(void 0===e)throw new Error("invalid carry");i&=e-1}if(i=i<<n-s&a,!r&&s>=t)throw new Error("Excess padding");if(!r&&i>0)throw new Error("Non-zero padding: ".concat(i));return r&&s>0&&u.push(i>>>0),u}function _(e){c(e);return{encode:t=>{if(!r(t))throw new Error("radix.encode input should be Uint8Array");return y(Array.from(t),256,e)},decode:t=>(d("radix.decode",t),Uint8Array.from(y(t,e,256)))}}function x(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(c(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(w(8,e)>32||w(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!r(n))throw new Error("radix2.encode input should be Uint8Array");return A(Array.from(n),8,e,!t)},decode:n=>(d("radix2.decode",n),Uint8Array.from(A(n,e,8,t)))}}function E(e){return o(e),function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(null,n)}catch(i){}}}const k=h(x(4),p("0123456789ABCDEF"),f("")),S=h(x(5),p("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),g(5),f("")),I=(h(x(5),p("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),f("")),h(x(5),p("0123456789ABCDEFGHIJKLMNOPQRSTUV"),g(5),f("")),h(x(5),p("0123456789ABCDEFGHIJKLMNOPQRSTUV"),f("")),h(x(5),p("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),f(""),m(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),(()=>"function"===typeof Uint8Array.from([]).toBase64&&"function"===typeof Uint8Array.fromBase64)()),T=(e,t)=>{a("base64",e);const n=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,r=t?"base64url":"base64";if(e.length>0&&!n.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:"strict"})},C=I?{encode:e=>(i(e),e.toBase64()),decode:e=>T(e,!1)}:h(x(6),p("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),g(6),f("")),P=(h(x(6),p("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),f("")),I?{encode:e=>(i(e),e.toBase64({alphabet:"base64url"})),decode:e=>T(e,!0)}:h(x(6),p("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),g(6),f(""))),O=(h(x(6),p("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),f("")),e=>h(_(58),p(e),f(""))),N=O("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),R=(O("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),O("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),[0,2,3,5,6,7,9,10,11]),M={encode(e){let t="";for(let n=0;n<e.length;n+=8){const r=e.subarray(n,n+8);t+=N.encode(r).padStart(R[r.length],"1")}return t},decode(e){let t=[];for(let n=0;n<e.length;n+=11){const r=e.slice(n,n+11),i=R.indexOf(r.length),s=N.decode(r);for(let e=0;e<s.length-i;e++)if(0!==s[e])throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(s.slice(s.length-i)))}return Uint8Array.from(t)}}
2,U=h(p("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),f("")),L=[996825010,642813549,513874426,1027748829,705979059];function B(e){const t=e>>25;let n=(33554431&e)<<5;for(let r=0;r<L.length;r++)1===(t>>r&1)&&(n^=L[r]);return n}function D(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const r=e.length;let i=1;for(let s=0;s<r;s++){const t=e.charCodeAt(s);if(t<33||t>126)throw new Error("Invalid prefix (".concat(e,")"));i=B(i)^t>>5}i=B(i);for(let s=0;s<r;s++)i=B(i)^31&e.charCodeAt(s);for(let s of t)i=B(i)^s;for(let s=0;s<6;s++)i=B(i);return i^=n,U.encode(A([i%b[30]],30,5,!1))}function j(e){const t="bech32"===e?1:734539939,n=x(5),i=n.decode,s=n.encode,o=E(i);function c(e,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90;a("bech32.encode prefix",e),r(n)&&(n=Array.from(n)),d("bech32.encode",n);const s=e.length;if(0===s)throw new TypeError("Invalid prefix length ".concat(s));const o=s+7+n.length;if(!1!==i&&o>i)throw new TypeError("Length ".concat(o," exceeds limit ").concat(i));const c=e.toLowerCase(),l=D(c,n,t);return"".concat(c,"1").concat(U.encode(n)).concat(l)}function l(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:90;a("bech32.decode input",e);const r=e.length;if(r<8||!1!==n&&r>n)throw new TypeError("invalid string length: ".concat(r," (").concat(e,"). Expected (8..").concat(n,")"));const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const s=i.lastIndexOf("1");if(0===s||-1===s)throw new Error('Letter "1" must be present between prefix and data only');const o=i.slice(0,s),c=i.slice(s+1);if(c.length<6)throw new Error("Data must be at least 6 characters long");const l=U.decode(c).slice(0,-6),u=D(o,l,t);if(!c.endsWith(u))throw new Error("Invalid checksum in ".concat(e,': expected "').concat(u,'"'));return{prefix:o,words:l}}return{encode:c,decode:l,encodeFromBytes:function(e,t){return c(e,s(t))},decodeToBytes:function(e){const{prefix:t,words:n}=l(e,!1);return{prefix:t,words:n,bytes:i(n)}},decodeUnsafe:E(l),fromWords:i,fromWordsUnsafe:o,toWords:s}}j("bech32"),j("bech32m");const F={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};(()=>"function"===typeof Uint8Array.from([]).toHex&&"function"===typeof Uint8Array.fromHex)()||h(x(4),p("0123456789abcdef"),f(""),m(e=>{if("string"!==typeof e||e.length%2!==0)throw new TypeError("hex.decode: expected string, got ".concat(typeof e," with length ").concat(e.length));return e.toLowerCase()}))},16046:(e,t,n)=>{"use strict";n.d(t,{B4:()=>i,SK:()=>s,hX:()=>o});var r=n(51659);class i extends r.C{constructor(e){let{offset:t}=e;super("Offset `".concat(t,"` cannot be negative."),{name:"NegativeOffsetError"})}}class s extends r.C{constructor(e){let{length:t,position:n}=e;super("Position `".concat(n,"` is out of bounds (`0 < position < ").concat(t,"`)."),{name:"PositionOutOfBoundsError"})}}
2class o extends r.C{constructor(e){let{count:t,limit:n}=e;super("Recursive read limit of `".concat(n,"` exceeded (recursive read count: `").concat(t,"`)."),{name:"RecursiveReadLimitExceededError"})}}},16447:(e,t,n)=>{"use strict";n.d(t,{D:()=>x});var r=n(81152),i=n(31442),s=n(45482);var o=n(86639);function a(e){return"".concat(e<0?"-":"","0x").concat(Math.abs(e).toString(16).padStart(2,"0"))}var c=n(25566),l=n(27014),u=n(34406),d=n(60207);var h=n(45207);const p="array",f="map_key",g="map_value",m=e=>{if("string"===typeof e||"number"===typeof e)return e;throw new h.X("The type of key must be string or number but "+typeof e)};class y{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=p,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=f,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===p){const t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===f||e.type===g){const t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const v=new DataView(new ArrayBuffer(0)),w=new Uint8Array(v.buffer);try{v.getInt8(0)}catch(E){if(!(E instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const b=new RangeError("Insufficient data"),A=new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,n){const r=this.caches[n-1];e:for(const i of r){const r=i.bytes;for(let i=0;i<n;i++)if(r[i]!==e[t+i])continue e;return i.str}return null}store(e,t){const n=this.caches[e.length-1],r={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)}decode(e,t,n){const r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;const i=(0,u.Zf)(e,t,n),s=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(s,i),i}};class _{constructor(e){var t,n,r,i,s,o,a,u,d;this.totalPos=0,this.pos=0,this.view=v,this.bytes=w,this.headByte=-1,this.stack=new y,this.entered=!1,this.extensionCodec=null!==(t=null===e||void 0===e?void 0:e.extensionCodec)&&void 0!==t?t:c.g.defaultCodec,this.context=null===e||void 0===e?void 0:e.context,this.useBigInt64=null!==(n=null===e||void 0===e?void 0:e.useBigInt64)&&void 0!==n&&n,this.rawStrings=null!==(r=null===e||void 0===e?void 0:e.rawStrings)&&void 0!==r&&r,this.maxStrLength=null!==(i=null===e||void 0===e?void 0:e.maxStrLength)&&void 0!==i?i:l.f7,this.maxBinLength=null!==(s=null===e||void 0===e?void 0:e.maxBinLength)&&void 0!==s?s:l.f7,this.maxArrayLength=null!==(o=null===e||void 0===e?void 0:e.maxArrayLength)&&void 0!==o?o:l.f7,this.maxMapLength=null!==(a=null===e||void 0===e?void 0:e.maxMapLength)&&void 0!==a?a:l.f7,this.maxExtLength=null!==(u=null===e||void 0===e?void 0:e.maxExtLength)&&void 0!==u?u:l.f7,this.keyDecoder=void 0!==(null===e||void 0===e?void 0:e.keyDecoder)?e.keyDecoder:A,this.mapKeyConverter=null!==(d=null===e||void 0===e?void 0:e.mapKeyConverter)&&void 0!==d?d:m}clone(){return new _({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){const t=(0,d.C)(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){const t=this.bytes.subarray(this.pos),n=(0,d.C)(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:n}=this;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))}decode(e){if(this.entered){return this.clone().decode(e)}try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){const t=this.clone();return void(yield*t.decodeMulti(e))}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered){return this.clone().decodeAsync(e)}try{this.entered=!0;let l,u=!1;var t,n=!1,r=!1;try{for(var i,s=(0,o.A)(e);n=!(i=await s.next()).done;n=!1){const e=i.value;if(u)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(e);try{l=this.doDecodeSync(),u=!0}
2catch(E){if(!(E instanceof RangeError))throw E}this.totalPos+=this.pos}}catch(c){r=!0,t=c}finally{try{n&&null!=s.return&&await s.return()}finally{if(r)throw t}}if(u){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return l}const{headByte:d,pos:h,totalPos:p}=this;throw new RangeError("Insufficient data in parsing ".concat(a(d)," at ").concat(p," (").concat(h," in the current buffer)"))}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}decodeMultiAsync(e,t){var n=this;return(0,r.A)(function*(){if(n.entered){const r=n.clone();return void(yield*function(e){var t={},n=!1;function r(t,r){return n=!0,r=new Promise(function(n){n(e[t](r))}),{done:!1,value:new s.A(r,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):r("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return r("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):r("return",e)}),t}((0,o.A)(r.decodeMultiAsync(e,t)),i.A))}try{n.entered=!0;let s=t,h=-1;var r,a=!1,c=!1;try{for(var l,u=(0,o.A)(e);a=!(l=yield(0,i.A)(u.next())).done;a=!1){const e=l.value;if(t&&0===h)throw n.createExtraByteError(n.totalPos);n.appendBuffer(e),s&&(h=n.readArraySize(),s=!1,n.complete());try{for(;yield n.doDecodeSync(),0!==--h;);}
2catch(E){if(!(E instanceof RangeError))throw E}n.totalPos+=n.pos}}catch(d){c=!0,r=d}finally{try{a&&null!=u.return&&(yield(0,i.A)(u.return()))}finally{if(c)throw r}}}finally{n.entered=!1}})()}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const n=e-128;if(0!==n){this.pushMapState(n),this.complete();continue e}t={}}else if(e<160){const n=e-144;if(0!==n){this.pushArrayState(n),this.complete();continue e}t=[]}else{const n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===e){const e=this.lookU8();t=this.decodeString(e,1)}else if(218===e){const e=this.lookU16();t=this.decodeString(e,2)}else if(219===e){const e=this.lookU32();t=this.decodeString(e,4)}else if(220===e){const e=this.readU16();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(221===e){const e=this.readU32();if(0!==e){this.pushArrayState(e),this.complete();continue e}t=[]}else if(222===e){const e=this.readU16();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(223===e){const e=this.readU32();if(0!==e){this.pushMapState(e),this.complete();continue e}t={}}else if(196===e){const e=this.lookU8();t=this.decodeBinary(e,1)}else if(197===e){const e=this.lookU16();t=this.decodeBinary(e,2)}else if(198===e){const e=this.lookU32();t=this.decodeBinary(e,4)}else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e){const e=this.lookU8();t=this.decodeExtension(e,1)}else if(200===e){const e=this.lookU16();t=this.decodeExtension(e,2)}else{if(201!==e)throw new h.X("Unrecognized type byte: ".concat(a(e)));{const e=this.lookU32();t=this.decodeExtension(e,4)}}this.complete();const n=this.stack;for(;n.length>0;){const e=n.top();if(e.type===p){if(e.array[e.position]=t,e.position++,e.position!==e.size)continue e;t=e.array,n.release(e)}else{if(e.type===f){if("__proto__"===t)throw new h.X("The key __proto__ is not allowed");e.key=this.mapKeyConverter(t),e.type=g;continue e}if(e.map[e.key]=t,e.readCount++,e.readCount!==e.size){e.key=null,e.type=f;continue e}t=e.map,n.release(e)}}return t}}readHeadByte(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new h.X("Unrecognized array type byte: ".concat(a(e)))}}pushMapState(e){if(e>this.maxMapLength)throw new h.X("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new h.X("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){var n;if(e>this.maxStrLength)throw new h.X("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+t+e)throw b;const r=this.pos+t;let i;return i=this.stateIsMapKey()&&null!==(n=this.keyDecoder)&&void 0!==n&&n.canBeCached(e)?this.keyDecoder.decode(this.bytes,r,e):(0,u._u)(this.bytes,r,e),this.pos+=t+e,i}stateIsMapKey(){if(this.stack.length>0){return this.stack.top().type===f}return!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new h.X("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw b;const n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r}decodeExtension(e,t){if(e>this.maxExtLength)throw new h.X("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));const n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=(0,l.Hn)(this.view,this.pos);return this.pos+=8,e}readI64(){const e=(0,l.eN)(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function x(e,t){return new _(t).decode(e)}}
2,16762:(e,t,n)=>{"use strict";var r=n(57722),i=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,s={},l=null,u=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,r)&&!c.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:i,type:e,key:l,ref:u,props:s,_owner:a.current}}t.Fragment=s,t.jsx=l,t.jsxs=l},17015:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});var r=n(7856),i=n(63015),s=n(91638);function o(e){let{r:t,s:n,to:o="hex",v:a,yParity:c}=e;const l=(()=>{if(0===c||1===c)return c;if(a&&(27n===a||28n===a||a>=35n))return a%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),u="0x".concat(new r.secp256k1.Signature((0,i.uU)(t),(0,i.uU)(n)).toCompactHex()).concat(0===l?"1b":"1c");return"hex"===o?u:(0,s.aT)(u)}},17236:(e,t,n)=>{"use strict";n.d(t,{H4:()=>y,v8:()=>g,$$:()=>m});var r=n(24107),i=n(18656),s=n(23422),o=n(73251),a=n(51659);class c extends a.C{constructor(e){let{domain:t}=e;super('Invalid domain "'.concat((0,o.A)(t),'".'),{metaMessages:["Must be a valid EIP-712 domain."]})}}class l extends a.C{constructor(e){let{primaryType:t,types:n}=e;super("Invalid primary type `".concat(t,"` must be one of `").concat(JSON.stringify(Object.keys(n)),"`."),{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class u extends a.C{constructor(e){let{type:t}=e;super('Struct type "'.concat(t,'" is invalid.'),{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}var d=n(27133),h=n(1490),p=n(652),f=n(58721);function g(e){const{domain:t,message:n,primaryType:i,types:s}=e,a=(e,t)=>{const n=(0,r.A)({},t);for(const r of e){const{name:e,type:t}=r;"address"===t&&(n[e]=n[e].toLowerCase())}return n},c=s.EIP712Domain&&t?a(s.EIP712Domain,t):{},l=(()=>{if("EIP712Domain"!==i)return a(s[i],n)})();return(0,o.A)({domain:c,message:l,primaryType:i,types:s})}function m(e){const{domain:t,message:n,primaryType:r,types:o}=e,a=(e,t)=>{for(const n of e){const{name:e,type:r}=n,c=t[e],l=r.match(f.Ge);if(l&&("number"===typeof c||"bigint"===typeof c)){const[e,t,n]=l;(0,p.cK)(c,{signed:"int"===t,size:Number.parseInt(n,10)/8})}if("address"===r&&"string"===typeof c&&!(0,d.P)(c))throw new s.M({address:c});const u=r.match(f.BD);if(u){const[e,t]=u;if(t&&(0,h.E)(c)!==Number.parseInt(t,10))throw new i.BI({expectedSize:Number.parseInt(t,10),givenSize:(0,h.E)(c)})}const g=o[r];g&&(v(r),a(g,c))}};if(o.EIP712Domain&&t){if("object"!==typeof t)throw new c({domain:t});a(o.EIP712Domain,t)}if("EIP712Domain"!==r){if(!o[r])throw new l({primaryType:r,types:o});a(o[r],n)}}function y(e){let{domain:t}=e;return["string"===typeof(null===t||void 0===t?void 0:t.name)&&{name:"name",type:"string"},(null===t||void 0===t?void 0:t.version)&&{name:"version",type:"string"},("number"===typeof(null===t||void 0===t?void 0:t.chainId)||"bigint"===typeof(null===t||void 0===t?void 0:t.chainId))&&{name:"chainId",type:"uint256"},(null===t||void 0===t?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(null===t||void 0===t?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function v(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new u({type:e})}},17488:(e,t,n)=>{"use strict";n.d(t,{P:()=>s,a:()=>l,e:()=>c,p:()=>i,u:()=>a});var r=n(57722);const i={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},connectOrCreateWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},signTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},s=(0,r.createContext)(void 0);let o=()=>(0,r.useContext)(s);function a(e,t){if(!t)return;let n=o().current[e];return(0,r.useEffect)(()=>{for(let[i,s]of Object.entries(t)){var r;Object.prototype.hasOwnProperty.call(n,i)||console.warn('Invalid event type "'.concat(i,'" for action "').concat(e,'"')),null===(r=n[i])||void 0===r||r.push(s)}return()=>{for(let[i,s]of Object.entries(t)){var r;Object.prototype.hasOwnProperty.call(n,i)||console.warn('Invalid event type "'.concat(i,'" for action "').concat(e,'"')),n[i]=null===(r=n[i])||void 0===r?void 0:r.filter(e=>e!==s)}}},[t])}
2function c(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),s=3;s<r;s++)i[s-3]=arguments[s];for(let o of e.current[t][n])o(...i)}function l(){let e=o();return function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return c(e,t,n,...i)}}},17587:(e,t,n)=>{"use strict";n.d(t,{A:()=>Yt});var r=n(24107),i=n(15882);const s={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"};class o{getConfig(){return this._privyInternal.config}async getSmartWalletConfig(){return this._smartWalletConfig||(this._smartWalletConfig=await this._privyInternal.fetch(s,{params:{app_id:this.appId}})),this._smartWalletConfig}get appId(){return this._privyInternal.appId}constructor(e){this._privyInternal=e}}const a={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"};var c=n(51475);class l{static parse(e){try{return new l(e)}catch(e){return null}}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=c.i(e)}}class u{async updateOnCrossAppAuthentication(e,t){let n=t.access_token,r=u.providerAccessTokenStorageKey(e);await this._storage.put(r,n)}async getProviderAccessToken(e){let t=u.providerAccessTokenStorageKey(e),n=await this._storage.get(t);if("string"!=typeof n)return null;try{if(new l(n).isExpired())throw Error("JWT is expired");return n}catch(r){return await this._storage.del(t),null}}async getCrossAppConnections(){return await this._privyInternal.fetch(a,{params:{app_id:this._privyInternal.appId}})}constructor(e,t){this._privyInternal=e,this._storage=t}}u.providerAccessTokenStorageKey=e=>"privy:cross-app:".concat(e);var d=n(15548);class h{async revoke(){await this._privyInternal.fetch(d.xh,{})}constructor(e){this._privyInternal=e}}var p=n(32381),f=n(23231),g=n(67821);const m=e=>!!e.id&&"privy-v2"===e.recovery_method;class y{async sign(e){let{message:t}=e;return await this.request({method:"sign",params:{message:new TextDecoder("utf8").decode(t)}})}async signTransaction(e){let{psbt:t}=e;return await this.request({method:"signTransaction",params:{psbt:t}})}async request(e){if(m(this._account))throw new g.wE({code:"unsupported_wallet_type",error:"Bitcoin wallet providers are only supported for on-device execution and this app uses TEE execution. Use the useSignRawHash hook from @privy-io/expo/extended-chains to sign over a hash with this wallet. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide"});if(!await this._privyInternal.getAccessTokenInternal())throw new g.wE({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});return this.handleIFrameRpc(e)}async handleIFrameRpc(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing access token. User must be authenticated.");return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),(await this._proxy.rpcWallet({accessToken:t,request:e,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,hdWalletIndex:this._account.wallet_index,chainType:this._account.chain_type})).response.data}catch(o){console.error(o);let n=o instanceof Error?o.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:n}),new g.wE({code:"embedded_wallet_request_error",error:n})}}toJSON(){return"PrivyEmbeddedBitcoinProvider { address: '".concat(this._account.address,"', request: [Function] }")}constructor(e){let{proxy:t,privyInternal:n,account:r,entropyId:i,entropyIdVerifier:s}=e;this._proxy=t,this._privyInternal=n,this._account=r,this._entropyId=i,this._entropyIdVerifier=s}}var v=n(27999),w=n(93116);async function b(e){let{context:t,chainType:n}=e;return{wallet:await(0,w.v)(t,{request:{chain_type:n,owner_id:void 0}})}}var A,_=n(67456);function x(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}let E=(A=0,()=>"id-"+A++),k=(e,t)=>"bigint"==typeof t?t.toString():t,S=async(e,t)=>{let n,{ms:r,msg:i}=t,s=new Promise((e,t)=>
2{n=setTimeout(()=>{t(Error(i))},null!==r&&void 0!==r?r:15e3)});try{return await Promise.race([e,s])}finally{void 0!==n&&clearTimeout(n)}},I=new class{enqueue(e,t){this.callbacks[e]=t}dequeue(e,t){let n=this.callbacks[t];if(!n)throw Error("cannot dequeue ".concat(e," event: no event found for id ").concat(t));switch(delete this.callbacks[t],e){case"privy:iframe:ready":case"privy:wallets:create":case"privy:user-signer:sign":case"privy:wallets:add":case"privy:wallets:set-recovery":case"privy:wallets:connect":case"privy:wallets:recover":case"privy:wallets:rpc":case"privy:wallet:create":case"privy:wallet:connect":case"privy:wallet:recover":case"privy:wallet:rpc":case"privy:solana-wallet:create":case"privy:solana-wallet:create-additional":case"privy:solana-wallet:connect":case"privy:solana-wallet:recover":case"privy:solana-wallet:rpc":case"privy:delegated-actions:consent":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":return n;default:throw Error("invalid wallet event type ".concat(e))}}constructor(){this.callbacks={}}};class T{invokeWithMfa(e,t){var n;return S(async function(t,n,r,i){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,c=s,l=async e=>{if(c){var o;e===(s?0:1)?i():null===(o=r.current)||void 0===o||o.reject(new v.Pi("missing_or_invalid_mfa","MFA verification failed, retry."));let c=await new Promise((e,t)=>{n.current={resolve:e,reject:t},setTimeout(()=>{var e;let n=new v.Pi("mfa_timeout","Timed out waiting for MFA code");null!==(e=r.current)&&void 0!==e&&e.reject(n),t(n)},a)});return await t(c)}return await t()},u=null;for(let f=0;f<o;f++)try{var d;u=await l(f),null===(d=r.current)||void 0===d||d.resolve(void 0);break}catch(e){var h;if("missing_or_invalid_mfa"!==e.type)throw null!==(h=r.current)&&void 0!==h&&h.resolve(void 0),e;c=!0}if(null===u){var p;let e=new v.Pi("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw null!==(p=r.current)&&void 0!==p&&p.reject(e),e}return u}(n=>S(this.waitForReady().then(()=>e(n)),{msg:t.timeoutMsg,ms:t.timeoutMs}),this.mfa.rootPromise,this.mfa.submitPromise,()=>this.mfa.emit("mfaRequired"),null!==(n=t.mfaAlwaysRequired)&&void 0!==n&&n,4,3e5),{msg:"Operation reached timeout: MFA verification",ms:126e4})}reload(){return this.ready=!1,this._embeddedWalletMessagePoster.reload()}ping(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return S(this.invoke("privy:iframe:ready",{}),{msg:"Ping reached timeout",ms:e})}create(e){return S(this.waitForReady().then(()=>this.invoke("privy:wallet:create",e)),{msg:"Operation reached timeout: create"})}rpc(e){return this.invokeWithMfa(t=>this.invoke("privy:wallet:rpc",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: rpc"})}createSolana(e){return this.invokeWithMfa(t=>this.invoke("privy:solana-wallet:create",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: create",timeoutMs:6e4})}createAdditionalSolana(e){return S(this.waitForReady().then(()=>this.invoke("privy:solana-wallet:create-additional",e)),{msg:"Operation reached timeout: create"})}solanaRpc(e){return this.invokeWithMfa(t=>this.invoke("privy:solana-wallet:rpc",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: solana-rpc"})}delegateWallets(e){return this.invokeWithMfa(t=>this.invoke("privy:delegated-actions:consent",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: delegated-actions:consent"})}verifyMfa(e){return this.invokeWithMfa(t=>this.invoke("privy:mfa:verify",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: mfa:verify",mfaAlwaysRequired:!0})}initEnrollMfa(e){return this.invokeWithMfa(t=>this.invoke("privy:mfa:init-enrollment",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: mfa:init-enrollment"})}submitEnrollMfa(e){return this.invokeWithMfa(t=>this.invoke("privy:mfa:submit-enrollment",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: mfa:submit-enrollment"})}unenrollMfa(e){return this.invokeWithMfa(t=>this.invoke("privy:mfa:unenroll",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: mfa:unenroll",mfaAlwaysRequired:!0})}clearMfa(e){return S(this.waitForReady().then(()=>this.invoke("privy:mfa:clear",e)),{msg:"Operation reached timeout: mfa:clear"})}createWallet(e){return this.invokeWithMfa(t=>this.invoke("privy:wallets:create",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: create",timeoutMs:6e4})}signWithUserSigner(e){return this.invokeWithMfa(t=>this.invoke("privy:user-signer:sign",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: user-signer:sign"})}addWallet(e){return S(this.waitForReady().then(()=>this.invoke("privy:wallets:add",e)),{msg:"Operation reached timeout: wallets:add"})}setRecovery(e){return this.invokeWithMfa(t=>this.invoke("privy:wallets:set-recovery",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: wallets:set-recovery",t
2imeoutMs:6e4})}connect(e){return S(this.waitForReady().then(()=>this.invoke("privy:wallets:connect",e)),{msg:"Operation reached timeout: wallets:connect"})}recover(e){return this.invokeWithMfa(t=>this.invoke("privy:wallets:recover",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: wallets:recover",timeoutMs:6e4})}rpcWallet(e){return this.invokeWithMfa(t=>this.invoke("privy:wallets:rpc",(0,r.A)((0,r.A)({},t),e)),{timeoutMsg:"Operation reached timeout: wallets:rpc"})}handleEmbeddedWalletMessages(e){if(!e.event.startsWith("privy:"))return void console.warn("Unsupported event type: ".concat(e.event));let{reject:t,resolve:n}=I.dequeue(e.event,e.id);return void 0!==e.error?t(new v.Pi(e.error.type,e.error.message)):n(e.data)}waitForReady(){return this.ready?Promise.resolve():new Promise(async(e,t)=>{for(;!this.ready;)this.invoke("privy:iframe:ready",{}).then(()=>{this.ready=!0,e()}).catch(t),await x(150)})}invoke(e,t){let n=((e,t)=>"".concat(e).concat(JSON.stringify(t,k)))(e,t);if("privy:wallet:create"===e||"privy:solana-wallet:create"===e){let e=this.cache.get(n);if(e)return e}let r=new Promise((n,r)=>{let i=E();I.enqueue(i,{resolve:n,reject:r}),this._embeddedWalletMessagePoster.postMessage(JSON.stringify({id:i,event:e,data:t}),"*")}).finally(()=>{this.cache.delete(n)});return this.cache.set(n,r),r}constructor(e,t){this.ready=!1,this.cache=new Map,this._embeddedWalletMessagePoster=e,this.mfa=t}}var C=n(30549),P=n(652),O=n(36733);const N=e=>/^0x[0-9a-fA-F]*$/.test(e),R=e=>Buffer.from(e,"utf8"),M=e=>"0x".concat(e.toString("hex"));var U=n(50448);function L(e){var t;return{from:e.from,to:null!==(t=e.to)&&void 0!==t?t:void 0,nonce:B(e.nonce),chain_id:B(e.chainId),data:function(e){if(void 0!==e)return"string"==typeof e?N(e)?e:M(R(e)):M(Buffer.from(Uint8Array.from(e)))}(e.data),value:B(e.value),type:e.type,gas_limit:B(e.gasLimit),gas_price:B(e.gasPrice),max_fee_per_gas:B(e.maxFeePerGas),max_priority_fee_per_gas:B(e.maxPriorityFeePerGas)}}function B(e){return"number"==typeof e||"bigint"==typeof e?"0x".concat(BigInt(e).toString(16)):"string"==typeof e?N(e)?e:M(R(e)):void 0}function D(e){return"string"==typeof e&&(e=JSON.parse(e)),{types:e.types,primary_type:String(e.primaryType),domain:e.domain,message:e.message}}n(54798);async function j(e){let{context:t,account:n,rpcRequest:r}=e;switch(r.chainType){case"ethereum":return async function(e){let{context:t,account:n,rpcRequest:r}=e;switch(r.method){case"personal_sign":{let[e]=r.params,i=await(0,U._)(t,t.signRequest,{chain_type:"ethereum",method:"personal_sign",wallet_id:n.id,params:e.startsWith("0x")?{message:e.slice(2),encoding:"hex"}:{message:e,encoding:"utf-8"}});if("personal_sign"!==i.method)throw Error("Unable to sign message");return{data:i.data.signature}}case"eth_signTransaction":{let[e]=r.params,i=await(0,U._)(t,t.signRequest,{chain_type:"ethereum",method:"eth_signTransaction",wallet_id:n.id,params:{transaction:L(e)}});if("eth_signTransaction"!==i.method)throw Error("Unable to sign transaction");return{data:i.data.signed_transaction}}case"eth_signTypedData_v4":{let[,e]=r.params,i=await(0,U._)(t,t.signRequest,{chain_type:"ethereum",method:r.method,wallet_id:n.id,params:{typed_data:D(e)}});if("eth_signTypedData_v4"!==i.method)throw Error("Unable to sign typed data");return{data:i.data.signature}}case"eth_sign":{let[,e]=r.params,i=await(0,U._)(t,t.signRequest,{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:n.id,params:{hash:N(e)?e:M(R(e))}});if("secp256k1_sign"!==i.method)throw Error("Unable to sign message");return{data:i.data.signature}}case"secp256k1_sign":{let[e]=r.params,i=await(0,U._)(t,t.signRequest,{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:n.id,params:{hash:N(e)?e:M(R(e))}});if("secp256k1_sign"!==i.method)throw Error("Unable to sign message");return{data:i.data.signature}}case"csw_signUserOperation":case"eth_sendTransaction":case"eth_populateTransactionRequest":throw Error("This wallet does not support the method: ".concat(r.method))}}({context:t,account:n,rpcRequest:r.request});case"solana":return async function(e){let{context:t,account:n,rpcRequest:r}=e;if("signMessage"===r.method){let{message:e}=r.params,i=await(0,U._)(t,t.signRequest,{chain_type:"solana",method:"signMessage",wallet_id:n.id,params:{message:e,encoding:"base64"}});if("signMessage"!==i.method)throw Error("Unable to sign message");return{data:i.data.signature}}}({context:t,account:n,rpcRequest:r.request})}}const F=["type"];let z=new Set(["eth_sign","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"]);class W extends C.A{async request(e){if(z.has(e.method))return this.handleIFrameRpc(e);switch(e.method){case"eth_accounts":case"eth_requestAccounts":return this._account.address?[this._account.address]:[];case"eth_chainId":return"0x".concat(this._chainId.toString(16));case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_signTransaction":{var t;let n=null===(t=e.params)||void 0===t?void 0:t[0];return this.handleSignTransaction(n)}case"eth_sendTransaction":{var n;let t=null===(n=e.params)||void 0===n?void 0:n[0];return this.handleSendTransaction(t)}case"eth_populateTransactionRequest":{var r;let t=null===(r=e.params)||void 0===r?void 0:r[0];return this.handlePopulateTransaction(t)}default:return this.handleJsonRpc(e)}}ensureChainId(e){let t=(0,r.A)({chainId:this._chainId},e);return this.internalSwitchEthereumChain(t.chainId),t}internalSwitchEthereumChain(e){e&&Number(e)!==this._chainId&&(this._chainId=Number(e),this._client=(0,_.Bm)(this._chainId,this._chains,{rpcUrls:[]},{appId:this._privyInternal.appId}
2),this.emit("chainChanged",e))}async handlePopulateTransaction(e){var t;let n=this.ensureChainId(e),s=(0,O._)(n),o=await this._client.prepareTransactionRequest((0,r.A)({account:null!==(t=n.from)&&void 0!==t?t:this._account.address},s)),{type:a}=o,c=(0,i.A)(o,F);return(0,r.A)((0,r.A)({},c),{},{type:O.k[a]})}async handleSignTransaction(e){let t=(0,r.A)({},e);for(let n of Object.keys(t)){let e=t[n];e&&"bigint"==typeof e&&(t[n]=(0,P.nj)(e))}return await this.handleIFrameRpc({method:"eth_signTransaction",params:[t]})}async handleSendTransaction(e){let t=await this.handlePopulateTransaction(e),n=await this.handleSignTransaction(t);return await this.handleJsonRpc({method:"eth_sendRawTransaction",params:[n]})}async handleEstimateGas(e){var t,n;if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");let i=null===(t=e.params)||void 0===t?void 0:t[0],s=this.ensureChainId(i),o=(0,O._)(s);return await this._client.estimateGas((0,r.A)({account:null!==(n=s.from)&&void 0!==n?n:this._account.address},o))}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new v.sj("Invalid params for ".concat(e.method),4200);if("string"==typeof e.params[0])t=e.params[0];else{if(!("chainId"in e.params[0])||"string"!=typeof e.params[0].chainId)throw new v.sj("Invalid params for ".concat(e.method),4200);t=e.params[0].chainId}this.internalSwitchEthereumChain(t)}async handleIFrameRpc(e){var t=this;try{let n=await this._privyInternal.getAccessTokenInternal();if(!n)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address});let r=this._account;if(m(r)){let{data:i}=await j({context:{app:this._appApi,fetchPrivyRoute:function(){return t._privyInternal.fetch(...arguments)},getCompiledPath:function(){return t._privyInternal.getPath(...arguments)},signRequest:e=>{let{message:t}=e;return this._walletProxy.signWithUserSigner({accessToken:n,message:t})}},account:r,rpcRequest:{chainType:"ethereum",request:e}});return i}try{await this._walletProxy.connect({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:n})}catch(e){let t=(0,v.pO)(e);if(t&&"privy"===this._account.recovery_method)await this._walletProxy.recover({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:n});else{if(!t||!this._onNeedsRecovery)throw e;{let e;await new Promise(async(t,n)=>{var r;e=setTimeout(()=>n(new g.wE({code:"embedded_wallet_recovery_error",error:"User-owned recovery timed out"})),12e4),await(null===(r=this._onNeedsRecovery)||void 0===r?void 0:r.call(this,{recoveryMethod:this._account.recovery_method,onRecovered:()=>t(!0)}))}).finally(()=>clearTimeout(e))}}}return(await this._walletProxy.rpcWallet({accessToken:n,request:e,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,hdWalletIndex:this._account.wallet_index,chainType:"ethereum"})).response.data}catch(u){console.error(u);let n=u instanceof Error?u.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:n}),new g.wE({code:"embedded_wallet_request_error",error:n})}}async handleJsonRpc(e){return this._client.request(e)}toJSON(){return"PrivyEIP1193Provider { address: '".concat(this._account.address,"', chainId: ").concat(this._chainId,", request: [Function] }")}constructor(e){let{walletProxy:t,privyInternal:n,account:r,entropyId:i,entropyIdVerifier:s,chains:o,onNeedsRecovery:a,chainId:c=o[0].id,appApi:l}=e;super(),this._walletProxy=t,this._privyInternal=n,this._account=r,this._entropyId=i,this._entropyIdVerifier=s,this._chainId=c,this._chains=o,this._onNeedsRecovery=a,this._client=(0,_.Bm)(c,o,{rpcUrls:[]},{appId:l.appId}),this._appApi=l}}function q(e){return"version"in e}function H(e,t){let n=(q(e)?e.message:e.compileMessage()).staticAccountKeys.find(e=>e.toBase58()===t);if(!n)throw Error("Transaction does not contain public key ".concat(t));return n}class V{async request(e){if(!await this._privyInternal.getAccessTokenInternal())throw new g.wE({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});switch(e.method){case"signAndSendTransaction":return await this.handleSignAndSendTransaction(e);case"signTransaction":return await this.handleSignTransaction(e);default:return await this.handleIFrameRpc(e)}}get _publicKey(){return this._account.address}
2async connectAndRecover(e){if("privy-v2"!==this._account.recovery_method)try{await this._proxy.connect({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:e})}catch(o){let n=(0,v.pO)(o);if(n&&"privy"===this._account.recovery_method)await this._proxy.recover({entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier,accessToken:e});else{if(!n||!this._onNeedsRecovery)throw o;{let e;await new Promise(async(t,n)=>{var r;e=setTimeout(()=>n(new g.wE({code:"embedded_wallet_recovery_error",error:"User-owned recovery timed out"})),12e4),await(null===(r=this._onNeedsRecovery)||void 0===r?void 0:r.call(this,{recoveryMethod:this._account.recovery_method,onRecovered:()=>t(!0)}))}).finally(()=>clearTimeout(e))}}}}async signMessageRpc(e,t){var n=this;let r=this._account;if(!m(r))return(await this._proxy.rpcWallet({accessToken:t,request:e,chainType:"solana",hdWalletIndex:this._account.wallet_index,entropyId:this._entropyId,entropyIdVerifier:this._entropyIdVerifier})).response.data;{let{data:i}=await j({context:{app:this._app,fetchPrivyRoute:function(){return n._privyInternal.fetch(...arguments)},getCompiledPath:function(){return n._privyInternal.getPath(...arguments)},signRequest:e=>{let{message:n}=e;return this._proxy.signWithUserSigner({accessToken:t,message:n})}},account:r,rpcRequest:{chainType:"solana",request:e}});return{signature:i}}}async handleIFrameRpc(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing privy token. User must be logged in");return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(t),await this.signMessageRpc(e,t)}catch(o){console.error(o);let n=o instanceof Error?o.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:n}),new g.wE({code:"embedded_wallet_request_error",error:n})}}async handleSignAndSendTransaction(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(t);let{transaction:n,connection:r,options:i}=e.params,s=H(n,this._account.address),o=q(n)?Buffer.from(n.message.serialize()):n.serializeMessage(),{signature:a}=await this.signMessageRpc({method:"signMessage",params:{message:o.toString("base64")}},t);return n.addSignature(s,Buffer.from(a,"base64")),{signature:await r.sendRawTransaction(n.serialize(),i)}}catch(u){console.error(u);let n=u instanceof Error?u.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.address,error:n}),new g.wE({code:"embedded_wallet_request_error",error:n})}}async handleSignTransaction(e){try{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("Missing privy token. User must be logged in");this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_started",{method:e.method,address:this._account.address}),await this.connectAndRecover(t);let{transaction:n}=e.params,r=H(n,this._account.address),i=q(n)?Buffer.from(n.message.serialize()):n.serializeMessage(),{signature:s}=await this.signMessageRpc({method:"signMessage",params:{message:i.toString("base64")}},t);return n.addSignature(r,Buffer.from(s,"base64")),{signedTransaction:n}}catch(u){console.error(u);let n=u instanceof Error?u.message:"Unable to make wallet request";throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_rpc_failed",{method:e.method,address:this._account.wallet_index,error:n}),new g.wE({code:"embedded_wallet_request_error",error:n})}}toJSON(){return"PrivyEmbeddedSolanaProvider { address: '".concat(this._account.address,"', request: [Function] }")}constructor(e){let{proxy:t,privyInternal:n,account:r,entropyId:i,entropyIdVerifier:s,onNeedsRecovery:o,app:a}=e;this._proxy=t,this._privyInternal=n,this._account=r,this._entropyId=i,this._entropyIdVerifier=s,this._onNeedsRecovery=o,this._app=a}}const G=["wallet"];
2class K{setMessagePoster(e){this._proxy=new T(e,this._mfaPromises),this._mfa.setProxy(this._proxy)}async signWithUserSigner(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw new g.wE({error:"User must be logged in to sign a message with the user signer",code:"user_signer_sign_error"});let{signature:n}=await this._proxy.signWithUserSigner({accessToken:t,message:e.message});return{signature:n}}async add(e){var t,n=this;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if("user-controlled-server-wallets-only"===(null===(t=this._privyInternal.config)||void 0===t?void 0:t.embedded_wallet_config.mode))await b({context:{app:this._appApi,fetchPrivyRoute:function(){return n._privyInternal.fetch(...arguments)},getCompiledPath:function(){return n._privyInternal.getPath(...arguments)}},chainType:e.chainType});else{let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw new g.wE({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});await this._proxy.addWallet((0,r.A)({accessToken:t},e))}let{user:i}=await this._privyInternal.refreshSession();return{user:i}}async getBitcoinProvider(e){let{wallet:t,entropyId:n,entropyIdVerifier:r,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:o}=e;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(!await this._privyInternal.getAccessTokenInternal())throw Error("User must be logged in to create an embedded wallet");return m(t)||await this._load({entropyId:n,entropyIdVerifier:r,wallet:t,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:o}),new y({account:t,privyInternal:this._privyInternal,proxy:this._proxy,entropyId:n,entropyIdVerifier:r})}async create(e){var t,n=this;let{password:r,recoveryMethod:i,recoveryToken:s,recoveryKey:o,recoverySecretOverride:a,iCloudRecordNameOverride:c,solanaAccount:l,skipCallbacks:u}=e;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if("user-controlled-server-wallets-only"===(null===(t=this._privyInternal.config)||void 0===t?void 0:t.embedded_wallet_config.mode)){if(i&&!i.startsWith("privy"))throw new g.wE({error:"User-controlled server wallets do not support custom recovery methods",code:"embedded_wallet_creation_error"});await b({context:{app:this._appApi,fetchPrivyRoute:function(){return n._privyInternal.fetch(...arguments)},getCompiledPath:function(){return n._privyInternal.getPath(...arguments)}},chainType:"ethereum"})}else{var d;let e;if(e=i||(r?"user-passcode":"privy"),r&&"string"!=typeof r)throw Error("Invalid recovery password, must be a string");if("privy"===e&&null!==(d=this._privyInternal.config)&&void 0!==d&&d.embedded_wallet_config.require_user_password_on_create)throw Error("Password not provided yet is required by App configuration");let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw Error("User must be logged in to create an embedded wallet");let{address:n}=await this._proxy.create({accessToken:t,recoveryMethod:e,recoveryKey:o,recoveryPassword:r,recoveryAccessToken:s,recoverySecretOverride:a,iCloudRecordNameOverride:c,solanaAddress:null===l||void 0===l?void 0:l.address});if(!n)throw Error("Failed to create wallet")}return await this._privyInternal.refreshSession(u)}async createSolana(e){var t,n=this;if(!this._proxy)throw new g.wE({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_creation_error"});if("user-controlled-server-wallets-only"===(null===(t=this._privyInternal.config)||void 0===t?void 0:t.embedded_wallet_config.mode))await b({context:{app:this._appApi,fetchPrivyRoute:function(){return n._privyInternal.fetch(...arguments)},getCompiledPath:function(){return n._privyInternal.getPath(...arguments)}},chainType:"solana"});else{var r;let t=await this._privyInternal.getAccessTokenInternal();if(!t)throw new g.wE({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});(null===e||void 0===e?void 0:e.ethereumAccount)&&await this.getProvider(e.ethereumAccount);let{publicKey:n}=await this._proxy.createSolana({accessToken:t,ethereumAddress:null===e||void 0===e||null===(r=e.ethereumAccount)||void 0===r?void 0:r.address});if(!n)throw new g.wE({error:"Failed to create wallet",code:"embedded_wallet_creation_error"})}return await this._privyInternal.refreshSession()}async delegateWallets(e){let{delegatedWallets:t,rootWallet:n}=e;if(!this._proxy)throw new g.wE({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_creation_error"});let r=await this._privyInternal.getAccessTokenInternal();if(!r)throw new g.wE({error:"User must be logged in to create an embedded wallet",code:"embedded_wallet_creation_error"});await this._proxy.delegateWallets({accessToken:r,delegatedWallets:t,rootWallet:n})}async getProvider(e,t,n,r,i){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");
2return m(e)||await this._load({wallet:e,entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier",recoveryPassword:t,recoveryKey:i,recoveryAccessToken:n,recoverySecretOverride:r}),new W({account:e,entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,appApi:this._appApi})}async getEthereumProvider(e){let{wallet:t,entropyId:n,entropyIdVerifier:r,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:o,recoveryKey:a,onNeedsRecovery:c}=e;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(!await this._privyInternal.getAccessTokenInternal())throw Error("User must be logged in to create an embedded wallet");return m(t)||(!c||i||s||o||a)&&await this._load({entropyId:n,entropyIdVerifier:r,wallet:t,recoveryPassword:i,recoveryAccessToken:s,recoverySecretOverride:o,recoveryKey:a}),new W({account:t,entropyId:n,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,onNeedsRecovery:c,appApi:this._appApi})}async getSolanaProvider(e,t,n,r,i,s,o){if(!this._proxy)throw new g.wE({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return m(e)||(!o||r||i||s)&&await this._load({wallet:e,entropyId:t,entropyIdVerifier:n,recoveryPassword:r,recoveryAccessToken:i,recoverySecretOverride:s}),new V({account:e,privyInternal:this._privyInternal,proxy:this._proxy,entropyId:t,entropyIdVerifier:n,onNeedsRecovery:o,app:this._appApi})}async setRecovery(e){let{wallet:t}=e,n=(0,i.A)(e,G);if(!this._proxy)throw Error("Embedded wallet proxy not initialized");if(m(t))throw new g.wE({error:"This wallet does not support setting recovery methods",code:"unsupported_recovery_method"});(0,_.Di)({currentRecoveryMethod:t.recovery_method,upgradeToRecoveryMethod:"icloud-native"===n.recoveryMethod?"icloud":n.recoveryMethod}),await this._load("solana"===t.chain_type?{wallet:t,entropyId:t.address,entropyIdVerifier:"solana-address-ver
2ifier"}:{wallet:t,entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier"});let s=await this._privyInternal.getAccessTokenInternal();if(!s)throw Error("User must be logged in to interact with embedded wallets");let o=t.recovery_method;this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_started",{address:t.address,target_recovery_method:n.recoveryMethod,existing_recovery_method:o});try{let e;if("user-passcode"===n.recoveryMethod)e={recoveryMethod:"user-passcode",recoveryPassword:n.password};else if("google-drive"===n.recoveryMethod)e={recoveryMethod:"google-drive",recoveryAccessToken:n.recoveryAccessToken};else if("icloud"===n.recoveryMethod)e={recoveryMethod:"icloud",recoveryAccessToken:n.recoveryAccessToken};else if("icloud-native"===n.recoveryMethod)e={recoveryMethod:"icloud-native",iCloudRecordNameOverride:n.iCloudRecordNameOverride,recoverySecretOverride:n.recoverySecretOverride};else if("recovery-encryption-key"===n.recoveryMethod)e={recoveryMethod:"recovery-encryption-key",recoveryKey:n.recoveryKey};else{if("privy"!==n.recoveryMethod)throw Error("Unknown recovery method: ".concat(n.recoveryMethod));e={recoveryMethod:"privy"}}await this._proxy.setRecovery((0,r.A)({accessToken:s,entropyId:t.address,entropyIdVerifier:"solana"===t.chain_type?"solana-address-ver
2ifier":"ethereum-address-verifier"},e)),this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_completed",{address:t.address,target_recovery_method:n.recoveryMethod,existing_recovery_method:o});let{user:i}=await this._privyInternal.refreshSession();return{user:i,provider:"ethereum"!==t.chain_type?null:new W({account:t,entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier",privyInternal:this._privyInternal,chains:this._chains,walletProxy:this._proxy,appApi:this._appApi})}}catch(e){throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_set_recovery_failed",{address:t.address,recovery_method:t.recovery_method,error:e instanceof Error?e.message:"Unable to recover wallet"}),e}}getURL(){let e=new URL("".concat(this._privyInternal.baseUrl,"/apps/").concat(this._privyInternal.appId,"/embedded-wallets"));return this._privyInternal.caid&&e.searchParams.append("caid",this._privyInternal.caid),this._privyInternal.appClientId&&e.searchParams.append("client_id",this._privyInternal.appClientId),e.href}get chains(){return this._chains}onMessage(e){if(!this._proxy)throw Error("Embedded wallet proxy not initialized");return this._proxy.handleEmbeddedWalletMessages(e)}reload(){this._proxy?this._proxy.reload():console.warn("Attempted to reload proxy before initialized")}async ping(e){try{if(!this._proxy)throw Error("Embedded wallet proxy not initialized");return await this._proxy.ping(e),!0}catch(e){return console.error(e),!1}}async _load(e){let{entropyId:t,entropyIdVerifier:n,wallet:r,recoveryPassword:i,recoveryKey:s,recoveryAccessToken:o,recoverySecretOverride:a}=e;if(!this._proxy)throw Error("Embedded wallet proxy not initialized");let c=await this._privyInternal.getAccessTokenInternal();if(!c)throw Error("User must be logged in to interact with embedded wallets");try{return await this._proxy.connect({accessToken:c,entropyId:t,entropyIdVerifier:n}),t}catch(fe){if((0,v.pO)(fe))try{if("privy"===r.recovery_method){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let e=await this._proxy.recover({accessToken:c,entropyId:t,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),e.entropyId}if("user-passcode"===r.recovery_method&&i){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let e=await this._proxy.recover({accessToken:c,recoveryPassword:i,entropyId:t,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),e.entropyId}if(["google-drive","icloud"].includes(r.recovery_method)&&o){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let e=await this._proxy.recover({accessToken:c,recoveryAccessToken:o,entropyId:t,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),e.entropyId}if("icloud"===r.recovery_method&&a){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:"icloud-native"});let e=await this._proxy.recover({accessToken:c,recoverySecretOverride:a,entropyId:t,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:"icloud-native"}),e.entropyId}if("recovery-encryption-key"===r.recovery_method&&s){this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_started",{address:r.address,recovery_method:r.recovery_method});let e=await this._proxy.recover({accessToken:c,recoveryKey:s,entropyId:t,entropyIdVerifier:n});return this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_completed",{address:r.address,recovery_method:r.recovery_method}),e.entropyId}}catch(n){throw this._privyInternal.createAnalyticsEvent("embedded_wallet_sdk_recovery_failed",{address:r.address,recovery_method:r.re
2covery_method,error:n instanceof Error?n.message:"Unable to recover wallet: ".concat(t)}),n}throw fe}}constructor(e,t,n,r,i,s){if(this._chains=Array.from(p.m),this._privyInternal=e,t&&(this._proxy=new T(t,i),r.setProxy(this._proxy)),n){let e=(0,f._)(n);this._chains=e}this._mfa=r,this._mfaPromises=i,this._appApi=s}}class J extends C.A{constructor(){super(),this.rootPromise={current:null},this.submitPromise={current:null}}}var Z,Q=n(62253),Y=n(22904),X=((Z={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",Z.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",Z.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",Z.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",Z.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",Z.MISSING_MFA_ENROLLMENT="missing_mfa_enrollment",Z.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",Z.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",Z.INVALID_DATA="invalid_data",Z.INVALID_CREDENTIALS="invalid_credentials",Z.INVALID_CAPTCHA="invalid_captcha",Z.LINKED_TO_ANOTHER_USER="linked_to_another_user",Z.ALLOWLIST_REJECTED="allowlist_rejected",Z.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",Z.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",Z.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",Z.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",Z.TOO_MANY_REQUESTS="too_many_requests",Z.RESOURCE_CONFLICT="resource_conflict",Z.INVALID_ORIGIN="invalid_origin",Z.MISSING_ORIGIN="missing_origin",Z.INVALID_NATIVE_APP_ID="invalid_native_app_id",Z.TOKEN_ALREADY_USED="token_already_used",Z.ALREADY_LOGGED_OUT="already_logged_out",Z.NOT_SUPPORTED="not_supported",Z.USER_UNSUBSCRIBED="user_unsubscribed",Z.MAX_APPS_REACHED="max_apps_reached",Z.USER_LIMIT_REACHED="max_accounts_reached",Z.DEVICE_REVOKED="device_revoked",Z.WALLET_PASSWORD_EXISTS="wallet_password_exists",Z.OAUTH_STATE_MISMATCH="oauth_state_mismatch",Z.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",Z.MAX_TEST_ACCOUNTS_REACHED="max_test_accounts_reached",Z.DISALLOWED_LOGIN_METHOD="disallowed_login_method",Z.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",Z.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",Z.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",Z.CANNOT_SET_PASSWORD="cannot_set_password",Z.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",Z.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",Z.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",Z.USER_DOES_NOT_EXIST="user_does_not_exist",Z.ALREADY_EXISTS="resource_already_exists",Z.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",Z.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",Z.FEATURE_NOT_ENABLED="feature_not_enabled",Z.INSUFFICIENT_FUNDS="insufficient_funds",Z.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",Z.TRANSACTION_EXECUTION_FAILURE="transaction_execution_failure",Z.INVALID_POLICY_FORMAT="invalid_policy_format",Z.POLICY_VIOLATION="policy_violation",Z.AUTHORIZATION_KEY_HAS_ASSOCIATED_WALLETS="authorization_key_has_associated_wallets",Z.INVALID_REQUEST="invalid_request",Z.SIGNUP_DISABLED="signup_disabled",Z);const $={path:"/api/v1/apps/:app_id",method:"GET"},ee={path:"/api/v1/analytics_events",method:"POST"},te={path:"/api/v1/sessions",method:"POST"},ne={path:"/api/v1/sessions/logout",method:"POST"};var re,ie=n(7488),se=n(82425);const oe=null!==(re=Promise.allSettled.bind(Promise))&&void 0!==re?re:e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))));let ae="privy:token",ce="privy-token",le="privy:pat",ue="privy:refresh_token",de="privy-refresh-token",he="privy:id-token",pe="privy-id-token",fe="privy-session";class ge extends C.A{set isUsingServerCookies(e){this._isUsingServerCookies=e}async getCustomerAccessToken(){let e=await this._storage.get(ae);try{return"string"==typeof e?new l(e).value:null}catch(e){return console.error(e),await this.destroyLocalState({reason:"getToken_error"}),null}}async getPrivyAccessToken(){let e=await this._storage.get(le);try{return"string"==typeof e?new l(e).value:null}catch(e){return console.error(e),await this.destroyLocalState({reason:"getToken_error"}),null}}async getRefreshToken(){let e=await this._storage.get(ue);return"string"==typeof e?e:null}async getIdentityToken(){let e=await this._storage.get(he);return"string"==typeof e?e:null}get mightHaveServerCookies(){try{let e=se.A.get(fe);return void 0!==e&&e.length>0}catch(x){console.error(x)}return!1}hasRefreshCredentials(e,t){return this.mightHaveServerCookies||"string"==typeof e&&"string"==typeof t}tokenIsActive(e){if(!e)return!1;let t=l.parse(e);return null!==t&&!t.isExpired(30)}async destroyLocalState(e){await oe([this._storage.del(ae),this._storage.del(ue),this._storage.del(he),this._storage.del(this.GUEST_CREDENTIAL_STORAGE_KEY)]),se.A.remove(ce),se.A.remove(de),se.A.remove(pe),se.A.remove(fe),(null===e||void 0===e?void 0:e.reason)&&this.emit
2("storage_cleared",{reason:e.reason})}async storeCustomerAccessToken(e){if("string"==typeof e){let n=await this._storage.get(ae);if(await this._storage.put(ae,e),!this._isUsingServerCookies){var t;let n=null===(t=l.parse(e))||void 0===t?void 0:t.expiration;se.A.set(ce,e,{sameSite:"Strict",secure:!0,expires:n?new Date(1e3*n):void 0})}n!==e&&this.emit("token_stored",{cookiesEnabled:this._isUsingServerCookies})}else{let e=await this._storage.get(ae);await this._storage.del(ae),se.A.remove(ce),null!==e&&this.emit("token_cleared",{reason:"set_with_non_string_value"})}}async storePrivyAccessToken(e){"string"==typeof e?await this._storage.put(le,e):await this._storage.del(le)}async storeRefreshToken(e){"string"==typeof e?(await this._storage.put(ue,e),this._isUsingServerCookies||(se.A.set(fe,"t",{sameSite:"Strict",secure:!0,expires:30}),se.A.set(de,e,{sameSite:"Strict",secure:!0,expires:30})),this.emit("refresh_token_stored",{cookiesEnabled:this._isUsingServerCookies})):(await this._storage.del(ue),se.A.remove(de),se.A.remove(fe),this.emit("refresh_token_cleared",{reason:"set_with_non_string_value"}))}async updateWithTokensResponse(e){let t=(await oe([this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token),this.storeRefreshToken(e.refresh_token),this.storeIdentityToken(e.identity_token),this.processOAuthTokens(e.oauth_tokens)])).filter(e=>"rejected"===e.status);t.length>0&&this.emit("error_storing_tokens",t.map(e=>String(e.reason)).join(", "))}async processOAuthTokens(e){e&&this.emit("oauth_tokens_granted",e)}async storeIdentityToken(e){if("string"==typeof e){let n=await this._storage.get(he);if(await this._storage.put(he,e),!this._isUsingServerCookies){var t;let n=null===(t=l.parse(e))||void 0===t?void 0:t.expiration;se.A.set(pe,e,{sameSite:"Strict",secure:!0,expires:n?new Date(1e3*n):void 0})}n!==e&&this.emit("identity_token_stored",{cookiesEnabled:this._isUsingServerCookies})}else{let e=await this._storage.get(he);await this._storage.del(he),se.A.remove(pe),null!==e&&this.emit("identity_token_cleared",{reason:"set_with_non_string_value"})}}async getOrCreateGuestCredential(){let e=this._storage.get(this.GUEST_CREDENTIAL_STORAGE_KEY);if(e&&"string"==typeof e)return e;let t=ie.l(crypto.getRandomValues(new Uint8Array(32)));return await this._storage.put(this.GUEST_CREDENTIAL_STORAGE_KEY,t),t}constructor(e){super(),this._isUsingServerCookies=!1,this._storage=e.storage,this.GUEST_CREDENTIAL_STORAGE_KEY="privy:guest:".concat(e.appId)}}ge.events=["storage_cleared","token_cleared","refresh_token_cleared","identity_token_cleared","token_stored","refresh_token_stored","identity_token_stored","oauth_tokens_granted","error_storing_tokens"];var me=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};const ye=()=>{};let ve={NONE:Number.NEGATIVE_INFINITY,ERROR:1,WARN:2,INFO:3,DEBUG:Number.POSITIVE_INFINITY};let we="privy:caid";class be{setCallbacks(e){this.callbacks=(0,r.A)((0,r.A)({},this.callbacks),e)}get isReady(){return!!this._config}get config(){return this._config}get caid(){return this._analyticsId}async _initialize(){var e,t;if(this.isReady)null===(e=this.callbacks)||void 0===e||null===(t=e.setIsReady)||void 0===t||t.call(e,!0);else{var n,r,i;if(!await this.isStorageAccessible())throw new g.wE({code:"storage_error",error:"Unable to access storage"});this._config=await this.getAppConfig(),null!==(n=this._config)&&void 0!==n&&n.custom_api_url&&(this.baseUrl=this._config.custom_api_url,this.session.isUsingServerCookies=!0),null!==(r=this.callbacks)&&void 0!==r&&null!==(i=r.setIsReady)&&void 0!==i&&i.call(r,!0),this._sdkVersion.startsWith("react-auth:")||this.createAnalyticsEvent("sdk_initialize",{})}}getPath(e,t){let{params:n,query:r}=t;return"".concat(this.baseUrl).concat(((e,t)=>t?Object.entries(t).reduce((e,t)=>{let[n,r]=t;return e.replace(":".concat(n),"".concat(r))},e):e)(e.path,n)).concat(function(e){let t=new URLSearchParams;for(let n in e)null!=e[n]&&t.append(n,String(e[n]));return Array.from(t).length?"?"+t.toString():""}(r))}async fetch(e,t){let{body:n,params:r,query:i,headers:s,onRequest:o=this._beforeRequest.bind(this)}
2=t,a=new Request(this.getPath(e,{params:r,query:i}),{method:e.method,body:JSON.stringify(n),headers:s}),c=await o(a),l=await this._fetch(a,c),u=await l.json();if(l.status>299)throw new g.VQ(u);return u}async _beforeRequestWithoutInitialize(e){var t;let n=null!==(t=await this.session.getPrivyAccessToken())&&void 0!==t?t:await this.session.getCustomerAccessToken(),r=new Headers(e.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-client",this._sdkVersion),n&&r.set("Authorization","Bearer ".concat(n)),r.set("Content-Type","application/json"),r.set("Accept","application/json");let i=await this._getOrGenerateClientAnalyticsId();return i&&r.set("privy-ca-id",i),this.nativeAppIdentifier&&r.set("x-native-app-identifier",this.nativeAppIdentifier),{signal:me(2e4),headers:r,credentials:"include"}}async beforeRequestWithoutRefresh(e){return await this._initialize(),this._beforeRequestWithoutInitialize(e)}async _beforeRequest(e){return await this._initialize(),await this.getAccessTokenInternal(),this.beforeRequestWithoutRefresh(e)}async getAppConfig(){return await this.fetch($,{params:{app_id:this.appId},onRequest:this._beforeRequestWithoutInitialize.bind(this)})}async _getOrGenerateClientAnalyticsId(){if(this._analyticsId)return this._analyticsId;try{let e=await this._storage.get(we);if("string"==typeof e&&e.length>0)return this._analyticsId=e,e}catch(x){this.logger.error("Unable to load clientId",x)}try{this._analyticsId=(0,Y.A)()}catch(x){this.logger.error("Unable to generate uuidv4",x)}if(this._analyticsId){try{await this._storage.put(we,this._analyticsId)}catch(x){this.logger.error("Unable to store clientId: ".concat(this._analyticsId),x)}return this._analyticsId}}async destroyClientAnalyticsId(){try{return await this._storage.del(we)}catch(x){this.logger.error("Unable to delete clientId",x)}}async createAnalyticsEvent(e,t){try{await this.fetch(ee,{body:{event_name:e,client_id:await this._getOrGenerateClientAnalyticsId(),payload:t},onRequest:this.beforeRequestWithoutRefresh.bind(this)})}catch(e){}}async refreshSession(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!await this.isStorageAccessible())throw new g.wE({code:"storage_error",error:"Unable to access storage"});let n=null!==(e=await this.session.getRefreshToken())&&void 0!==e?e:void 0,r=null!==n&&void 0!==n?n:"key",i=this._cache.get(r);if(i)return this.logger.debug("[privy:refresh] found in-flight session refresh request, deduping"),await i;let s=this._refreshSession(n,t);this._cache.set(r,s);try{return await s}finally{this._cache.delete(r)}}async _refreshSession(e,t){let n=await this.session.getCustomerAccessToken();if(!this.session.hasRefreshCredentials(n,null!==e&&void 0!==e?e:null))throw this.logger.debug("[privy:refresh] missing tokens, skipping request"),await this._initialize(),new g.VQ({code:X.MISSING_OR_INVALID_TOKEN,error:"No tokens found in storage"});try{var r,i,s,o;this.logger.debug("[privy:refresh] fetching: ".concat(te.path));let n=await this.fetch(te,{body:{refresh_token:e},onRequest:this.beforeRequestWithoutRefresh.bind(this)}),a=n.session_update_action;return this.logger.debug("[privy:refresh] response: ".concat(a)),t||null!==(r=this.callbacks)&&void 0!==r&&null!==(i=r.setUser)&&void 0!==i&&i.call(r,n.user),"set"===a&&(await this.session.updateWithTokensResponse(n),this.logger.debug("[privy:refresh] tokens stored")),"clear"===a&&(await this.session.destroyLocalState(),this.logger.debug("[privy:refresh] tokens cleared"),t||null!==(s=this.callbacks)&&void 0!==s&&null!==(o=s.setUser)&&void 0!==o&&o.call(s,null)),"ignore"===a&&n.token&&(await this.session.storeCustomerAccessToken(n.token),await this.session.storePrivyAccessToken(n.privy_access_token),this.logger.debug("[privy:refresh] access token stored"),n.identity_token&&(this.logger.debug("[privy:refresh] identity token stored"),await this.session.storeIdentityToken(n.identity_token))),this.logger.debug("[privy:refresh] returning response"),n}catch(e){var a,c,l;throw this.logger.debug("[privy:refresh] error: ".concat(null!==(a=e.message)&&void 0!==a?a:"unknown error")),e instanceof g.VQ&&e.code===X.MISSING_OR_INVALID_TOKEN&&(await this.session.destroyLocalState(),t||null!==(c=this.callbacks)&&void 0!==c&&null!==(l=c.setUser)&&void 0!==l&&l.call(c,null)),e}}
2async getAccessToken(){let[e,t]=await Promise.all([this.session.getCustomerAccessToken(),this.session.getRefreshToken()]);if(!this.session.tokenIsActive(e)&&this.session.hasRefreshCredentials(e,t)){var n;let t=await this.refreshSession(),r=await this.session.getCustomerAccessToken();return t.token||this.logger.debug("[privy:getAccessToken] expected token received null"),t.token===e&&this.logger.debug("[privy:getAccessToken] expected new token in response received existing"),r===e&&this.logger.debug("[privy:getAccessToken] expected new token in storage received existing"),null!==(n=t.token)&&void 0!==n?n:r}return e}async getAccessTokenInternal(){var e;let t=await this.getAccessToken();return null!==(e=await this.session.getPrivyAccessToken())&&void 0!==e?e:t}async getIdentityToken(){return await this.session.getIdentityToken()}async isStorageAccessible(){try{let e="privy:__storage__test-".concat((0,Y.A)()),t="blobby";await this._storage.put(e,t);let n=await this._storage.get(e);return await this._storage.del(e),n===t}catch(x){return this.logger.error(x),!1}}constructor(e){var t,n,r;this._sdkVersion="js-sdk-core:0.58.2",this._cache=new Map,this.logger=function(){let{level:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{level:"ERROR"};return{get level(){return e},error:ve[e]>=ve.ERROR?console.error:ye,warn:ve[e]>=ve.WARN?console.warn:ye,info:ve[e]>=ve.INFO?console.info:ye,debug:ve[e]>=ve.DEBUG?console.debug:ye}}({level:null!==(t=e.logLevel)&&void 0!==t?t:"ERROR"}),this._storage=e.storage,this._analyticsId=null,this._getOrGenerateClientAnalyticsId(),this.baseUrl=null!==(n=e.baseUrl)&&void 0!==n?n:"https://auth.privy.io",this.appId=e.appId,this.appClientId=e.appClientId,this._sdkVersion=null!==(r=e.sdkVersion)&&void 0!==r?r:this._sdkVersion,this.callbacks=e.callbacks,this.nativeAppIdentifier=e.nativeAppIdentifier,this.session=new ge({storage:this._storage,isUsingServerCookies:!1,appId:e.appId}),this._fetch=Q(globalThis.fetch,{retries:3,retryDelay:e=>3**e*500,retryOn:[408,409,425,500,502,503,504]}),this.session.on("error_storing_tokens",e=>{this.createAnalyticsEvent("error_updating_tokens_in_storage",{reason:e})})}}const Ae={path:"/api/v1/users/me/accept_terms",method:"POST"};class _e{async get(){let{user:e}=await this._privyInternal.refreshSession();return{user:e}}async acceptTerms(){return{user:await this._privyInternal.fetch(Ae,{})}}constructor(e){this._privyInternal=e}}const xe={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"},Ee=e=>"wallet"===e.type&&"privy"===e.wallet_client_type&&"embedded"===e.connector_type,ke=e=>e?e.linked_accounts.filter(Ee).filter(e=>"ethereum"===e.chain_type).sort((e,t)=>e.wallet_index-t.wallet_index):[],Se=e=>{var t;return null!==(t=ke(e).find(e=>0===e.wallet_index))&&void 0!==t?t:null},Ie=e=>e?e.linked_accounts.filter(Ee).filter(e=>"solana"===e.chain_type).sort((e,t)=>e.wallet_index-t.wallet_index):[],Te=e=>{var t;return null!==(t=Ie(e).find(e=>0===e.wallet_index))&&void 0!==t?t:null},Ce=async(e,t,n)=>{var i,s,o,a,c,l;let u=((e,t)=>!("off"===t||ke(e).length>0||e.linked_accounts.filter(e=>"wallet"===e.type&&"ethereum"===e.chain_type).length>0&&"all-users"!==t))(t.user,null!==(i=null===n||void 0===n||null===(s=n.ethereum)||void 0===s?void 0:s.createOnLogin)&&void 0!==i?i:"off"),d=((e,t)=>!("off"===t||Ie(e).length>0||e.linked_accounts.filter(e=>"wallet"===e.type&&"solana"===e.chain_type).length>0&&"all-users"!==t))(t.user,null!==(o=null===n||void 0===n||null===(a=n.solana)||void 0===a?void 0:a.createOnLogin)&&void 0!==o?o:"off");if(u&&d){var h;let n=await e.create({recoveryMethod:"privy",skipCallbacks:!0});return(0,r.A)((0,r.A)({},await e.createSolana({ethereumAccount:null!==(h=Se(n.user))&&void 0!==h?h:void 0})),{},{is_new_user:t.is_new_user,oauth_tokens:t.oauth_tokens})}return u?(0,r.A)((0,r.A)({},await e.create({recoveryMethod:"privy",solanaAccount:null!==(c=Te(t.user))&&void 0!==c?c:void 0})),{},{is_new_user:t.is_new_user,oauth_tokens:t.oauth_tokens}):d?(0,r.A)((0,r.A)({},await e.createSolana({ethereumAccount:null!==(l=Se(t.user))&&void 0!==l?l:void 0})),{},{is_new_user:t.is_new_user,oauth_tokens:t.oauth_tokens}):t};class Pe{async syncWithToken(e,t,n){var r,i;let s=await this._privyInternal.fetch(xe,{body:{token:e,mode:n}});await this._privyInternal.session.updateWithTokensResponse(s);let o=await Ce(this._embedded,s,null===t||void 0===t?void 0:t.embedded);return null!==(r=this._privyInternal.callbacks)&&void 0!==r&&null!==(i=r.setUser)&&void 0!==i&&i.call(r,o.user),o}constructor(e,t){this._privyInternal=e,this._embedded=t}}const Oe={path:"/api/v1/passwordless/authenticate",method:"POST"},Ne={path:"/api/v1/passwordless/init",method:"POST"},Re={path:"/api/v1/passwordless/link",method:"POST"},Me={path:"/api/v1/passwordless/unlink",method:"POST"},Ue={path:"/api/v1/passwordless/update",method:"POST"};class Le{async sendCode(e,t){return this._privyInternal.fetch(Ne,{body:{email:e,token:t}})}async loginWithCode(e,t,n,r){var i,s;let o=await this._privyInternal.fetch(Oe,{body:{email:e,code:t,mode:n}});await this._privyInternal.session.updateWithTokensResponse(o);let a=await Ce(this._embedded,o,null===r||void 0===r?void 0:r.embedded);return null!==(i=this._privyInternal.callbacks)&&void 0!==i&&null!==(s=i.setUser)&&void 0!==s&&s.call(i,a.user),a}async linkWithCode(e,t){await this._privyInternal.fetch(Re,{body:{email:e,code:t}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}async updateEmail(e){let{oldEmailAddress:t,newEmailAddress:n,code:r}=e;await this._privyInternal.fetch(Ue,{body:{oldAddress:t,newAddress:n,code:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink(e){await this._privyInternal.fetch(Me,{body:{address:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}constructor(e,t){this._privyInternal=e,this._embedded=t}}const Be={path:"/api/v1/farcaster/init",method:"POST"},De={path:"/api/v1/farcaster/authenticate",method:"POST"},je={path:"/api/v1/farcaster/link",method:"POST"},Fe={path:"/api/v1/farcaster/unlink",method:"POST"},ze={path:"/api/v1/farcaster/status",method:"GET"},We={path:"/api/v2/farcaster/init",method:"POST"},qe={path:"/api/v2/farcaster/authenticate",method:"POST"};class He{async initializeAuth(e){let{relyingParty:t,redirectUrl:n,token:r}=e;return await this._privyInternal.fetch(Be,{body:{relying_party:t,redirect_url:n,token:r}})}async getFarcasterStatus(e){let{channel_token:t}=e;return await this._privyInternal.fetch(ze,{headers:{"farcaster-channel-token":t}})}async authenticate(e,t){var n,r;let{channel_token:i,message:s,signature:o,fid:a,mode:c}=e,l=await this._privyInternal.fetch(De,{body:{channel_token:i,message:s,signature:o,fid:a,mode:c}});await this._privyInternal.session.updateWithTokensResponse(l);let u=await Ce(this._embedded,l,null===t||void 0===t?void 0:t.embedded);return null!==(n=this._privyInternal.callbacks)&&void 0!==n&&null!==(r=n.setUser)&&void 0!==r&&r.call(n,u.user),u}async link(e){let{channel_token:t,message:n,signature:r,fid:i}=e;await this._privyInternal.fetch(je,{body:{channel_token:t,message:n,signature:r,fid:i}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async unlink(e){let{fid:t}=e;
2await this._privyInternal.fetch(Fe,{body:{fid:t}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}constructor(e,t){this._privyInternal=e,this._embedded=t}}class Ve{async initializeAuth(){return await this._privyInternal.fetch(We,{body:{}})}async authenticate(e,t){var n,r;let{message:i,signature:s,fid:o}=e,a=await this._privyInternal.fetch(qe,{body:{message:i,signature:s,fid:o}});await this._privyInternal.session.updateWithTokensResponse(a);let c=await Ce(this._embedded,a,null===t||void 0===t?void 0:t.embedded);return null!==(n=this._privyInternal.callbacks)&&void 0!==n&&null!==(r=n.setUser)&&void 0!==r&&r.call(n,c.user),c}constructor(e,t){this._privyInternal=e,this._embedded=t}}const Ge={path:"/api/v1/guest/authenticate",method:"POST"};class Ke{async create(e){var t,n;let r=await this._privyInternal.session.getOrCreateGuestCredential(),i=await this._privyInternal.fetch(Ge,{body:{guest_credential:r}});await this._privyInternal.session.updateWithTokensResponse(i);let s=await Ce(this._embedded,i,null===e||void 0===e?void 0:e.embedded);return null!==(t=this._privyInternal.callbacks)&&void 0!==t&&null!==(n=t.setUser)&&void 0!==n&&n.call(t,s.user),s}constructor(e,t){this._privyInternal=e,this._embedded=t}}const Je={path:"/api/v1/oauth/authenticate",method:"POST"},Ze={path:"/api/v1/oauth/init",method:"POST"},Qe={path:"/api/v1/oauth/link",method:"POST"},Ye={path:"/api/v1/oauth/unlink",method:"POST"},Xe="privy:state_code",$e="privy:code_verifier";function et(){return ie.l(function(e){return crypto.getRandomValues(new Uint8Array(e))}(36))}function tt(){return et()}
2async function nt(e){let{codeVerifier:t,method:n="S256",digest:r=crypto.subtle.digest.bind(crypto.subtle)}=e;if("S256"!=n)return t;{let e=await async function(e,t){let n=(new TextEncoder).encode(e);return new Uint8Array(await t("SHA-256",n))}(t,r);return ie.l(e)}}class rt{async generateURL(e,t){var n;let r=et(),i=tt(),s=await nt({codeVerifier:r,digest:null===(n=this._crypto)||void 0===n?void 0:n.digest});return await Promise.all([this._storage.put($e,r),this._storage.put(Xe,i)]),this._privyInternal.fetch(Ze,{body:{redirect_to:t,provider:e,code_challenge:s,state_code:i}})}async loginWithCode(e,t,n,r,i,s){var o,a;let[c,l]=await Promise.all([this._storage.get($e),this._storage.get(Xe)]);if(l!==t)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"oauth",provider:n,storedStateCode:null!==l&&void 0!==l?l:"",returnedStateCode:null!==t&&void 0!==t?t:""}),new g.wE({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let u=await this._privyInternal.fetch(Je,{body:{authorization_code:e,code_type:r,state_code:l,code_verifier:c,mode:i}});await this._privyInternal.session.updateWithTokensResponse(u);let d=await Ce(this._embedded,u,null===s||void 0===s?void 0:s.embedded);return await Promise.all([this._storage.del($e),this._storage.del(Xe)]),null!==(o=this._privyInternal.callbacks)&&void 0!==o&&null!==(a=o.setUser)&&void 0!==a&&a.call(o,d.user),d}async linkWithCode(e,t,n,r){let[i,s]=await Promise.all([this._storage.get($e),this._storage.get(Xe)]);if(s!==t)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"oauth",provider:n,storedStateCode:null!==s&&void 0!==s?s:"",returnedStateCode:null!==t&&void 0!==t?t:""}),new g.wE({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let o=await this._privyInternal.fetch(Qe,{body:{authorization_code:e,code_type:r,state_code:s,code_verifier:i}});await this._privyInternal.session.processOAuthTokens(o.oauth_tokens);let a=await this._privyInternal.refreshSession();return await Promise.all([this._storage.del($e),this._storage.del(Xe)]),{user:a.user,identity_token:a.identity_token}}async unlink(e,t){await this._privyInternal.fetch(Ye,{body:{provider:e,subject:t}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}constructor(e,t,n,r){this._privyInternal=e,this._embedded=t,this._storage=n,this._crypto=r}}const it={path:"/api/v1/passkeys/link",method:"POST"},st={path:"/api/v1/passkeys/authenticate",method:"POST"},ot={path:"/api/v1/passkeys/register",method:"POST"},at={path:"/api/v1/passkeys/authenticate/init",method:"POST"},ct={path:"/api/v1/passkeys/register/init",method:"POST"},lt={path:"/api/v1/passkeys/link/init",method:"POST"};class ut{async generateRegistrationOptions(e){return await this._privyInternal.fetch(lt,{body:{relying_party:e}})}async generateAuthenticationOptions(e){return await this._privyInternal.fetch(at,{body:{relying_party:e}})}async generateSignupOptions(e){return await this._privyInternal.fetch(ct,{body:{relying_party:e}})}async loginWithPasskey(e,t,n,r){var i,s;let o=await this._privyInternal.fetch(st,{body:{relying_party:n,challenge:t,authenticator_response:this._transformAuthenticationResponseToSnakeCase(e)}});await this._privyInternal.session.updateWithTokensResponse(o);let a=await Ce(this._embedded,o,null===r||void 0===r?void 0:r.embedded);return null!==(i=this._privyInternal.callbacks)&&void 0!==i&&null!==(s=i.setUser)&&void 0!==s&&s.call(i,a.user),a}async signupWithPasskey(e,t,n){var r,i;let s=await this._privyInternal.fetch(ot,{body:{relying_party:t,authenticator_response:this._transformRegistrationResponseToSnakeCase(e)}});await this._privyInternal.session.updateWithTokensResponse(s);let o=await Ce(this._embedded,s,null===n||void 0===n?void 0:n.embedded);return null!==(r=this._privyInternal.callbacks)&&void 0!==r&&null!==(i=r.setUser)&&void 0!==i&&i.call(r,o.user),o}async linkWithPasskey(e,t){await this._privyInternal.fetch(it,{body:{relying_party:t,authenticator_response:this._transformRegistrationResponseToSnakeCase(e)}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}_transformRegistrationResponseToSnakeCase(e){return{type:e.type,id:e.id,raw_i
2d:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData||void 0,transports:e.response.transports||void 0,public_key:e.response.publicKey||void 0,public_key_algorithm:e.response.publicKeyAlgorithm||void 0},authenticator_attachment:e.authenticatorAttachment||void 0,client_extension_results:{app_id:e.clientExtensionResults.appid||void 0,cred_props:e.clientExtensionResults.credProps||void 0,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret||void 0}}}_transformAuthenticationResponseToSnakeCase(e){return{type:e.type,id:e.id,raw_id:e.rawId,response:{signature:e.response.signature,client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,user_handle:e.response.userHandle||void 0},authenticator_attachment:e.authenticatorAttachment||void 0,client_extension_results:{app_id:e.clientExtensionResults.appid||void 0,cred_props:e.clientExtensionResults.credProps||void 0,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret||void 0}}}constructor(e,t){this._privyInternal=e,this._embedded=t}}const dt={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},ht={path:"/api/v1/passwordless_sms/init",method:"POST"},pt={path:"/api/v1/passwordless_sms/link",method:"POST"},ft={path:"/api/v1/passwordless_sms/unlink",method:"POST"},gt={path:"/api/v1/passwordless_sms/update",method:"POST"};class mt{async sendCode(e,t){return this._privyInternal.fetch(ht,{body:{phoneNumber:e,token:t}})}async loginWithCode(e,t,n,r){var i,s;let o=await this._privyInternal.fetch(dt,{body:{phoneNumber:e,code:t,mode:n}});await this._privyInternal.session.updateWithTokensResponse(o);let a=await Ce(this._embedded,o,null===r||void 0===r?void 0:r.embedded);return null!==(i=this._privyInternal.callbacks)&&void 0!==i&&null!==(s=i.setUser)&&void 0!==s&&s.call(i,a.user),a}async linkWithCode(e,t){await this._privyInternal.fetch(pt,{body:{phoneNumber:e,code:t}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}async updatePhone(e){let{oldPhoneNumber:t,newPhoneNumber:n,code:r}=e;await this._privyInternal.fetch(gt,{body:{old_phone_number:t,new_phone_number:n,code:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async unlink(e){await this._privyInternal.fetch(ft,{body:{phoneNumber:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}constructor(e,t){this._privyInternal=e,this._embedded=t}}const yt={path:"/api/v1/siwe/init",method:"POST"},vt={path:"/api/v1/siwe/authenticate",method:"POST"},wt={path:"/api/v1/siwe/link",method:"POST"},bt={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},At={path:"/api/v1/siwe/unlink",method:"POST"};class _t{async unlinkWallet(e){await this._privyInternal.fetch(At,{body:{address:e}});let t=await this._privyInternal.refreshSession();return{user:t.user,identity_token:t.identity_token}}async linkWithSiwe(e,t,n){var r,i;let s=t||this._wallet,o=n||this._preparedMessage;if(!s)throw Error("A wallet must be provided in the init step or as an argument to linkWithSiwe");if(!o)throw Error("A message must be generated and signed before being used to link a wallet to privy");await this._privyInternal.fetch(wt,{body:{message:o,signature:e,chainId:s.chainId,walletClientType:null!==(r=s.walletClientType)&&void 0!==r?r:null,connectorType:null!==(i=s.connectorType)&&void 0!==i?i:null}});let a=await this._privyInternal.refreshSession();return{user:a.user,identity_token:a.identity_token}}async loginWithSiwe(e,t,n,r,i){var s,o,a,c;let l=t||this._wallet,u=n||this._preparedMessage;if(!l)throw Error("A wallet must be provided in the init step or as an argument to loginWithSiwe");if(!u)throw Error("A message must be generated and signed before being used to login to privy with a wallet");let d=await this._privyInternal.fetch(vt,{body:{signature:e,message:u,chainId:l.chainId,walletClientType:null!==(s=l.walletClientType)&&void 0!==s?s:null,connectorType:null!==(o=l.connectorType)&&void 0!==o?o:null,mode:r}});await this._privyInternal.session.updateWithTokensResponse(d);let h=await Ce(this._embedded,d,null===i||void 0===i?void 0:i.embedded);return null!==(a=this._privyInternal.callbacks)&&void 0!==a&&null!==(c=a.setUser)&&void 0!==c&&c.call(a,h.user),h}async init(e,t,n){var r;this._wallet=e;let{nonce:i}=await this._privyInternal.fetch(yt,{body:{address:e.address}}),s="".concat((r={chainId:e.chainId.toString().replace("eip155:",""),address:e.address,issuedAt:(new Date).toISOString(),statement:"By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",domain:t,nonce:i,uri:n}).domain," wants you to sign in with your Ethereum account:\n").concat(r.address,"\n\n").concat(r.statement,"\n\nURI: ").concat(r.uri,"\nVersion: 1\nChain ID: ").concat(r.chainId,"\nNonce: ").concat(r.nonce,"\nIssued At: ").concat(r.issuedAt,"\nResources:\n- https://privy.io");return this._preparedMessage=s,{nonce:i,message:s}}constructor(e,t){this._wallet=void 0,this._privyInternal=e,this._embedded=t}}const xt={path:"/api/v1/siws/init",method:"POST"},Et={path:"/api/v1/siws/authenticate",method:"POST"},kt={path:"/api/v1/siws/link",method:"POST"},St={path:"/api/v1/siws/unlink",method:"POST"};class It{async unlink(e){let{address:t}=e;await this._privyInternal.fetch(St,{body:{address:t}});let n=await this._privyInternal.refreshSession();return{user:n.user,identity_token:n.identity_token}}async link(e){let{message:t,signature:n,walletClientType:r,connectorType:i}=e;await this._privyInternal.fetch(kt,{body:{message:t,signature:n,walletClientType:null!==r&&void 0!==r?r:null,connectorType:null!==i&&void 0!==i?i:null}});let s=await this._privyInternal.refreshSession();return{user:s.user,identity_token:s.identity_token}}async login(e){var t,n;let{mode:r,message:i,signature:s,walletClientType:o,connectorType:a,opts:c}=e,l=await this._privyInternal.fetch(Et,{body:{signature:s,message:i,walletClientType:null!==o&&void 0!==o?o:null,connectorType:null!==a&&void 0!==a?a:null,mode:r}});await this._privyInternal.session.updateWithTokensResponse(l);let u=await Ce(this._embedded,l,null===c||void 0===c?void 0:c.embedded);return null!==(t=this._privyInternal.callbacks)&&void 0!==t&&null!==(n=t.setUser)&&void 0!==n&&n.call(t,u.user),u}async fetchNonce(e){let{address:t}=e,{nonce:n}=await this._privyInternal.fetch(xt,{body:{address:t}});return{nonce:n}}constructor(e,t){this._privyInternal=e,this._embedded=t}}class Tt{async link(e,t,n,r){await this._privyInternal.fetch(bt,{body:{message:e,signature:t,smart_wallet_type:n,smart_wallet_version:r}});let i=await this._privyInternal.refreshSession();return{user:i.user,identity_token:i.identity_token}}async init(e){var t;let{nonce:n}=await this._privyInternal.fetch(yt,{body:{address:e.address}});return{nonce:n,message:"".concat((t={chainId:e.chainId.toString().replace("eip155:",""),address:e.address,issuedAt:(new Date).toISOString(),statement:"By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",domain:"privy.io",uri:"https://auth.privy.io",nonce:n}).domain," wants you to sign in with your Ethereum account:\n").concat(t.address,"\n\n").concat(t.statement,"\n\nURI: ").concat(t.uri,"\nVersion: 1\nChain ID: ").concat(t.chainId,"\nNonce: ").concat(t.nonce,"\nIssued At: ").concat(t.issuedAt,"\nResources:\n- https://privy.io")}}constructor(e){this._privyInternal=e}}class Ct{async logout(e){var t,n;try{var r;let e=null!==(r=await this._privyInternal.session.getRefreshToken())&&void 0!==r?r:void 0;await this._privyInternal.fetch(ne,{body:{refresh_token:e}})}catch(u){console.warn("Error destroying session")}await Promise.all([this._privyInternal.session.destroyLocalState({reason:"logout"}),this._privyInternal.destroyClientAnalyticsId(),(null===e||void 0===e?void 0:e.userId)&&this._mfa.clearMfa({userId:e.userId})]),null===(t=this._privyInternal.callbacks)||void 0===t||null===(n=t.setUser)||void 0===n||n.call(t,null)}constructor(e,t,n,r,i){this._privyInternal=e,this._mfa=i,this.customProvider=new Pe(this._privyInternal,t),this.phone=new mt(this._privyInternal,t),this.email=new Le(this._privyInternal,t),this.oauth=new rt(this._privyInternal,t,n,r),this.guest=new Ke(this._privyInternal,t),this.siwe=new _t(this._privyInternal,t),this.siws=new It(this._privyInternal,t),this.smartWallet=new Tt(this._privyInternal),this.passkey=new ut(this._privyInternal,t),this.farcaster=new He(this._privyInternal,t),this.farcasterV2=new Ve(this._privyInternal,t)}}const Pt={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},Ot={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"};
2class Nt{async initOnRampSession(e){return await this._privyInternal.fetch(Pt,{body:e})}async getStatus(e){return await this._privyInternal.fetch(Ot,{query:{partnerUserId:e}})}constructor(e){this._privyInternal=e}}const Rt={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"};var Mt=n(69886);class Ut{async sign(e){return await this._privyInternal.fetch(Rt,{body:e})}async getTransactionStatus(e){let{transactionId:t,useSandbox:n}=e,{url:r,key:i}=Mt.IX[n?"sandbox":"prod"],s=await Q(fetch,{retries:3,retryDelay:500})("".concat(r,"/transactions/ext/").concat(t,"?apiKey=").concat(i));if(!s.ok)throw new g.gn({error:"Failed to fetch transaction status for Transaction ".concat(t),code:"failed_to_fetch_moonpay_transaction_status",response:s});let o=await s.json();return Array.isArray(o)?o.at(0):void 0}constructor(e){this._privyInternal=e}}class Lt{constructor(e){this.moonpay=new Ut(e),this.coinbase=new Nt(e)}}const Bt={path:"/api/v1/mfa/passkeys/init",method:"POST"};class Dt{async generateAuthenticationOptions(e){return await this._privyInternal.fetch(Bt,{body:e})}constructor(e){this._privyInternal=e}}const jt={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"};class Ft{async sendCode(e){return await this._privyInternal.fetch(jt,{body:e})}constructor(e){this._privyInternal=e}}class zt{setProxy(e){this.proxy=e}async getAccessTokenInternal(){let e=await this.privyInternal.getAccessTokenInternal();if(!e)throw new g.wE({error:"Missing access token",code:"attempted_rpc_call_before_logged_in"});return e}async verifyMfa(){if(!this.proxy)throw new g.wE({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.verifyMfa({accessToken:await this.getAccessTokenInternal()})}async initEnrollMfa(e){if(!this.proxy)throw new g.wE({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.initEnrollMfa((0,r.A)((0,r.A)({},e),{},{accessToken:await this.getAccessTokenInternal()}))}async submitEnrollMfa(e){if(!this.proxy)throw new g.wE({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});let t=await this.proxy.submitEnrollMfa((0,r.A)((0,r.A)({},e),{},{accessToken:await this.getAccessTokenInternal()}));return await this.privyInternal.refreshSession(),t}async unenrollMfa(e){if(!this.proxy)throw new g.wE({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});let t=await this.proxy.unenrollMfa({method:e,accessToken:await this.getAccessTokenInternal()});return await this.privyInternal.refreshSession(),t}async clearMfa(e){if(!this.proxy)throw new g.wE({error:"Embedded wallet proxy not initialized",code:"embedded_wallet_webview_not_loaded"});return await this.proxy.clearMfa(e)}constructor(e,t){this.proxy=t,this.privyInternal=e,this.sms=new Ft(e),this.passkey=new Dt(e)}}const Wt={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},qt={path:"/api/v1/recovery/oauth/init",method:"POST"},Ht={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},Vt={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},Gt={path:"/api/v1/recovery/configuration_icloud",method:"POST"};let Kt=class{async init(e){return this._privyInternal.fetch(Vt,{body:{client_type:e}})}async getICloudConfiguration(e){return this._privyInternal.fetch(Gt,{body:{client_type:e}})}constructor(e){this._privyInternal=e}};class Jt{async generateURL(e){var t;let n=et(),r=tt(),i=await nt({codeVerifier:n,digest:null===(t=this._crypto)||void 0===t?void 0:t.digest});return await Promise.all([this._storage.put($e,n),this._storage.put(Xe,r)]),this._privyInternal.fetch(qt,{body:{redirect_to:e,code_challenge:i,state_code:r}})}async authorize(e,t){let[n,r]=await Promise.all([this._storage.get($e),this._storage.get(Xe)]);if(r!==t)throw this._privyInternal.createAnalyticsEvent("possible_phishing_attempt",{flow:"recovery_oauth",storedStateCode:null!==r&&void 0!==r?r:"",returnedStateCode:null!==t&&void 0!==t?t:""}),new g.wE({code:"pkce_state_code_mismatch",error:"Unexpected auth flow. This may be a phishing attempt."});let i=await this._privyInternal.fetch(Ht,{body:{authorization_code:e,state_code:r,code_verifier:n}});return await Promise.all([this._storage.del($e),this._storage.del(Xe)]),i}constructor(e,t,n){this._privyInternal=e,this._storage=t,this._crypto=n}}class Zt{async getRecoveryKeyMaterial(e,t){return this._privyInternal.fetch(Wt,{body:{chain_type:t},params:{address:e}})}constructor(e,t,n){this._privyInternal=e,this.auth=new Jt(this._privyInternal,t,n),this.icloudAuth=new Kt(this._privyInternal)}}const Qt=["clientId"];class Yt{async initialize(){await this._privyInternal._initialize()}setMessagePoster(e){this.embeddedWallet.setMessagePoster(e)}addOAuthTokensListener(e){return this._privyInternal.session.on("oauth_tokens_granted",e),{unsubscribe:()=>{this._privyInternal.session.removeListener("oauth_tokens_granted",e)}}}setCallbacks(e){this._privyInternal.setCallbacks(e)}getAccessToken(){return this._privyInternal.getAccessToken()}getIdentityToken(){return this._privyInternal.getIdentityToken()}getCompiledPath(e,t){return this._privyInternal.getPath(e,t)}
2async fetchPrivyRoute(e,t){return this._privyInternal.fetch(e,t)}get logger(){return this._privyInternal.logger}constructor(e){let{clientId:t}=e,n=(0,i.A)(e,Qt);this._privyInternal=new be((0,r.A)((0,r.A)({},n),{},{appClientId:t})),this.mfa=new zt(this._privyInternal),this.mfaPromises=new J,this.app=new o(this._privyInternal),this.embeddedWallet=new K(this._privyInternal,n.embeddedWalletMessagePoster,n.supportedChains,this.mfa,this.mfaPromises,this.app),this.user=new _e(this._privyInternal),this.auth=new Ct(this._privyInternal,this.embeddedWallet,n.storage,n.crypto,this.mfa),this.recovery=new Zt(this._privyInternal,n.storage,n.crypto),this.funding=new Lt(this._privyInternal),this.delegated=new h(this._privyInternal),this.crossApp=new u(this._privyInternal,n.storage)}}},17766:(e,t,n)=>{"use strict";n.d(t,{$x:()=>c,El:()=>a,O_:()=>o,Uw:()=>s});var r=n(57722);let i=(0,r.createContext)(null);i.displayName="OpenClosedContext";var s=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(s||{});function o(){return(0,r.useContext)(i)}function a(e){let{value:t,children:n}=e;return r.createElement(i.Provider,{value:t},n)}function c(e){let{children:t}=e;return r.createElement(i.Provider,{value:null},t)}},18656:(e,t,n)=>{"use strict";n.d(t,{BI:()=>x,EB:()=>A,Iy:()=>c,Iz:()=>w,MR:()=>b,M_:()=>v,Nc:()=>u,O:()=>l,Wl:()=>P,Wq:()=>g,YE:()=>h,YF:()=>a,YW:()=>o,ZP:()=>p,_z:()=>m,d_:()=>C,dm:()=>T,fo:()=>E,gH:()=>d,j:()=>I,kE:()=>y,l3:()=>k,nK:()=>S,nM:()=>_,yy:()=>f});var r=n(68419),i=n(1490),s=n(51659);class o extends s.C{constructor(e){let{docsPath:t}=e;super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join("\n"),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class a extends s.C{constructor(e){let{docsPath:t}=e;super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join("\n"),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}s.C;class c extends s.C{constructor(e){let{data:t,params:n,size:i}=e;super(["Data size of ".concat(i," bytes is too small for given parameters.")].join("\n"),{metaMessages:["Params: (".concat((0,r.A)(n,{includeName:!0}),")"),"Data: ".concat(t," (").concat(i," bytes)")],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=i}}class l extends s.C{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class u extends s.C{constructor(e){let{expectedLength:t,givenLength:n,type:r}=e;super(["ABI encoding array length mismatch for type ".concat(r,"."),"Expected length: ".concat(t),"Given length: ".concat(n)].join("\n"),{name:"AbiEncodingArrayLengthMismatchError"})}}class d extends s.C{constructor(e){let{expectedSize:t,value:n}=e;super('Size of bytes "'.concat(n,'" (bytes').concat((0,i.E)(n),") does not match expected size (bytes").concat(t,")."),{name:"AbiEncodingBytesSizeMismatchError"})}}class h extends s.C{constructor(e){let{expectedLength:t,givenLength:n}=e;super(["ABI encoding params/values length mismatch.","Expected length (params): ".concat(t),"Given length (values): ".concat(n)].join("\n"),{name:"AbiEncodingLengthMismatchError"})}}class p extends s.C{constructor(e,t){let{docsPath:n}=t;super(['Arguments (`args`) were provided to "'.concat(e,'", but "').concat(e,'" on the ABI does not contain any parameters (`inputs`).'),"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join("\n"),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class f extends s.C{constructor(e){let{docsPath:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(["Error ".concat(e?'"'.concat(e,'" '):"","not found on ABI."),"Make sure you are using the correct ABI and that the error exists on it."].join("\n"),{docsPath:t,name:"AbiErrorNotFoundError"})}}class g extends s.C{constructor(e,t){let{docsPath:n}=t;super(['Encoded error signature "'.concat(e,'" not found on ABI.'),"Make sure you are using the correct ABI and that the error exists on it.","You can look up the decoded signature here: https://openchain.xyz/signatures?query=".concat(e,".")].join("\n"),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class m extends s.C{constructor(e){let{docsPath:t}=e;super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class y extends s.C{constructor(e,t){let{docsPath:n}=t;super(['Encoded event signature "'.concat(e,'" not found on ABI.'),"Make sure you are using the correct ABI and that the event exists on it.","You can look up the signature here: https://openchain.xyz/signatures?query=".concat(e,".")].join("\n"),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class v extends s.C{constructor(e){let{docsPath:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(["Event ".concat(e?'"'.concat(e,'" '):"","not found on ABI."),"Make sure you are using the correct ABI and that the event exists on it."].join("\n"),{docsPath:t,name:"AbiEventNotFoundError"})}}class w extends s.C{constructor(e){let{docsPath:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(["Function ".concat(e?'"'.concat(e,'" '):"","not found on ABI."),"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t,name:"AbiFunctionNotFoundError"})}}class b extends s.C{constructor(e,t){let{docsPath:n}=t;super(['Function "'.concat(e,'" does not contain any `outputs` on ABI.'),"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class A extends s.C{constructor(e,t){let{docsPath:n}=t;super(['Encoded function signature "'.concat(e,'" not found on ABI.'),"Make sure you are using the correct ABI and that the function exists on it.","You can look up the signature here: https://openchain.xyz/signatures?query=".concat(e,".")].join("\n"),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class _ extends s.C{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:["`".concat(e.type,"` in `").concat((0,r.B)(e.abiItem),"`, and"),"`".concat(t.type,"` in `").concat((0,r.B)(t.abiItem),"`"),"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class x extends s.C{constructor(e){let{expectedSize:t,givenSize:n}=e;
2super("Expected bytes".concat(t,", got bytes").concat(n,"."),{name:"BytesSizeMismatchError"})}}class E extends s.C{constructor(e){let{abiItem:t,data:n,params:i,size:s}=e;super(["Data size of ".concat(s," bytes is too small for non-indexed event parameters.")].join("\n"),{metaMessages:["Params: (".concat((0,r.A)(i,{includeName:!0}),")"),"Data: ".concat(n," (").concat(s," bytes)")],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=i,this.size=s}}class k extends s.C{constructor(e){let{abiItem:t,param:n}=e;super(["Expected a topic for indexed event parameter".concat(n.name?' "'.concat(n.name,'"'):"",' on event "').concat((0,r.B)(t,{includeName:!0}),'".')].join("\n"),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class S extends s.C{constructor(e,t){let{docsPath:n}=t;super(['Type "'.concat(e,'" is not a valid encoding type.'),"Please provide a valid ABI type."].join("\n"),{docsPath:n,name:"InvalidAbiEncodingType"})}}class I extends s.C{constructor(e,t){let{docsPath:n}=t;super(['Type "'.concat(e,'" is not a valid decoding type.'),"Please provide a valid ABI type."].join("\n"),{docsPath:n,name:"InvalidAbiDecodingType"})}}class T extends s.C{constructor(e){super(['Value "'.concat(e,'" is not a valid array.')].join("\n"),{name:"InvalidArrayError"})}}class C extends s.C{constructor(e){super(['"'.concat(e,'" is not a valid definition type.'),'Valid types: "function", "event", "error"'].join("\n"),{name:"InvalidDefinitionTypeError"})}}class P extends s.C{constructor(e){super('Type "'.concat(e,'" is not supported for packed encoding.'),{name:"UnsupportedPackedAbiType"})}}},19168:(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var r=n(69692),i=n(64655);class s extends i.IJsonRpcProvider{constructor(e){super(e),this.events=new r.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection;await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict((0,i.formatJsonRpcRequest)(e.method,e.params||[],e.id||(0,i.getBigIntRpcId)().toString()),t)}async requestStrict(e,t){return new Promise(async(n,r)=>{if(!this.connection.connected)try{await this.open()}catch(s){r(s)}this.events.on("".concat(e.id),e=>{(0,i.isJsonRpcError)(e)?r(e.error):n(e.result)});try{await this.connection.send(e,t)}catch(s){r(s)}})}setConnection(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection}onPayload(e){this.events.emit("payload",e),(0,i.isJsonRpcResponse)(e)?this.events.emit("".concat(e.id),e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",new Error("WebSocket connection closed abnormally with code: ".concat(e.code," ").concat(e.reason?"(".concat(e.reason,")"):""))),this.events.emit("disconnect")}async open(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection;this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}},19371:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(31576);function i(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},19582:(e,t,n)=>{"use strict";n.d(t,{_o:()=>w,Pj:()=>y,uT:()=>p,NV:()=>v});var r=n(24107),i=n(87999),s=n(81232),o=n(24419),a=n(12005),c=n(69856),l=n(12379);class u extends l.C{constructor(e){let{current:t,depth:n}=e;super("Unbalanced parentheses.",{metaMessages:['"'.concat(t.trim(),'" has too many ').concat(n>0?"opening":"closing"," parentheses.")],details:'Depth "'.concat(n,'"')}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}const d=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);var h=n(71488);function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,h.Ji)(e))return function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,h.ej)(e);if(!r)throw new c.s7({signature:e,type:"function"});const i=v(r.parameters),s=[],o=i.length;for(let c=0;c<o;c++)s.push(y(i[c],{modifiers:h.v7,structs:n,type:"function"}));const a=[];if(r.returns){const e=v(r.returns),t=e.length;for(let r=0;r<t;r++)a.push(y(e[r],{modifiers:h.v7,structs:n,type:"function"}))}return{name:r.name,type:"function",stateMutability:null!==(t=r.stateMutability)&&void 0!==t?t:"nonpayable",inputs:s,outputs:a}}(e,t);if((0,h.Rv)(e))return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,h.iB)(e);if(!n)throw new c.s7({signature:e,type:"event"});const r=v(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(y(r[o],{modifiers:h.fC,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:i}}(e,t);if((0,h.pc)(e))return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,h.kz)(e);if(!n)throw new c.s7({signature:e,type:"error"});const r=v(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(y(r[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:i}}(e,t);if((0,h.l9)(e))return function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,h.Yo)(e);if(!r)throw new c.s7({signature:e,type:"constructor"});const i=v(r.parameters),s=[],o=i.length;for(let a=0;a<o;a++)s.push(y(i[a],{structs:n,type:"constructor"}));return{type:"constructor",stateMutability:null!==(t=r.stateMutability)&&void 0!==t?t:"nonpayable",inputs:s}}(e,t);if((0,h.v8)(e))return function(e){var t;const n=(0,h.If)(e);if(!n)throw new c.s7({signature:e,type:"fallback"});return{type:"fallback",stateMutability:null!==(t=n.stateMutability)&&void 0!==t?t:"nonpayable"}}(e);if((0,h.sP)(e))return{type:"receive",stateMutability:"payable"};throw new c.x8({signature:e})}const f=(0,i.A)(/^([a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)((?:\[\d*?\])+?)?(?:\s(calldata|indexed|memory|storage{1}))?(?:\s([a-zA-Z$_][a-zA-Z0-9$_]*))?$/,{type:1,array:2,modifier:3,name:4}),g=(0,i.A)(/^\((.+?)\)((?:\[\d*?\])+?)?(?:\s(calldata|indexed|memory|storage{1}))?(?:\s([a-zA-Z$_][a-zA-Z0-9$_]*))?$/,{type:1,array:2,modifier:3,name:4}),m=/^u?int$/;function y(e,t){var n,i;const c=function(e,t,n){let r="";if(n)for(const i of Object.entries(n)){if(!i)continue;let e="";
2for(const t of i[1])e+="[".concat(t.type).concat(t.name?":".concat(t.name):"","]");r+="(".concat(i[0],"{").concat(e,"})")}return t?"".concat(t,":").concat(e).concat(r):e}(e,null===t||void 0===t?void 0:t.type,null===t||void 0===t?void 0:t.structs);if(d.has(c))return d.get(c);const l=s.wj.test(e),u=(0,s.Yv)(l?g:f,e);if(!u)throw new a.dV({param:e});if(u.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||s.BD.test(e)||s.Ge.test(e)||b.test(e)}(u.name))throw new a.zd({param:e,name:u.name});const p=u.name?{name:u.name}:{},A="indexed"===u.modifier?{indexed:!0}:{},_=null!==(n=null===t||void 0===t?void 0:t.structs)&&void 0!==n?n:{};let x,E={};if(l){x="tuple";const e=v(u.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(y(e[r],{structs:_}));E={components:t}}else if(u.type in _)x="tuple",E={components:_[u.type]};else if(m.test(u.type))x="".concat(u.type,"256");else if("address payable"===u.type)x="address";else if(x=u.type,"struct"!==(null===t||void 0===t?void 0:t.type)&&!w(x))throw new o.UG({type:x});if(u.modifier){var k,S;if(null===t||void 0===t||null===(k=t.modifiers)||void 0===k||null===(S=k.has)||void 0===S||!S.call(k,u.modifier))throw new a.NO({param:e,type:null===t||void 0===t?void 0:t.type,modifier:u.modifier});if(h.v7.has(u.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(x,!!u.array))throw new a.Pj({param:e,type:null===t||void 0===t?void 0:t.type,modifier:u.modifier})}const I=(0,r.A)((0,r.A)((0,r.A)({type:"".concat(x).concat(null!==(i=u.array)&&void 0!==i?i:"")},p),A),E);return d.set(c,I),I}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=e.trim().length;for(let s=0;s<i;s++){const i=e[s],o=e.slice(s+1);switch(i){case",":return 0===r?v(o,[...t,n.trim()]):v(o,t,"".concat(n).concat(i),r);case"(":return v(o,t,"".concat(n).concat(i),r+1);case")":return v(o,t,"".concat(n).concat(i),r-1);default:return v(o,t,"".concat(n).concat(i),r)}}if(""===n)return t;if(0!==r)throw new u({current:n,depth:r});return t.push(n.trim()),t}function w(e){return"address"===e||"bool"===e||"function"===e||"string"===e||s.BD.test(e)||s.Ge.test(e)}const b=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/},19812:(e,t,n)=>{"use strict";n.d(t,{XF:()=>i,Zg:()=>l,cr:()=>o,f_:()=>c,sw:()=>a});var r=n(10860);function i(){if("undefined"===typeof globalThis.crypto||"function"!==typeof globalThis.crypto.getRandomValues)throw new r.tsw(r.iOv)}function s(){if(!globalThis.isSecureContext)throw new r.tsw(r.qTc)}function o(){var e;if(s(),"undefined"===typeof globalThis.crypto||"function"!==typeof(null===(e=globalThis.crypto.subtle)||void 0===e?void 0:e.digest))throw new r.tsw(r.JsK)}function a(){var e;if(s(),"undefined"===typeof globalThis.crypto||"function"!==typeof(null===(e=globalThis.crypto.subtle)||void 0===e?void 0:e.exportKey))throw new r.tsw(r.kz9)}function c(){var e;if(s(),"undefined"===typeof globalThis.crypto||"function"!==typeof(null===(e=globalThis.crypto.subtle)||void 0===e?void 0:e.sign))throw new r.tsw(r.f$j)}function l(){var e;if(s(),"undefined"===typeof globalThis.crypto||"function"!==typeof(null===(e=globalThis.crypto.subtle)||void 0===e?void 0:e.verify))throw new r.tsw(r.XzN)}},20238:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0}},21165:(e,t,n)=>{"use strict";n.d(t,{Ez:()=>o,LX:()=>r,WN:()=>i,fT:()=>s});const r="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b
2602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",i="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",s="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
2603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",o="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
2150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"},21809:(e,t,n)=>{"use strict";n.d(t,{kF:()=>s});class r{}class i extends r{constructor(){super()}}class s extends i{constructor(e){super()}}}
2,21839:(e,t,n)=>{"use strict";n.d(t,{BH:()=>f,vB:()=>p,yM:()=>g});var r=n(24107),i=n(25741),s=n(51659),o=n(41661),a=n(76416),c=n(73183),l=n(63015),u=n(652),d=n(81946),h=n(38254);const p="0x5792579257925792579257925792579257925792579257925792579257925792",f=(0,u.cK)(0,{size:32});async function g(e,t){const{account:n=e.account,capabilities:g,chain:m=e.chain,experimental_fallback:y,experimental_fallbackDelay:v=32,forceAtomic:w=!1,id:b,version:A="2.0.0"}=t,_=n?(0,i.J)(n):null,x=t.calls.map(e=>{const t=e,n=t.abi?(0,a.p)({abi:t.abi,functionName:t.functionName,args:t.args}):t.data;return{data:t.dataSuffix&&n?(0,c.xW)([n,t.dataSuffix]):n,to:t.to,value:t.value?(0,u.cK)(t.value):void 0}});try{const t=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:w,calls:x,capabilities:g,chainId:(0,u.cK)(m.id),from:null===_||void 0===_?void 0:_.address,id:b,version:A}]},{retryCount:0});return"string"===typeof t?{id:t}:t}catch(E){const n=E;if(y&&("MethodNotFoundRpcError"===n.name||"MethodNotSupportedRpcError"===n.name||"UnknownRpcError"===n.name||n.details.toLowerCase().includes("does not exist / is not available")||n.details.toLowerCase().includes("missing or invalid. request()")||n.details.toLowerCase().includes("did not match any variant of untagged enum")||n.details.toLowerCase().includes("account upgraded to unsupported contract")||n.details.toLowerCase().includes("eip-7702 not supported")||n.details.toLowerCase().includes("unsupported wc_ method")||n.details.toLowerCase().includes("feature toggled misconfigured")||n.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(g){if(Object.values(g).some(e=>!e.optional)){const e="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new o.L5(new s.C(e,{details:e}))}}if(w&&x.length>1){const e="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new o.jz(new s.C(e,{details:e}))}const t=[];for(const i of x){const n=(0,h.v)(e,{account:_,chain:m,data:i.data,to:i.to,value:i.value?(0,l.uU)(i.value):void 0});t.push(n),v>0&&await new Promise(e=>setTimeout(e,v))}const n=await Promise.allSettled(t);if(n.every(e=>"rejected"===e.status))throw n[0].reason;const r=n.map(e=>"fulfilled"===e.status?e.value:f);return{id:(0,c.xW)([...r,(0,u.cK)(m.id,{size:32}),p])}}throw(0,d.p)(E,(0,r.A)((0,r.A)({},t),{},{account:_,chain:t.chain}))}}},22176:(e,t)=>{"use strict";function n(){return"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product}function r(){return"undefined"!==typeof process&&"undefined"!==typeof process.versions&&"undefined"!==typeof process.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=r,t.isBrowser=function(){return!n()&&!r()}},22904:(e,t,n)=>{"use strict";var r;n.d(t,{A:()=>d});var i=new Uint8Array(16);function s(){if(!r&&!(r="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function(e){return"string"===typeof e&&o.test(e)};for(var c=[],l=0;l<256;++l)c.push((l+256).toString(16).substr(1));const u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n};const d=function(e,t,n){var r=(e=e||{}).random||(e.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return u(r)}},23096:(e,t,n)=>{"use strict";n.d(t,{B:()=>i});var r=n(9670);function i(e){var t;return"function"===e.type?"function ".concat(e.name,"(").concat((0,r.Q)(e.inputs),")").concat(e.stateMutability&&"nonpayable"!==e.stateMutability?" ".concat(e.stateMutability):"").concat(null!==(t=e.outputs)&&void 0!==t&&t.length?" returns (".concat((0,r.Q)(e.outputs),")"):""):"event"===e.type?"event ".concat(e.name,"(").concat((0,r.Q)(e.inputs),")"):"error"===e.type?"error ".concat(e.name,"(").concat((0,r.Q)(e.inputs),")"):"constructor"===e.type?"constructor(".concat((0,r.Q)(e.inputs),")").concat("payable"===e.stateMutability?" payable":""):"fallback"===e.type?"fallback() external".concat("payable"===e.stateMutability?" payable":""):"receive() external payable"}},23231:(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var r=n(24107);var i=n(32381);const s=e=>e.map(e=>{var t;if(e.rpcUrls.privyWalletOverride)return e;let n=i.m.find(t=>
2t.id===e.id),s=null===n||void 0===n||null===(t=n.rpcUrls.privy)||void 0===t?void 0:t.http[0];return s?function(e,t){return(0,r.A)((0,r.A)({},e),{},{rpcUrls:(0,r.A)((0,r.A)({},e.rpcUrls),{},{privy:{http:[t]}})})}(e,s):e})},23328:(e,t,n)=>{"use strict";n.d(t,{e:()=>p});var r=n(24107),i=n(87999),s=n(81232),o=n(24419),a=n(12005),c=n(69856),l=n(12379);class u extends l.C{constructor(e){let{type:t}=e;super("Circular reference detected.",{metaMessages:['Struct "'.concat(t,'" is a circular reference.')]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}var d=n(71488),h=n(19582);function p(e){const t={},n=e.length;for(let o=0;o<n;o++){const n=e[o];if(!(0,d.WL)(n))continue;const r=(0,d.FO)(n);if(!r)throw new c.s7({signature:n,type:"struct"});const i=r.properties.split(";"),s=[],a=i.length;for(let e=0;e<a;e++){const t=i[e].trim();if(!t)continue;const n=(0,h.Pj)(t,{type:"struct"});s.push(n)}if(!s.length)throw new c.X9({signature:n});t[r.name]=s}const r={},i=Object.entries(t),s=i.length;for(let o=0;o<s;o++){const[e,n]=i[o];r[e]=g(n,t)}return r}const f=(0,i.A)(/^([a-zA-Z$_][a-zA-Z0-9$_]*)((?:\[\d*?\])+?)?$/,{type:1,array:2});function g(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const i=[],c=e.length;for(let d=0;d<c;d++){const c=e[d];if(s.wj.test(c.type))i.push(c);else{const e=(0,s.Yv)(f,c.type);if(null===e||void 0===e||!e.type)throw new a.nx({abiParameter:c});const{array:d,type:p}=e;if(p in t){var l;if(n.has(p))throw new u({type:p});i.push((0,r.A)((0,r.A)({},c),{},{type:"tuple".concat(null!==d&&void 0!==d?d:""),components:g(null!==(l=t[p])&&void 0!==l?l:[],t,new Set([...n,p]))}))}else{if(!(0,h._o)(p))throw new o.zz({type:p});i.push(c)}}}return i}},23422:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});var r=n(51659);class i extends r.C{constructor(e){let{address:t}=e;super('Address "'.concat(t,'" is invalid.'),{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}},23691:(e,t,n)=>{"use strict";n.d(t,{CG:()=>r});const r={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}}},24107:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(19371);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}},24348:(e,t,n)=>{"use strict";var r=n(86483);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},24419:(e,t,n)=>{"use strict";n.d(t,{UG:()=>o,xo:()=>i,zz:()=>s});var r=n(12379);class i extends r.C{constructor(e){let{signature:t}=e;super("Failed to parse ABI item.",{details:"parseAbiItem(".concat(JSON.stringify(t,null,2),")"),docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class s extends r.C{constructor(e){let{type:t}=e;super("Unknown type.",{metaMessages:['Type "'.concat(t,'" is not a valid ABI type. Perhaps you forgot to include a struct signature?')]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class o extends r.C{constructor(e){let{type:t}=e;super("Unknown type.",{metaMessages:['Type "'.concat(t,'" is not a valid ABI type.')]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}}
2,24428:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var r=n(41226),i=n(96550);async function s(e,t){var n;let{hash:s}=t;const o=await e.request({method:"eth_getTransactionReceipt",params:[s]},{dedupe:!0});if(!o)throw new r.Kc({hash:s});return((null===(n=e.chain)||void 0===n||null===(n=n.formatters)||void 0===n||null===(n=n.transactionReceipt)||void 0===n?void 0:n.format)||i.uL)(o,"getTransactionReceipt")}},24464:(e,t,n)=>{"use strict";n.d(t,{MR:()=>l,TN:()=>a,Uv:()=>r,Wq:()=>c,tZ:()=>o});var r=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(r||{}),i=2,s=1;function o(e){return e>=2}function a(e){return 0!==(e&s)}function c(e,t){return e|t}function l(e){return e|i}},25087:(e,t,n)=>{"use strict";n.d(t,{Y:()=>s});var r=n(57722),i=n(73660);function s(e){let t=(0,r.useRef)(e);return(0,i.s)(()=>{t.current=e},[e]),t}},25566:(e,t,n)=>{"use strict";n.d(t,{g:()=>a});class r{constructor(e,t){this.type=e,this.data=t}}var i=n(45207),s=n(27014);const o={type:-1,encode:function(e){if(e instanceof Date){return function(e){let{sec:t,nsec:n}=e;if(t>=0&&n>=0&&t<=17179869183){if(0===n&&t<=4294967295){const e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t),e}{const e=t/4294967296,r=4294967295&t,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,n<<2|3&e),s.setUint32(4,r),i}}{const e=new Uint8Array(12),r=new DataView(e.buffer);return r.setUint32(0,n),(0,s._j)(r,4,t),e}}(function(e){const t=e.getTime(),n=Math.floor(t/1e3),r=1e6*(t-1e3*n),i=Math.floor(r/1e9);return{sec:n+i,nsec:r-1e9*i}}(e))}return null},decode:function(e){const t=function(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const e=t.getUint32(0);return{sec:4294967296*(3&e)+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:(0,s.eN)(t,4),nsec:t.getUint32(0)};default:throw new i.X("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}};class a{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(o)}register(e){let{type:t,encode:n,decode:r}=e;if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{const e=-1-t;this.builtInEncoders[e]=n,this.builtInDecoders[e]=r}}tryToEncode(e,t){for(let n=0;n<this.builtInEncoders.length;n++){const i=this.builtInEncoders[n];if(null!=i){const s=i(e,t);if(null!=s){return new r(-1-n,s)}}}for(let n=0;n<this.encoders.length;n++){const i=this.encoders[n];if(null!=i){const s=i(e,t);if(null!=s){return new r(n,s)}}}return e instanceof r?e:null}decode(e,t,n){const i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(e,t,n):new r(t,e)}}a.defaultCodec=new a},25741:(e,t,n)=>{"use strict";function r(e){return"string"===typeof e?{address:e,type:"json-rpc"}:e}n.d(t,{J:()=>r})},26043:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},26833:(e,t,n)=>{"use strict";n.d(t,{h:()=>r});const r=e=>window.open(null===e||void 0===e?void 0:e.location,void 0,(e=>{let{w:t,h:n}=e,r=void 0!==window.screenLeft?window.screenLeft:window.screenX,i=void 0!==window.screenTop?window.screenTop:window.screenY,s=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;return"toolbar=0,location=0,menubar=0,height=".concat(n,",width=").concat(t,",popup=1,left=").concat((s-t)/2/(s/window.screen.availWidth)+r,",top=").concat((o-n)/2/(o/window.screen.availHeight)+i)})({w:440,h:680}))},26856:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(59892);const i="\x19Ethereum Signed Message:\n";var s=n(73183),o=n(1490),a=n(652);function c(e,t){return(0,r.S)(function(e){const t="string"===typeof e?(0,a.i3)(e):"string"===typeof e.raw?e.raw:(0,a.My)(e.raw),n=(0,a.i3)("".concat(i).concat((0,o.E)(t)));return(0,s.xW)([n,t])}(e),t)}}
2,27014:(e,t,n)=>{"use strict";n.d(t,{Hn:()=>a,X3:()=>i,_j:()=>s,eN:()=>o,f7:()=>r});const r=4294967295;function i(e,t,n){const r=n/4294967296,i=n;e.setUint32(t,r),e.setUint32(t+4,i)}function s(e,t,n){const r=Math.floor(n/4294967296),i=n;e.setUint32(t,r),e.setUint32(t+4,i)}function o(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}function a(e,t){return 4294967296*e.getUint32(t)+e.getUint32(t+4)}},27133:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(6195),i=n(10133);const s=/^0x[a-fA-F0-9]{40}$/,o=new r.A(8192);function a(e,t){const{strict:n=!0}=null!==t&&void 0!==t?t:{},r="".concat(e,".").concat(n);if(o.has(r))return o.get(r);const a=!!s.test(e)&&(e.toLowerCase()===e||!n||(0,i.o)(e)===e);return o.set(r,a),a}},27610:(e,t,n)=>{"use strict";n.d(t,{x:()=>o});var r=n(41226),i=n(652),s=n(47e3);async function o(e,t){var n;let{blockHash:o,blockNumber:a,blockTag:c,hash:l,index:u,sender:d,nonce:h}=t;const p=c||"latest",f=void 0!==a?(0,i.cK)(a):void 0;let g=null;if(l?g=await e.request({method:"eth_getTransactionByHash",params:[l]},{dedupe:!0}):o?g=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[o,(0,i.cK)(u)]},{dedupe:!0}):(f||p)&&"number"===typeof u?g=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[f||p,(0,i.cK)(u)]},{dedupe:Boolean(f)}):d&&"number"===typeof h&&(g=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[d,(0,i.cK)(h)]},{dedupe:!0})),!g)throw new r.Kz({blockHash:o,blockNumber:a,blockTag:p,hash:l,index:u});return((null===(n=e.chain)||void 0===n||null===(n=n.formatters)||void 0===n||null===(n=n.transaction)||void 0===n?void 0:n.format)||s.uP)(g,"getTransaction")}},27767:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1598);r.__exportStar(n(74878),t),r.__exportStar(n(22176),t)},27999:(e,t,n)=>{"use strict";n.d(t,{sj:()=>c,g1:()=>a,Pi:()=>o,Z9:()=>l,pO:()=>d});const r=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","mfa_timeout","missing_or_invalid_mfa","mfa_verification_max_attempts_reached"];var i;(i={}).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",i.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",i.INVALID_DATA="invalid_data",i.LINKED_TO_ANOTHER_USER="linked_to_another_user",i.ALLOWLIST_REJECTED="allowlist_rejected",i.OAUTH_USER_DENIED="oauth_user_denied",i.UNKNOWN_AUTH_ERROR="unknown_auth_error",i.USER_EXITED_AUTH_FLOW="exited_auth_flow",i.MUST_BE_AUTHENTICATED="must_be_authenticated",i.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",i.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",i.CLIENT_REQUEST_TIMEOUT="client_request_timeout",i.INVALID_CREDENTIALS="invalid_credentials";class s extends Error{toString(){return"".concat(this.type).concat(this.privyErrorCode?"-".concat(this.privyErrorCode):"",": ").concat(this.message).concat(this.cause?" [cause: ".concat(this.cause,"]"):"")}constructor(e,t,n){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=n}}class o extends Error{constructor(e,t){super(t),this.type=e}}class a extends s{constructor(e,t,n){super(e,t,n),this.type="connector_error"}}class c extends Error{constructor(e,t,n){super(e),this.code=t,this.data=n}}const l={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail
2:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};function u(e){let t=e.type;return"string"==typeof t&&r.includes(t)}function d(e){return u(e)&&"wallet_not_on_device"===e.type}},28499:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class n{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error("Watch already started for label: ".concat(e));this.timestamps.set(e,{started:Date.now()})}stop(e){const t=this.get(e);if("undefined"!==typeof t.elapsed)throw new Error("Watch already stopped for label: ".concat(e));const n=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:n})}get(e){const t=this.timestamps.get(e);if("undefined"===typeof t)throw new Error("No timestamp found for label: ".concat(e));return t}elapsed(e){const t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=n,t.default=n},28882:function(e,t,n){var r;!function(i,s){"use strict";var o="function",a="undefined",c="object",l="string",u="major",d="model",h="name",p="type",f="vendor",g="version",m="architecture",y="console",v="mobile",w="tablet",b="smarttv",A="wearable",_="embedded",x="Amazon",E="Apple",k="ASUS",S="BlackBerry",I="Browser",T="Chrome",C="Firefox",P="Google",O="Honor",N="Huawei",R="LG",M="Microsoft",U="Motorola",L="Nvidia",B="OnePlus",D="Opera",j="OPPO",F="Samsung",z="Sharp",W="Sony",q="Xiaomi",H="Zebra",V="Facebook",G="Chromium OS",K="Mac OS",J=" Browser",Z=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Q=function(e,t){return typeof e===l&&-1!==Y(t).indexOf(Y(e))},Y=function(e){return e.toLowerCase()},X=function(e,t){if(typeof e===l)return e=e.replace(/^\s\s*/,""),typeof t===a?e:e.substring(0,500)},$=function(e,t){for(var n,r,i,a,l,u,d=0;d<t.length&&!l;){var h=t[d],p=t[d+1];for(n=r=0;n<h.length&&!l&&h[n];)if(l=h[n++].exec(e))for(i=0;i<p.length;i++)u=l[++r],typeof(a=p[i])===c&&a.length>0?2===a.length?typeof a[1]==o?this[a[0]]=a[1].call(this,u):this[a[0]]=a[1]:3===a.length?typeof a[1]!==o||a[1].exec&&a[1].test?this[a[0]]=u?u.replace(a[1],a[2]):s:this[a[0]]=u?a[1].call(this,u,a[2]):s:4===a.length&&(this[a[0]]=u?a[3].call(this,u.replace(a[1],a[2])):s):this[a]=u||s;d+=2}},ee=function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Q(t[n][r],e))return"?"===n?s:n}else if(Q(t[n],e))return"?"===n?s:n;return t.hasOwnProperty("*")?t["*"]:e},te={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},ne={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,g],[/opios[\/ ]+([\w\.]+)/i],[g,[h,D+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[h,D+" GX"]],[/\bopr\/([\w\.]+)/i],[g,[h,D]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[g,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[h,"UC"+I]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[g,[h,"
2Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[g,[h,"Smart Lenovo "+I]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+I],g],[/\bfocus\/([\w\.]+)/i],[g,[h,C+" Focus"]],[/\bopt\/([\w\.]+)/i],[g,[h,D+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[g,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[g,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[g,[h,D+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[g,[h,"MIUI"+J]],[/fxios\/([\w\.-]+)/i],[g,[h,C]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+J],g],[/samsungbrowser\/([\w\.]+)/i],[g,[h,F+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[g,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,g],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,V],g],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[h,T+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,T+" WebView"],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[h,"Android "+I]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[g,ee,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[h,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[h,C+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[h,[g,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[g,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[m,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[m,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[m,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[m,/ower/,"",Y]],[/ sun4\w[;\)]/i],[[m,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[m,Y]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[f,F],[p,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[d,[f,F],[p,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[f,E],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[f,E],[p,w]],[/(macintosh);/i],[d,[f,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[f,z],[p,v]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[d,[f,O],[p,w]],[/honor([-\w ]+)[;\)]/i],[d,[f,O],[p,v]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[d,[f,N],[p,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[f,N],[p,v]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[d,/_/g," "],[f,q],[p,w]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[d,/_/g," "],[f,q],[p,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[f,j],[p,v]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[d,[f,ee,{OnePlus:["304","403","203"],"*":j}],[p,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[f,"Vivo"],[p,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[f,"Realme"],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[f,U],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[f,U],[p,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[f,R],[p,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[f,R],[p,v]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}
vendor: 5,510 bytes, line 2
2(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[d,[f,"Lenovo"],[p,w]],[/(nokia) (t[12][01])/i],[f,d,[p,w]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[d,/_/g," "],[p,v],[f,"Nokia"]],[/(pixel (c|tablet))\b/i],[d,[f,P],[p,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[f,P],[p,v]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[f,W],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[f,W],[p,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[f,B],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[f,x],[p,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[f,x],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[d,f,[p,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[f,S],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[f,k],[p,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[f,k],[p,v]],[/(nexus 9)/i],[d,[f,"HTC"],[p,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[d,/_/g," "],[p,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[d,[f,"TCL"],[p,w]],[/(itel) ((\w+))/i],[[f,Y],d,[p,ee,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[f,"Acer"],[p,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[f,"Meizu"],[p,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[f,"Ulefone"],[p,v]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[d,[f,"Energizer"],[p,v]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[d,[f,"Cat"],[p,v]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[d,[f,"Smartfren"],[p,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[d,[f,"Nothing"],[p,v]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[d,[f,"Archos"],[p,w]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[d,[f,"Archos"],[p,v]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[f,d,[p,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[f,d,[p,v]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,d,[p,w]],[/(surface duo)/i],[d,[f,M],[p,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[f,"Fairphone"],[p,v]],[/(u304aa)/i],[d,[f,"AT&T"],[p,v]],[/\bsie-(\w*)/i],[d,[f,"Siemens"],[p,v]],[/\b(rct\w+) b/i],[d,[f,"RCA"],[p,w]],[/\b(venue[\d ]{2,7}) b/i],[d,[f,"Dell"],[p,w]],[/\b(q(?:mv|ta)\w+) b/i],[d,[f,"Verizon"],[p,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[f,"Barnes & Noble"],[p,w]],[/\b(tm\d{3}\w+) b/i],[d,[f,"NuVision"],[p,w]],[/\b(k88) b/i],[d,[f,"ZTE"],[p,w]],[/\b(nx\d{3}j) b/i],[d,[f,"ZTE"],[p,v]],[/\b(gen\d{3}) b.+49h/i],[d,[f,"Swiss"],[p,v]],[/\b(zur\d{3}) b/i],[d,[f,"Swiss"],[p,w]],[/\b((zeki)?tb.*\b) b/i],[d,[f,"Zeki"],[p,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],d,[p,w]],[/\b(ns-?\w{0,9}) b/i],[d,[f,"Insignia"],[p,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[f,"NextBook"],[p,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],d,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],d,[p,v]],[/\b(ph-1) /i],[d,[f,"Essential"],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[f,"Envizen"],[p,w]],[/\b(trio[-\w\. ]+) b/i],[d,[f,"MachSpeed"],[p,w]],[/\btu_(1491) b/i],[d,[f,"Rotor"],[p,w]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[d,[f,L],[p,w]],[/(sprint) (\w+)/i],[f,d,[p,v]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[f,M],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[f,H],[p,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[f,H],[p,v]],[/smart-tv.+(samsung)/i],[f,[p,b]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[f,F],[p,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,R],[p,b]],[/(apple) ?tv/i],[f,[d,E+" TV"],[p,b]],[/crkey/i],[[d,T+"cast"],[f,P],[p,b]],[/droid.+aft(\w+)( bui|\))/i],[d,[f,x],[p,b]],[/(shield \w+ tv)/i],[d,[f,L],[p,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[f,z],[p,b]],[/(bravia[\w ]+)( bui|\))/i],[d,[f,W],[p,b]],[/(mi(tv|box)-?\w+) bui/i],[d,[f,q],[p,b]],[/Hbbtv.*(technisat) (.*);/i],[f,d,[p,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,X],[d,X],[p,b]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[d,[p,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,d,[p,y]],[/droid.+; (shield)( bui|\))/i],[d,[f,L],[p,y]],[/(playstation \w+)/i],[d,[f,W],[p,y]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[f,M],[p,y]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[d,[f,F],[p,A]],[/((pebble))app/i,/(asu
vendor: 6,999 bytes, line 2
2s|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[f,d,[p,A]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[d,[f,j],[p,A]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[f,E],[p,A]],[/(opwwe\d{3})/i],[d,[f,B],[p,A]],[/(moto 360)/i],[d,[f,U],[p,A]],[/(smartwatch 3)/i],[d,[f,W],[p,A]],[/(g watch r)/i],[d,[f,R],[p,A]],[/droid.+; (wt63?0{2,3})\)/i],[d,[f,H],[p,A]],[/droid.+; (glass) \d/i],[d,[f,P],[p,A]],[/(pico) (4|neo3(?: link|pro)?)/i],[f,d,[p,A]],[/; (quest( \d| pro)?)/i],[d,[f,V],[p,A]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[p,_]],[/(aeobc)\b/i],[d,[f,x],[p,_]],[/(homepod).+mac os/i],[d,[f,E],[p,_]],[/windows iot/i],[[p,_]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[p,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,v]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[d,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[h,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[h,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,g],[/ladybird\//i],[[h,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,g],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[h,[g,ee,te]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,ee,te],[h,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,K],[g,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,h],[/(ubuntu) ([\w\.]+) like android/i],[[h,/(.+)/,"$1 Touch"],g],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[h,g],[/\(bb(10);/i],[g,[h,S]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[h,C+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[g,[h,T+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,G],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,g],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,g]]},re=function(e,t){if(typeof e===c&&(t=e,e=s),!(this instanceof re))return new re(e,t).getResult();var n=typeof i!==a&&i.navigator?i.navigator:s,r=e||(n&&n.userAgent?n.userAgent:""),y=n&&n.userAgentData?n.userAgentData:s,b=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2===0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(ne,t):ne,A=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[h]=s,t[g]=s,$.call(t,r,b.browser),t[u]=typeof(e=t[g])===l?e.replace(/[^\d\.]/g,"").split(".")[0]:s,A&&n&&n.brave&&typeof n.brave.isBrave==o&&(t[h]="Brave"),t},this.getCPU=function(){var e={};return e[m]=s,$.call(e,r,b.cpu),e},this.getDevice=function(){var e={};return e[f]=s,e[d]=s,e[p]=s,$.call(e,r,b.device),A&&!e[p]&&y&&y.mobile&&(e[p]=v),A&&"Macintosh"==e[d]&&n&&typeof n.standalone!==a&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[d]="iPad",e[p]=w),e},this.getEngine=function(){var e={};return e[h]=s,e[g]=s,$.call(e,r,b.engine),e},this.getOS=function(){var e={};return e[h]=s,e[g]=s,$.call(e,r,b.os),A&&!e[h]&&y&&y.platform&&"Unknown"!=y.platform&&(e[h]=y.platform.replace(/chrome os/i,G).replace(/macos/i,K)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===l&&e.length>500?X(e,500):e,this},this.setUA(r),this};re.VERSION="1.0.41",re.BROWSER=Z([h,g,u]),re.CPU=Z([m]),re.DEVICE=Z([d,f,p,y,v,b,w,A,_]),re.ENGINE=re.OS=Z([h,g]),typeof t!==a?(e.exports&&(t=e.exports=re),t.UAParser=re):n.amdO?(r=function(){return re}.call(t,n,t,e))===s||(e.exports=r):typeof i!==a&&(i.UAParser=re);var ie=typeof i!==a&&(i.jQuery||i.Zepto);if(ie&&!ie.ua){var se=new re;ie.ua=se.getResult(),ie.ua.get=function(){return se.getUA()},ie.ua.set=function(e){se.setUA(e);var t=se.getResult();for(var n in t)ie.ua[n]=t[n]}}}("object"===typeof window?window:this)},29077:(e,t,n)=>{"use strict";var r=n(57722),i=n(29836);function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function c(e,t){l(e,t),l(e+"Capture",t)}function l(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var u=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function g(e,t,n,r,i,s,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){m[e]=new g(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEac
vendor: 19,902 bytes, line 2
2h(function(e){var t=e[0];m[t]=new g(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){m[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){m[e]=new g(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){m[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){m[e]=new g(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){m[e]=new g(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){m[e]=new g(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){m[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function w(e,t,n,r){var i=m.hasOwnProperty(t)?m[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!d.call(f,e)||!d.call(p,e)&&(h.test(e)?f[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(y,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),m.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});var b=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),_=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),I=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),N=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var R=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var M=Symbol.iterator;function U(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=M&&e[M]||e["@@iterator"])?e:null}var L,B=Object.assign;function D(e){if(void 0===L)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return"\n"+L+e}var j=!1;function F(e,t){if(!e||j)return"";j=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&"string"===typeof l.stack){for(var i=l.stack.split("\n"),s=r.stack.split("\n"),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(1!==o||1!==a)do{if(o--,0>--a||i[o]!==s[a]){var c="\n"+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=o&&0<=a);break}}}finally{j=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function z(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=F(e.type,!1);case 11:return e=F(e.type.render,!1);case 1:return e=F(e.type,!0);default:return""}}function W(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case x:return"Fragment";case _:return"Portal";case k:return"Profiler";case E:return"StrictMode";case C:return"Suspense";case P:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case I:return(e.displayName||"Context")+".Consumer";case S:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case O:return null!==(t=e.displayName||null)?t:W(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return W(e(t))}catch(n){}}return null}function q(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return W(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function V(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function G(e){e._valueTracker||(e._valueTracker=function(e){var t=V(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function K(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=V(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function J(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Q(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=H(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Y(e,t){null!=(t=t.checked)&&w(e,"checked",t,!1)}function X(e,t){Y(e,t);var n=H(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+H(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(s(91));return B({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(s(92));if(te(n)){if(1<n.length)throw Error(s(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:H(n)}}function se(e,t){var n=H(t.value),r=H(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ce(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var le,ue=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((le=le||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=le.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function de(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var he={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function fe(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=fe(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(he).forEach(function(e){pe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]})});var me=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(me[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(s(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(s(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(s(62))}}function ve(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function be(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ae=null,_e=null,xe=null;function Ee(e){if(e=gi(e)){if("function"!==typeof Ae)throw Error(s(280));var t=e.stateNode;t&&(t=yi(t),Ae(e.stateNode,e.type,t))}}function ke(e){_e?xe?xe.push(e):xe=[e]:_e=e}function Se(){if(_e){var e=_e,t=xe;if(xe=_e=null,Ee(e),t)for(e=0;e<t.length;e++)Ee(t[e])}}function Ie(e,t){return e(t)}function Te(){}var Ce=!1;function Pe(e,t,n){if(Ce)return e(t,n);Ce=!0;try{return Ie(e,t,n)}finally{Ce=!1,(null!==_e||null!==xe)&&(Te(),Se())}}function Oe(e,t){var n=e.stateNode;if(null===n)return null;var r=yi(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(s(231,t,typeof n));return n}var Ne=!1;if(u)try{var Re={};Object.defineProperty(Re,"passive",{get:function(){Ne=!0}}),window.addEventListener("test",Re,Re),window.removeEventListener("test",Re,Re)}catch(eu){Ne=!1}function Me(e,t,n,r,i,s,o,a,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(u){this.onError(u)}}var Ue=!1,Le=null,Be=!1,De=null,je={onError:function(e){Ue=!0,Le=e}};function Fe(e,t,n,r,i,s,o,a,c){Ue=!1,Le=null,Me.apply(je,arguments)}function ze(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function We(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function qe(e){if(ze(e)!==e)throw Error(s(188))}function He(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=ze(e)))throw Error(s(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return qe(i),e;if(o===r)return qe(i),t;o=o.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,c=i.child;c;){if(c===n){a=!0,n=i,r=o;break}if(c===r){a=!0,r=i,n=o;break}c=c.sibling}if(!a){for(c=o.child;c;){if(c===n){a=!0,n=o,r=i;break}if(c===r){a=!0,r=o,n=i;break}c=c.sibling}if(!a)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(3!==n.tag)throw Error(s(188));return n.stateNode.current===n?e:t}(e))?Ve(e):null}function Ve(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ve(e);if(null!==t)return t;e=e.sibling}return null}var Ge=i.unstable_scheduleCallback,Ke=i.unstable_cancelCallback,Je=i.unstable_shouldYield,Ze=i.unstable_requestPaint,Qe=i.unstable_now,Ye=i.unstable_getCurrentPriorityLevel,Xe=i.unstable_ImmediatePriority,$e=i.unstable_UserBlockingPriority,et=i.unstable_NormalPriority,tt=i.unstable_LowPriority,nt=i.unstable_IdlePriority,rt=null,it=null;var st=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(ot(e)/at|0)|0},ot=Math.log,at=Math.LN2;var ct=64,lt=4194304;function ut(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=268435455&n;if(0!==o){var a=o&~i;0!==a?r=ut(a):0!==(s&=o)&&(r=ut(s))}else 0!==(o=n&~i)?r=ut(o):0!==s&&(r=ut(s));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(s=t&-t)||16===i&&0!==(4194240&s)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-st(t)),r|=e[n],t&=~i;return r}function ht(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function ft(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-st(t)]=n}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-st(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var vt=0;function wt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var bt,At,_t,xt,Et,kt=!1,St=[],It=null,Tt=null,Ct=null,Pt=new Map,Ot=new Map,Nt=[],Rt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Mt(e,t){switch(e){case"focusin":case"focusout":It=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":Ct=null;break;case"pointerover":case"pointerout":Pt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ot.delete(t.pointerId)}}function Ut(e,t,n,r,i,s){return null===e||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},null!==t&&(null!==(t=gi(t))&&At(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Lt(e){var t=fi(e.target);if(null!==t){var n=ze(t);
vendor: 5,370 bytes, line 2
2if(null!==n)if(13===(t=n.tag)){if(null!==(t=We(n)))return e.blockedOn=t,void Et(e.priority,function(){_t(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Bt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=gi(n))&&At(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);we=r,n.target.dispatchEvent(r),we=null,t.shift()}return!0}function Dt(e,t,n){Bt(e)&&n.delete(t)}function jt(){kt=!1,null!==It&&Bt(It)&&(It=null),null!==Tt&&Bt(Tt)&&(Tt=null),null!==Ct&&Bt(Ct)&&(Ct=null),Pt.forEach(Dt),Ot.forEach(Dt)}function Ft(e,t){e.blockedOn===t&&(e.blockedOn=null,kt||(kt=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,jt)))}function zt(e){function t(t){return Ft(t,e)}if(0<St.length){Ft(St[0],e);for(var n=1;n<St.length;n++){var r=St[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==It&&Ft(It,e),null!==Tt&&Ft(Tt,e),null!==Ct&&Ft(Ct,e),Pt.forEach(t),Ot.forEach(t),n=0;n<Nt.length;n++)(r=Nt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Nt.length&&null===(n=Nt[0]).blockedOn;)Lt(n),null===n.blockedOn&&Nt.shift()}var Wt=b.ReactCurrentBatchConfig,qt=!0;function Ht(e,t,n,r){var i=vt,s=Wt.transition;Wt.transition=null;try{vt=1,Gt(e,t,n,r)}finally{vt=i,Wt.transition=s}}function Vt(e,t,n,r){var i=vt,s=Wt.transition;Wt.transition=null;try{vt=4,Gt(e,t,n,r)}finally{vt=i,Wt.transition=s}}function Gt(e,t,n,r){if(qt){var i=Jt(e,t,n,r);if(null===i)Fr(e,t,r,Kt,n),Mt(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return It=Ut(It,e,t,n,r,i),!0;case"dragenter":return Tt=Ut(Tt,e,t,n,r,i),!0;case"mouseover":return Ct=Ut(Ct,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Pt.set(s,Ut(Pt.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Ot.set(s,Ut(Ot.get(s)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Mt(e,r),4&t&&-1<Rt.indexOf(e)){for(;null!==i;){var s=gi(i);if(null!==s&&bt(s),null===(s=Jt(e,t,n,r))&&Fr(e,t,r,Kt,n),s===i)break;i=s}null!==i&&r.stopPropagation()}else Fr(e,t,r,null,n)}}var Kt=null;function Jt(e,t,n,r){if(Kt=null,null!==(e=fi(e=be(r))))if(null===(t=ze(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=We(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Kt=e,null}function Zt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ye()){case Xe:return 1;case $e:return 4;case et:case tt:return 16;case nt:return 536870912;default:return 16}default:return 16}}var Qt=null,Yt=null,Xt=null;function $t(){if(Xt)return Xt;var e,t,n=Yt,r=n.length,i="value"in Qt?Qt.value:Qt.textContent,s=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[s-t];t++);return Xt=i.slice(e,1<t?1-t:void 0)}function en(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function tn(){return!0}function nn(){return!1}function rn(e){function t(t,n,r,i,s){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?tn:nn,this.isPropagationStopped=nn,this}return B(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=tn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=tn)},persist:function(){},isPersistent:tn}),t}var sn,on,an,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ln=rn(cn),un=B({},cn,{view:0,detail:0}),dn=rn(un),hn=B({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.from
vendor: 9,166 bytes, line 2
2Element===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==an&&(an&&"mousemove"===e.type?(sn=e.screenX-an.screenX,on=e.screenY-an.screenY):on=sn=0,an=e),sn)},movementY:function(e){return"movementY"in e?e.movementY:on}}),pn=rn(hn),fn=rn(B({},hn,{dataTransfer:0})),gn=rn(B({},un,{relatedTarget:0})),mn=rn(B({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),yn=rn(B({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),vn=rn(B({},cn,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},An={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _n(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=An[e])&&!!t[e]}function xn(){return _n}var En=rn(B({},un,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=en(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?bn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xn,charCode:function(e){return"keypress"===e.type?en(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?en(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),kn=rn(B({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Sn=rn(B({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xn})),In=rn(B({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Tn=rn(B({},hn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Cn=[9,13,27,32],Pn=u&&"CompositionEvent"in window,On=null;u&&"documentMode"in document&&(On=document.documentMode);var Nn=u&&"TextEvent"in window&&!On,Rn=u&&(!Pn||On&&8<On&&11>=On),Mn=String.fromCharCode(32),Un=!1;function Ln(e,t){switch(e){case"keyup":return-1!==Cn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Dn=!1;var jn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!jn[e.type]:"textarea"===t}function zn(e,t,n,r){ke(r),0<(t=Wr(t,"onChange")).length&&(n=new ln("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Wn=null,qn=null;function Hn(e){Mr(e,0)}function Vn(e){if(K(mi(e)))return e}function Gn(e,t){if("change"===e)return t}var Kn=!1;if(u){var Jn;if(u){var Zn="oninput"in document;if(!Zn){var Qn=document.createElement("div");Qn.setAttribute("oninput","return;"),Zn="function"===typeof Qn.oninput}Jn=Zn}else Jn=!1;Kn=Jn&&(!document.documentMode||9<document.documentMode)}function Yn(){Wn&&(Wn.detachEvent("onpropertychange",Xn),qn=Wn=null)}function Xn(e){if("value"===e.propertyName&&Vn(qn)){var t=[];zn(t,qn,e,be(e)),Pe(Hn,t)}}function $n(e,t,n){"focusin"===e?(Yn(),qn=n,(Wn=t).attachEvent("onpropertychange",Xn)):"focusout"===e&&Yn()}function er(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Vn(qn)}function tr(e,t){if("click"===e)return Vn(t)}function nr(e,t){if("input"===e||"change"===e)return Vn(t)}var rr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function ir(e,t){if(rr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!d.call(t,i)||!rr(e[i],t[i]))return!1}return!0}function sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function or(e,t){var n,r=sr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=sr(r)}}function ar(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ar(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function cr(){for(var e=window,t=J();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=J((e=t.contentWindow).document)}return t}function lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function ur(e){var t=cr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ar(n.ownerDocument.documentElement,n)){if(null!==r&&lr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=void 0===r.end?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=or(n,s);var o=or(n,r);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var dr=u&&"documentMode"in document&&11>=document.documentMode,hr=null,pr=null,fr=null,gr=!1;function mr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;gr||null==hr||hr!==J(r)||("selectionStart"in(r=hr)&&lr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},fr&&ir(fr,r)||(fr=r,0<(r=Wr(pr,"onSelect")).length&&(t=new ln("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=hr)))}function yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vr={animationend:yr("Animation","AnimationEnd"),animationiteration:yr("Animation","AnimationIteration"),animationstart:yr("Animation","AnimationStart"),transitionend:yr("Transition","TransitionEnd")},wr={},br={};function Ar(e){if(wr[e])return wr[e];if(!vr[e])return e;var t,n=vr[e];for(t in n)if(n.hasOwnProperty(t)&&t in br)return wr[e]=n[t];return e}u&&(br=document.createElement("div").style,"AnimationEvent"in window||(delete vr.animationend.animation,delete vr.animationiteration.animation,delete vr.animationstart.animation),"TransitionEvent"in window||delete vr.transitionend.transition);var _r=Ar("animationend"),xr=Ar("animationiteration"),Er=Ar("animationstart"),kr=Ar("transitionend"),Sr=new Map,Ir="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Tr(e,t){Sr.set(e,t),c(t,[e])}for(var Cr=0;Cr<Ir.length;Cr++){var Pr=Ir[Cr];Tr(Pr.toLowerCase(),"on"+(Pr[0].toUpperCase()+Pr.slice(1)))}Tr(_r,"onAnimationEnd"),Tr(xr,"onAnimationIteration"),Tr(Er,"onAnimationStart"),Tr("dblclick","onDoubleClick"),Tr("focusin","onFocus"),Tr("focusout","onBlur"),Tr(kr,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focu
2sin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Or="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Nr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Or));function Rr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,a,c,l){if(Fe.apply(this,arguments),Ue){if(!Ue)throw Error(s(198));var u=Le;Ue=!1,Le=null,Be||(Be=!0,De=u)}}(r,t,void 0,e),e.currentTarget=null}function Mr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,l=a.currentTarget;if(a=a.listener,c!==s&&i.isPropagationStopped())break e;Rr(i,a,l),s=c}else for(o=0;o<r.length;o++){if(c=(a=r[o]).instance,l=a.currentTarget,a=a.listener,c!==s&&i.isPropagationStopped())break e;Rr(i,a,l),s=c}}}if(Be)throw e=De,Be=!1,De=null,e}function Ur(e,t){var n=t[di];void 0===n&&(n=t[di]=new Set);var r=e+"__bubble";n.has(r)||(jr(t,e,2,!1),n.add(r))}function Lr(e,t,n){var r=0;t&&(r|=4),jr(n,e,r,t)}var Br="_reactListening"+Math.random().toString(36).slice(2);function Dr(e){if(!e[Br]){e[Br]=!0,o.forEach(function(t){"selectionchange"!==t&&(Nr.has(t)||Lr(t,!1,e),Lr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Br]||(t[Br]=!0,Lr("selectionchange",!1,t))}}function jr(e,t,n,r){switch(Zt(t)){case 1:var i=Ht;break;case 4:i=Vt;break;default:i=Gt}n=i.bind(null,t,n,e),i=void 0,!Ne||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Fr(e,t,n,r,i){var s=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var c=o.tag;if((3===c||4===c)&&((c=o.stateNode.containerInfo)===i||8===c.nodeType&&c.parentNode===i))return;o=o.return}for(;null!==a;){if(null===(o=fi(a)))return;if(5===(c=o.tag)||6===c){r=s=o;continue e}a=a.parentNode}}r=r.return}Pe(function(){var r=s,i=be(n),o=[];e:{var a=Sr.get(e);if(void 0!==a){var c=ln,l=e;switch(e){case"keypress":if(0===en(n))break e;case"keydown":case"keyup":c=En;break;case"focusin":l="focus",c=gn;break;case"focusout":l="blur",c=gn;break;case"beforeblur":case"afterblur":c=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=pn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=fn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=Sn;break;case _r:case xr:case Er:c=mn;break;case kr:c=In;break;case"scroll":c=dn;break;case"wheel":c=Tn;break;case"copy":case"cut":case"paste":c=yn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=kn}var u=0!==(4&t),d=!u&&"scroll"===e,h=u?null!==a?a+"Capture":null:a;u=[];for(var p,f=r;null!==f;){var g=(p=f).stateNode;if(5===p.tag&&null!==g&&(p=g,null!==h&&(null!=(g=Oe(f,h))&&u.push(zr(f,g,p)))),d)break;f=f.return}0<u.length&&(a=new c(a,l,null,n,i),o.push({event:a,listeners:u}))}}if(0===(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===we||!(l=n.relatedTarget||n.fromElement)||!fi(l)&&!l[ui])&&(c||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,c?(c=r,null!==(l=(l=n.relatedTarget||n.toElement)?fi(l):null)&&(l!==(d=ze(l))||5!==l.tag&&6!==l.tag)&&(l=null)):(c=null,l=r),c!==l)){if(u=pn,g="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(u=kn,g="onPointerLeave",h="onPointerEnter",f="pointer"),d=null==c?a:mi(c),p=null==l?a:mi(l),(a=new u(g,f+"leave",c,n,i)).target=d,a.relatedTarget=p,g=null,fi(i)===r&&((u=new u(h,f+"enter",l,n,i)).target=p,u.relatedTarget=d,g=u),d=g,c&&l)e:{for(h=l,f=0,p=u=c;p;p=qr(p))f++;for(p=0,g=h;g;g=qr(g))p++;for(;0<f-p;)u=qr(u),f--;for(;0<p-f;)h=qr(h),p--;for(;f--;){if(u===h||null!==h&&u===h.alternate)break e;u=qr(u),h=qr(h)}u=null}else u=null;null!==c&&Hr(o,a,c,u,!1),null!==l&&null!==d&&Hr(o,d,l,u,!0)}if("select"===(c=(a=r?mi(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===c&&"file"===a.type)var m=Gn;else if(Fn(a))if(Kn)m=nr;else{m=er;var y=$n}else(c=a.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(m=tr);
vendor: 86,190 bytes, line 2
2switch(m&&(m=m(e,r))?zn(o,m,n,i):(y&&y(e,a,r),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&ee(a,"number",a.value)),y=r?mi(r):window,e){case"focusin":(Fn(y)||"true"===y.contentEditable)&&(hr=y,pr=r,fr=null);break;case"focusout":fr=pr=hr=null;break;case"mousedown":gr=!0;break;case"contextmenu":case"mouseup":case"dragend":gr=!1,mr(o,n,i);break;case"selectionchange":if(dr)break;case"keydown":case"keyup":mr(o,n,i)}var v;if(Pn)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Dn?Ln(e,n)&&(w="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(w="onCompositionStart");w&&(Rn&&"ko"!==n.locale&&(Dn||"onCompositionStart"!==w?"onCompositionEnd"===w&&Dn&&(v=$t()):(Yt="value"in(Qt=i)?Qt.value:Qt.textContent,Dn=!0)),0<(y=Wr(r,w)).length&&(w=new vn(w,e,null,n,i),o.push({event:w,listeners:y}),v?w.data=v:null!==(v=Bn(n))&&(w.data=v))),(v=Nn?function(e,t){switch(e){case"compositionend":return Bn(t);case"keypress":return 32!==t.which?null:(Un=!0,Mn);case"textInput":return(e=t.data)===Mn&&Un?null:e;default:return null}}(e,n):function(e,t){if(Dn)return"compositionend"===e||!Pn&&Ln(e,t)?(e=$t(),Xt=Yt=Qt=null,Dn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Rn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Wr(r,"onBeforeInput")).length&&(i=new vn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=v))}Mr(o,t)})}function zr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Wr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,s=i.stateNode;5===i.tag&&null!==s&&(i=s,null!=(s=Oe(e,n))&&r.unshift(zr(e,s,i)),null!=(s=Oe(e,t))&&r.push(zr(e,s,i))),e=e.return}return r}function qr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Hr(e,t,n,r,i){for(var s=t._reactName,o=[];null!==n&&n!==r;){var a=n,c=a.alternate,l=a.stateNode;if(null!==c&&c===r)break;5===a.tag&&null!==l&&(a=l,i?null!=(c=Oe(n,s))&&o.unshift(zr(n,c,a)):i||null!=(c=Oe(n,s))&&o.push(zr(n,c,a))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var Vr=/\r\n?/g,Gr=/\u0000|\uFFFD/g;function Kr(e){return("string"===typeof e?e:""+e).replace(Vr,"\n").replace(Gr,"")}function Jr(e,t,n){if(t=Kr(t),Kr(e)!==t&&n)throw Error(s(425))}function Zr(){}var Qr=null,Yr=null;function Xr(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var $r="function"===typeof setTimeout?setTimeout:void 0,ei="function"===typeof clearTimeout?clearTimeout:void 0,ti="function"===typeof Promise?Promise:void 0,ni="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof ti?function(e){return ti.resolve(null).then(e).catch(ri)}:$r;function ri(e){setTimeout(function(){throw e})}function ii(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void zt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);zt(t)}function si(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function oi(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var ai=Math.random().toString(36).slice(2),ci="__reactFiber$"+ai,li="__reactProps$"+ai,ui="__reactContainer$"+ai,di="__reactEvents$"+ai,hi="__reactListeners$"+ai,pi="__reactHandles$"+ai;function fi(e){var t=e[ci];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ui]||n[ci]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=oi(e);null!==e;){if(n=e[ci])return n;e=oi(e)}return t}n=(e=n).parentNode}return null}function gi(e){return!(e=e[ci]||e[ui])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function mi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(s(33))}function yi(e){return e[li]||null}var vi=[],wi=-1;function bi(e){return{current:e}}function Ai(e){0>wi||(e.current=vi[wi],vi[wi]=null,wi--)}function _i(e,t){wi++,vi[wi]=e.current,e.current=t}var xi={},Ei=bi(xi),ki=bi(!1),Si=xi;function Ii(e,t){var n=e.type.contextTypes;if(!n)return xi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in n)s[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ti(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Ci(){Ai(ki),Ai(Ei)}function Pi(e,t,n){if(Ei.current!==xi)throw Error(s(168));_i(Ei,t),_i(ki,n)}function Oi(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(s(108,q(e)||"Unknown",i));return B({},n,r)}function Ni(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xi,Si=Ei.current,_i(Ei,e),_i(ki,ki.current),!0}function Ri(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=Oi(e,t,Si),r.__reactInternalMemoizedMergedChildContext=e,Ai(ki),Ai(Ei),_i(Ei,e)):Ai(ki),_i(ki,n)}var Mi=null,Ui=!1,Li=!1;function Bi(e){null===Mi?Mi=[e]:Mi.push(e)}function Di(){if(!Li&&null!==Mi){Li=!0;var e=0,t=vt;try{var n=Mi;for(vt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Mi=null,Ui=!1}catch(i){throw null!==Mi&&(Mi=Mi.slice(e+1)),Ge(Xe,Di),i}finally{vt=t,Li=!1}}return null}var ji=[],Fi=0,zi=null,Wi=0,qi=[],Hi=0,Vi=null,Gi=1,Ki="";function Ji(e,t){ji[Fi++]=Wi,ji[Fi++]=zi,zi=e,Wi=t}function Zi(e,t,n){qi[Hi++]=Gi,qi[Hi++]=Ki,qi[Hi++]=Vi,Vi=e;var r=Gi;e=Ki;var i=32-st(r)-1;r&=~(1<<i),n+=1;var s=32-st(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-st(t)+i|n<<i|r,Ki=s+e}else Gi=1<<s|n<<i|r,Ki=e}function Qi(e){null!==e.return&&(Ji(e,1),Zi(e,1,0))}function Yi(e){for(;e===zi;)zi=ji[--Fi],ji[Fi]=null,Wi=ji[--Fi],ji[Fi]=null;for(;e===Vi;)Vi=qi[--Hi],qi[Hi]=null,Ki=qi[--Hi],qi[Hi]=null,Gi=qi[--Hi],qi[Hi]=null}var Xi=null,$i=null,es=!1,ts=null;function ns(e,t){var n=Il(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function rs(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Xi=e,$i=si(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Xi=e,$i=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Vi?{id:Gi,overflow:Ki}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Il(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Xi=e,$i=null,!0);default:return!1}}function is(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function ss(e){if(es){var t=$i;if(t){var n=t;if(!rs(e,t)){if(is(e))throw Error(s(418));t=si(n.nextSibling);var r=Xi;t&&rs(e,t)?ns(r,n):(e.flags=-4097&e.flags|2,es=!1,Xi=e)}}else{if(is(e))throw Error(s(418));e.flags=-4097&e.flags|2,es=!1,Xi=e}}}function os(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Xi=e}function as(e){if(e!==Xi)return!1;if(!es)return os(e),es=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Xr(e.type,e.memoizedProps)),t&&(t=$i)){if(is(e))throw cs(),Error(s(418));for(;t;)ns(e,t),t=si(t.nextSibling)}if(os(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){$i=si(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}$i=null}}else $i=Xi?si(e.stateNode.nextSibling):null;return!0}function cs(){for(var e=$i;e;)e=si(e.nextSibling)}function ls(){$i=Xi=null,es=!1}function us(e){null===ts?ts=[e]:ts.push(e)}var ds=b.ReactCurrentBatchConfig;function hs(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(s(309));var r=n.stateNode}if(!r)throw Error(s(147,e));var i=r,o=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs;null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!==typeof e)throw Error(s(284));if(!n._owner)throw Error(s(290,e))}return e}function ps(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fs(e){return(0,e._init)(e._payload)}function gs(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Cl(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function c(e,t,n,r){return null===t||6!==t.tag?((t=Rl(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function l(e,t,n,r){var s=n.type;return s===x?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===s||"object"===typeof s&&null!==s&&s.$$typeof===N&&fs(s)===t.type)?((r=i(t,n.props)).ref=hs(e,t,n),r.return=e,r):((r=Pl(n.type,n.key,n.props,null,e.mode,r)).ref=hs(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Ml(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,s){return null===t||7!==t.tag?((t=Ol(n,e.mode,r,s)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Rl(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case A:return(n=Pl(t.type,t.key,t.props,null,e.mode,n)).ref=hs(e,null,t),n.return=e,n;case _:return(t=Ml(t,e.mode,n)).return=e,t;case N:return h(e,(0,t._init)(t._payload),n)}if(te(t)||U(t))return(t=Ol(t,e.mode,n,null)).return=e,t;ps(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==i?null:c(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case A:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case N:return p(e,t,(i=n._init)(n._payload),r)}if(te(n)||U(n))return null!==i?null:d(e,t,n,r,null);ps(e,n)}return null}function f(e,t,n,r,i){if("string"===typeof r&&""!==r||"number"===typeof r)return c(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case A:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i);case _:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case N:return f(e,t,n,(0,r._init)(r._payload),i)}if(te(r)||U(r))return d(t,e=e.get(n)||null,r,i,null);ps(t,r)}return null}function g(i,s,a,c){for(var l=null,u=null,d=s,g=s=0,m=null;null!==d&&g<a.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var y=p(i,d,a[g],c);if(null===y){null===d&&(d=m);break}e&&d&&null===y.alternate&&t(i,d),s=o(y,s,g),null===u?l=y:u.sibling=y,u=y,d=m}if(g===a.length)return n(i,d),es&&Ji(i,g),l;if(null===d){for(;g<a.length;g++)null!==(d=h(i,a[g],c))&&(s=o(d,s,g),null===u?l=d:u.sibling=d,u=d);return es&&Ji(i,g),l}for(d=r(i,d);g<a.length;g++)null!==(m=f(d,i,g,a[g],c))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),s=o(m,s,g),null===u?l=m:u.sibling=m,u=m);return e&&d.forEach(function(e){return t(i,e)}),es&&Ji(i,g),l}function m(i,a,c,l){var u=U(c);if("function"!==typeof u)throw Error(s(150));if(null==(c=u.call(c)))throw Error(s(151));for(var d=u=null,g=a,m=a=0,y=null,v=c.next();null!==g&&!v.done;m++,v=c.next()){g.index>m?(y=g,g=null):y=g.sibling;var w=p(i,g,v.value,l);if(null===w){null===g&&(g=y);break}e&&g&&null===w.alternate&&t(i,g),a=o(w,a,m),null===d?u=w:d.sibling=w,d=w,g=y}if(v.done)return n(i,g),es&&Ji(i,m),u;if(null===g){for(;!v.done;m++,v=c.next())null!==(v=h(i,v.value,l))&&(a=o(v,a,m),null===d?u=v:d.sibling=v,d=v);return es&&Ji(i,m),u}for(g=r(i,g);!v.done;m++,v=c.next())null!==(v=f(g,i,m,v.value,l))&&(e&&null!==v.alternate&&g.delete(null===v.key?m:v.key),a=o(v,a,m),null===d?u=v:d.sibling=v,d=v);return e&&g.forEach(function(e){return t(i,e)}),es&&Ji(i,m),u}return function e(r,s,o,c){if("object"===typeof o&&null!==o&&o.type===x&&null===o.key&&(o=o.props.children),"object"===typeof o&&null!==o){switch(o.$$typeof){case A:e:{for(var l=o.key,u=s;null!==u;){if(u.key===l){if((l=o.type)===x){if(7===u.tag){n(r,u.sibling),(s=i(u,o.props.children)).return=r,r=s;break e}}else if(u.elementType===l||"object"===typeof l&&null!==l&&l.$$typeof===N&&fs(l)===u.type){n(r,u.sibling),(s=i(u,o.props)).ref=hs(r,u,o),s.return=r,r=s;break e}n(r,u);break}t(r,u),u=u.sibling}o.type===x?((s=Ol(o.props.children,r.mode,c,o.key)).return=r,r=s):((c=Pl(o.type,o.key,o.props,null,r.mode,c)).ref=hs(r,s,o),c.return=r,r=c)}return a(r);case _:e:{for(u=o.key;null!==s;){if(s.key===u){if(4===s.tag&&s.stateNode.containerInfo===o.containerInfo&&s.stateNode.implementation===o.implementation){n(r,s.sibling),(s=i(s,o.children||[])).return=r,r=s;break e}n(r,s);break}t(r,s),s=s.sibling}(s=Ml(o,r.mode,c)).return=r,r=s}return a(r);case N:return e(r,s,(u=o._init)(o._payload),c)}if(te(o))return g(r,s,o,c);if(U(o))return m(r,s,o,c);ps(r,o)}return"string"===typeof o&&""!==o||"number"===typeof o?(o=""+o,null!==s&&6===s.tag?(n(r,s.sibling),(s=i(s,o)).return=r,r=s):(n(r,s),(s=Rl(o,r.mode,c)).return=r,r=s),a(r)):n(r,s)}}var ms=gs(!0),ys=gs(!1),vs=bi(null),ws=null,bs=null,As=null;function _s(){As=bs=ws=null}function xs(e){var t=vs.current;Ai(vs),e._currentValue=t}function Es(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ks(e,t){ws=e,As=bs=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ga=!0),e.firstContext=null)}function Ss(e){var t=e._currentValue;if(As!==e)if(e={context:e,memoizedValue:t,next:null},null===bs){if(null===ws)throw Error(s(308));bs=e,ws.dependencies={lanes:0,firstContext:e}}else bs=bs.next=e;return t}var Is=null;function Ts(e){null===Is?Is=[e]:Is.push(e)}function Cs(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Ts(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ps(e,r)}function Ps(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Os=!1;function Ns(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ms(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Us(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&Ec)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ps(e,n)}return null===(i=r.interleaved)?(t.next=t,Ts(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ps(e,n)}function Ls(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}function Bs(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ds(e,t,n,r){var i=e.updateQueue;Os=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var c=a,l=c.next;c.next=null,null===o?s=l:o.next=l,o=c;var u=e.alternate;null!==u&&((a=(u=u.updateQueue).lastBaseUpdate)!==o&&(null===a?u.firstBaseUpdate=l:a.next=l,u.lastBaseUpdate=c))}if(null!==s){var d=i.baseState;for(o=0,u=l=c=null,a=s;;){var h=a.lane,p=a.eventTime;if((r&h)===h){null!==u&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var f=e,g=a;switch(h=t,p=n,g.tag){case 1:if("function"===typeof(f=g.payload)){d=f.call(p,d,h);break e}d=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(h="function"===typeof(f=g.payload)?f.call(p,d,h):f)||void 0===h)break e;d=B({},d,h);break e;case 2:Os=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===u?(l=u=p,c=d):u=u.next=p,o|=h;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(h=a).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===u&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{o|=i.lane,i=i.next}while(i!==t)}else null===s&&(i.shared.lanes=0);Nc|=o,e.lanes=o,e.memoizedState=d}}function js(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!==typeof i)throw Error(s(191,i));i.call(r)}}}var Fs={},zs=bi(Fs),Ws=bi(Fs),qs=bi(Fs);function Hs(e){if(e===Fs)throw Error(s(174));return e}function Vs(e,t){switch(_i(qs,t),_i(Ws,e),_i(zs,Fs),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ce(null,"");break;default:t=ce(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Ai(zs),_i(zs,t)}function Gs(){Ai(zs),Ai(Ws),Ai(qs)}function Ks(e){Hs(qs.current);var t=Hs(zs.current),n=ce(t,e.type);t!==n&&(_i(Ws,e),_i(zs,n))}function Js(e){Ws.current===e&&(Ai(zs),Ai(Ws))}var Zs=bi(0);function Qs(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ys=[];function Xs(){for(var e=0;e<Ys.length;e++)Ys[e]._workInProgressVersionPrimary=null;Ys.length=0}var $s=b.ReactCurrentDispatcher,eo=b.ReactCurrentBatchConfig,to=0,no=null,ro=null,io=null,so=!1,oo=!1,ao=0,co=0;function lo(){throw Error(s(321))}function uo(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rr(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,o){if(to=o,no=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$s.current=null===e||null===e.memoizedState?Zo:Qo,e=n(r,i),oo){o=0;do{if(oo=!1,ao=0,25<=o)throw Error(s(301));o+=1,io=ro=null,t.updateQueue=null,$s.current=Yo,e=n(r,i)}while(oo)}if($s.current=Jo,t=null!==ro&&null!==ro.next,to=0,io=ro=no=null,so=!1,t)throw Error(s(300));return e}function po(){var e=0!==ao;return ao=0,e}function fo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===io?no.memoizedState=io=e:io=io.next=e,io}function go(){if(null===ro){var e=no.alternate;e=null!==e?e.memoizedState:null}else e=ro.next;var t=null===io?no.memoizedState:io.next;if(null!==t)io=t,ro=e;else{if(null===e)throw Error(s(310));e={memoizedState:(ro=e).memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},null===io?no.memoizedState=io=e:io=io.next=e}return io}function mo(e,t){return"function"===typeof t?t(e):t}function yo(e){var t=go(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=ro,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(null!==i){o=i.next,r=r.baseState;var c=a=null,l=null,u=o;do{var d=u.lane;if((to&d)===d)null!==l&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===l?(c=l=h,a=r):l=l.next=h,no.lanes|=d,Nc|=d}u=u.next}while(null!==u&&u!==o);null===l?a=r:l.next=c,rr(r,t.memoizedState)||(ga=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{o=i.lane,no.lanes|=o,Nc|=o,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function vo(e){var t=go(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);rr(o,t.memoizedState)||(ga=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function wo(){}function bo(e,t){var n=no,r=go(),i=t(),o=!rr(r.memoizedState,i);if(o&&(r.memoizedState=i,ga=!0),r=r.queue,No(xo.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==io&&1&io.memoizedState.tag){if(n.flags|=2048,Io(9,_o.bind(null,n,r,i,t),void 0,null),null===kc)throw Error(s(349));0!==(30&to)||Ao(n,t,i)}return i}function Ao(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=no.updateQueue)?(t={lastEffect:null,stores:null},no.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function _o(e,t,n,r){t.value=n,t.getSnapshot=r,Eo(t)&&ko(e)}function xo(e,t,n){return n(function(){Eo(t)&&ko(e)})}function Eo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rr(e,n)}catch(r){return!0}}function ko(e){var t=Ps(e,1);null!==t&&Xc(t,e,1,-1)}function So(e){var t=fo();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:e},t.queue=e,e=e.dispatch=Ho.bind(null,no,e),[t.memoizedState,e]}function Io(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=no.updateQueue)?(t={lastEffect:null,stores:null},no.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function To(){return go().memoizedState}function Co(e,t,n,r){var i=fo();no.flags|=e,i.memoizedState=Io(1|t,n,void 0,void 0===r?null:r)}function Po(e,t,n,r){var i=go();r=void 0===r?null:r;var s=void 0;if(null!==ro){var o=ro.memoizedState;if(s=o.destroy,null!==r&&uo(r,o.deps))return void(i.memoizedState=Io(t,n,s,r))}no.flags|=e,i.memoizedState=Io(1|t,n,s,r)}function Oo(e,t){return Co(8390656,8,e,t)}function No(e,t){return Po(2048,8,e,t)}function Ro(e,t){return Po(4,2,e,t)}function Mo(e,t){return Po(4,4,e,t)}function Uo(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Lo(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Po(4,4,Uo.bind(null,t,e),n)}function Bo(){}function Do(e,t){var n=go();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&uo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function jo(e,t){var n=go();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&uo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Fo(e,t,n){return 0===(21&to)?(e.baseState&&(e.baseState=!1,ga=!0),e.memoizedState=n):(rr(n,t)||(n=ft(),no.lanes|=n,Nc|=n,e.baseState=!0),t)}function zo(e,t){var n=vt;vt=0!==n&&4>n?n:4,e(!0);var r=eo.transition;eo.transition={};try{e(!1),t()}finally{vt=n,eo.transition=r}}function Wo(){return go().memoizedState}function qo(e,t,n){var r=Yc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Vo(e))Go(t,n);else if(null!==(n=Cs(e,t,n,r))){Xc(n,e,r,Qc()),Ko(n,t,r)}}function Ho(e,t,n){var r=Yc(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vo(e))Go(t,i);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,rr(a,o)){var c=t.interleaved;return null===c?(i.next=i,Ts(t)):(i.next=c.next,c.next=i),void(t.interleaved=i)}}catch(l){}null!==(n=Cs(e,t,i,r))&&(Xc(n,e,r,i=Qc()),Ko(n,t,r))}}function Vo(e){var t=e.alternate;return e===no||null!==t&&t===no}function Go(e,t){oo=so=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ko(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}var Jo={readContext:Ss,useCallback:lo,useContext:lo,useEffect:lo,useImperativeHandle:lo,useInsertionEffect:lo,useLayoutEffect:lo,useMemo:lo,useReducer:lo,useRef:lo,useState:lo,useDebugValue:lo,useDeferredValue:lo,useTransition:lo,useMutableSource:lo,useSyncExternalStore:lo,useId:lo,unstable_isNewReconciler:!1},Zo={readContext:Ss,useCallback:function(e,t){return fo().memoizedState=[e,void 0===t?null:t],e},useContext:Ss,useEffect:Oo,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Co(4194308,4,Uo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Co(4194308,4,e,t)},useInsertionEffect:function(e,t){return Co(4,2,e,t)},useMemo:function(e,t){var n=fo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qo.bind(null,no,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},fo().memoizedState=e},useState:So,useDebugValue:Bo,useDeferredValue:function(e){return fo().memoizedState=e},useTransition:function(){var e=So(!1),t=e[0];return e=zo.bind(null,e[1]),fo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=no,i=fo();if(es){if(void 0===n)throw Error(s(407));n=n()}else{if(n=t(),null===kc)throw Error(s(349));0!==(30&to)||Ao(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Oo(xo.bind(null,r,o,e),[e]),r.flags|=2048,Io(9,_o.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=fo(),t=kc.identifierPrefix;if(es){var n=Ki;t=":"+t+"R"+(n=(Gi&~(1<<32-st(Gi)-1)).toString(32)+n),0<(n=ao++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=co++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Qo={readContext:Ss,useCallback:Do,useContext:Ss,useEffect:No,useImperativeHandle:Lo,useInsertionEffect:Ro,useLayoutEffect:Mo,useMemo:jo,useReducer:yo,useRef:To,useState:function(){return yo(mo)},useDebugValue:Bo,useDeferredValue:function(e){return Fo(go(),ro.memoizedState,e)},useTransition:function(){return[yo(mo)[0],go().memoizedState]},useMutableSource:wo,useSyncExternalStore:bo,useId:Wo,unstable_isNewReconciler:!1},Yo={readContext:Ss,useCallback:Do,useContext:Ss,useEffect:No,useImperativeHandle:Lo,useInsertionEffect:Ro,useLayoutEffect:Mo,useMemo:jo,useReducer:vo,useRef:To,useState:function(){return vo(mo)},useDebugValue:Bo,useDeferredValue:function(e){var t=go();return null===ro?t.memoizedState=e:Fo(t,ro.memoizedState,e)},useTransition:function(){return[vo(mo)[0],go().memoizedState]},useMutableSource:wo,useSyncExternalStore:bo,useId:Wo,unstable_isNewReconciler:!1};function Xo(e,t){if(e&&e.defaultProps){for(var n in t=B({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function $o(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:B({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ea={isMounted:function(e){return!!(e=e._reactInternals)&&ze(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qc(),i=Yc(e),s=Ms(r,i);s.payload=t,void 0!==n&&null!==n&&(s.callback=n),null!==(t=Us(e,s,i))&&(Xc(t,e,i,r),Ls(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qc(),i=Yc(e),s=Ms(r,i);s.tag=1,s.payload=t,void 0!==n&&null!==n&&(s.callback=n),null!==(t=Us(e,s,i))&&(Xc(t,e,i,r),Ls(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qc(),r=Yc(e),i=Ms(n,r);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),null!==(t=Us(e,i,r))&&(Xc(t,e,r,n),Ls(t,e,r))}};function ta(e,t,n,r,i,s,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,s,o):!t.prototype||!t.prototype.isPureReactComponent||(!ir(n,r)||!ir(i,s))}function na(e,t,n){var r=!1,i=xi,s=t.contextType;return"object"===typeof s&&null!==s?s=Ss(s):(i=Ti(t)?Si:Ei.current,s=(r=null!==(r=t.contextTypes)&&void 0!==r)?Ii(e,i):xi),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ea,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function ra(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ea.enqueueReplaceState(t,t.state,null)}function ia(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ns(e);var s=t.contextType;"object"===typeof s&&null!==s?i.context=Ss(s):(s=Ti(t)?Si:Ei.current,i.context=Ii(e,s)),i.state=e.memoizedState,"function"===typeof(s=t.getDerivedStateFromProps)&&($o(e,t,s,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ea.enqueueReplaceState(i,i.state,null),Ds(e,n,i,r),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4194308)}function sa(e,t){try{var n="",r=t;do{n+=z(r),r=r.return}while(r);var i=n}catch(s){i="\nError generating stack: "+s.message+"\n"+s.stack}return{value:e,source:t,stack:i,digest:null}}function oa(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function aa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ca="function"===typeof WeakMap?WeakMap:Map;function la(e,t,n){(n=Ms(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Fc||(Fc=!0,zc=r),aa(0,t)},n}function ua(e,t,n){(n=Ms(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){aa(0,t)}}var s=e.stateNode;return null!==s&&"function"===typeof s.componentDidCatch&&(n.callback=function(){aa(0,t),"function"!==typeof r&&(null===Wc?Wc=new Set([this]):Wc.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function da(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ca;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Al.bind(null,e,t,n),t.then(e,e))}function ha(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function pa(e,t,n,r,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ms(-1,1)).tag=2,Us(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var fa=b.ReactCurrentOwner,ga=!1;function ma(e,t,n,r){t.child=null===e?ys(t,null,n,r):ms(t,e.child,n,r)}function ya(e,t,n,r,i){n=n.render;var s=t.ref;return ks(t,i),r=ho(e,t,n,r,s,i),n=po(),null===e||ga?(es&&n&&Qi(t),t.flags|=1,ma(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Fa(e,t,i))}function va(e,t,n,r,i){if(null===e){var s=n.type;return"function"!==typeof s||Tl(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Pl(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,wa(e,t,s,r,i))}if(s=e.child,0===(e.lanes&i)){var o=s.memoizedProps;if((n=null!==(n=n.compare)?n:ir)(o,r)&&e.ref===t.ref)return Fa(e,t,i)}return t.flags|=1,(e=Cl(s,r)).ref=t.ref,e.return=t,t.child=e}function wa(e,t,n,r,i){if(null!==e){var s=e.memoizedProps;if(ir(s,r)&&e.ref===t.ref){if(ga=!1,t.pendingProps=r=s,0===(e.lanes&i))return t.lanes=e.lanes,Fa(e,t,i);0!==(131072&e.flags)&&(ga=!0)}}return _a(e,t,n,r,i)}function ba(e,t,n){var r=t.pendingProps,i=r.children,s=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_i(Cc,Tc),Tc|=n;else{if(0===(1073741824&n))return e=null!==s?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_i(Cc,Tc),Tc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==s?s.baseLanes:n,_i(Cc,Tc),Tc|=r}else null!==s?(r=s.baseLanes|n,t.memoizedState=null):r=n,_i(Cc,Tc),Tc|=r;return ma(e,t,i,n),t.child}function Aa(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function _a(e,t,n,r,i){var s=Ti(n)?Si:Ei.current;return s=Ii(t,s),ks(t,i),n=ho(e,t,n,r,s,i),r=po(),null===e||ga?(es&&r&&Qi(t),t.flags|=1,ma(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Fa(e,t,i))}function xa(e,t,n,r,i){if(Ti(n)){var s=!0;Ni(t)}else s=!1;if(ks(t,i),null===t.stateNode)ja(e,t),na(t,n,r),ia(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,l=n.contextType;"object"===typeof l&&null!==l?l=Ss(l):l=Ii(t,l=Ti(n)?Si:Ei.current);var u=n.getDerivedStateFromProps,d="function"===typeof u||"function"===typeof o.getSnapshotBeforeUpdate;d||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(a!==r||c!==l)&&ra(t,o,r,l),Os=!1;var h=t.memoizedState;o.state=h,Ds(t,r,o,i),c=t.memoizedState,a!==r||h!==c||ki.current||Os?("function"===typeof u&&($o(t,n,u,r),c=t.memoizedState),(a=Os||ta(t,n,a,r,h,c,l))?(d||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4194308)):("function"===typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=a):("function"===typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Rs(e,t),a=t.memoizedProps,l=t.type===t.elementType?a:Xo(t.type,a),o.props=l,d=t.pendingProps,h=o.context,"object"===typeof(c=n.contextType)&&null!==c?c=Ss(c):c=Ii(t,c=Ti(n)?Si:Ei.current);var p=n.getDerivedStateFromProps;(u="function"===typeof p||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(a!==d||h!==c)&&ra(t,o,r,c),Os=!1,h=t.memoizedState,o.state=h,Ds(t,r,o,i);var f=t.memoizedState;a!==d||h!==f||ki.current||Os?("function"===typeof p&&($o(t,n,p,r),f=t.memoizedState),(l=Os||ta(t,n,l,r,h,f,c)||!1)?(u||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,f,c),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,f,c)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),o.props=r,o.state=f,o.context=c,r=l):("function"!==typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Ea(e,t,n,r,s,i)}function Ea(e,t,n,r,i,s){Aa(e,t);var o=0!==(128&t.flags);if(!r&&!o)return i&&Ri(t,n,!1),Fa(e,t,s);r=t.stateNode,fa.current=t;var a=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=ms(t,e.child,null,s),t.child=ms(t,null,a,s)):ma(e,t,a,s),t.memoizedState=r.state,i&&Ri(t,n,!0),t.child}function ka(e){var t=e.stateNode;t.pendingContext?Pi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Pi(0,t.context,!1),Vs(e,t.containerInfo)}function Sa(e,t,n,r,i){return ls(),us(i),t.flags|=256,ma(e,t,n,r),t.child}var Ia,Ta,Ca,Pa,Oa={dehydrated:null,treeContext:null,retryLane:0};function Na(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ra(e,t,n){var r,i=t.pendingProps,o=Zs.current,a=!1,c=0!==(128&t.flags);if((r=c)||(r=(null===e||null!==e.memoizedState)&&0!==(2&o)),r?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),_i(Zs,1&o),null===e)return ss(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(c=i.children,e=i.fallback,a?(i=t.mode,a=t.child,c={mode:"hidden",children:c},0===(1&i)&&null!==a?(a.childLanes=0,a.pendingProps=c):a=Nl(c,i,0,null),e=Ol(e,i,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Na(n),t.memoizedState=Oa,e):Ma(t,c));if(null!==(o=e.memoizedState)&&null!==(r=o.dehydrated))return function(e,t,n,r,i,o,a){if(n)return 256&t.flags?(t.flags&=-257,Ua(e,t,a,r=oa(Error(s(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Nl({mode:"visible",children:r.children},i,0,null),(o=Ol(o,i,a,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,0!==(1&t.mode)&&ms(t,e.child,null,a),t.child.memoizedState=Na(a),t.memoizedState=Oa,o);if(0===(1&t.mode))return Ua(e,t,a,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var c=r.dgst;return r=c,Ua(e,t,a,r=oa(o=Error(s(419)),r,void 0))}if(c=0!==(a&e.childLanes),ga||c){if(null!==(r=kc)){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(r.suspendedLanes|a))?0:i)&&i!==o.retryLane&&(o.retryLane=i,Ps(e,i),Xc(r,e,i,-1))}return dl(),Ua(e,t,a,r=oa(Error(s(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=xl.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,$i=si(i.nextSibling),Xi=t,es=!0,ts=null,null!==e&&(qi[Hi++]=Gi,qi[Hi++]=Ki,qi[Hi++]=Vi,Gi=e.id,Ki=e.overflow,Vi=t),t=Ma(t,r.children),t.flags|=4096,t)}(e,t,c,i,r,o,n);if(a){a=i.fallback,c=t.mode,r=(o=e.child).sibling;var l={mode:"hidden",children:i.children};return 0===(1&c)&&t.child!==o?((i=t.child).childLanes=0,i.pendingProps=l,t.deletions=null):(i=Cl(o,l)).subtreeFlags=14680064&o.subtreeFlags,null!==r?a=Cl(r,a):(a=Ol(a,c,n,null)).flags|=2,a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,c=null===(c=e.child.memoizedState)?Na(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},a.memoizedState=c,a.childLanes=e.childLanes&~n,t.memoizedState=Oa,i}return e=(a=e.child).sibling,i=Cl(a,{mode:"visible",children:i.children}),0===(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Ma(e,t){return(t=Nl({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ua(e,t,n,r){return null!==r&&us(r),ms(t,e.child,null,n),(e=Ma(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function La(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Es(e.return,t,n)}function Ba(e,t,n,r,i){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Da(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(ma(e,t,r.children,n),0!==(2&(r=Zs.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&La(e,n,t);else if(19===e.tag)La(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(_i(Zs,r),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Qs(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ba(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Qs(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ba(t,!0,n,null,s);break;case"together":Ba(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ja(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Fa(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Nc|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(s(153));if(null!==t.child){for(n=Cl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Cl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function za(e,t){if(!es)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Wa(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qa(e,t,n){var r=t.pendingProps;switch(Yi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wa(t),null;case 1:case 17:return Ti(t.type)&&Ci(),Wa(t),null;case 3:return r=t.stateNode,Gs(),Ai(ki),Ai(Ei),Xs(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(as(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==ts&&(nl(ts),ts=null))),Ta(e,t),Wa(t),null;case 5:Js(t);var i=Hs(qs.current);if(n=t.type,null!==e&&null!=t.stateNode)Ca(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(s(166));return Wa(t),null}if(e=Hs(zs.current),as(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[ci]=t,r[li]=o,e=0!==(1&t.mode),n){case"dialog":Ur("cancel",r),Ur("close",r);break;case"iframe":case"object":case"embed":Ur("load",r);break;case"video":case"audio":for(i=0;i<Or.length;i++)Ur(Or[i],r);break;case"source":Ur("error",r);break;case"img":case"image":case"link":Ur("error",r),Ur("load",r);break;case"details":Ur("toggle",r);break;case"input":Q(r,o),Ur("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Ur("invalid",r);break;case"textarea":ie(r,o),Ur("invalid",r)}for(var c in ye(n,o),i=null,o)if(o.hasOwnProperty(c)){var l=o[c];"children"===c?"string"===typeof l?r.textContent!==l&&(!0!==o.suppressHydrationWarning&&Jr(r.textContent,l,e),i=["children",l]):"number"===typeof l&&r.textContent!==""+l&&(!0!==o.suppressHydrationWarning&&Jr(r.textContent,l,e),i=["children",""+l]):a.hasOwnProperty(c)&&null!=l&&"onScroll"===c&&Ur("scroll",r)}switch(n){case"input":G(r),$(r,o,!0);break;case"textarea":G(r),oe(r);break;case"select":case"option":break;default:"function"===typeof o.onClick&&(r.onclick=Zr)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{c=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ae(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[ci]=t,e[li]=r,Ia(e,t,!1,!1),t.stateNode=e;e:{switch(c=ve(n,r),n){case"dialog":Ur("cancel",e),Ur("close",e),i=r;break;case"iframe":case"object":case"embed":Ur("load",e),i=r;break;case"video":case"audio":for(i=0;i<Or.length;i++)Ur(Or[i],e);i=r;break;case"source":Ur("error",e),i=r;break;case"img":case"image":case"link":Ur("error",e),Ur("load",e),i=r;break;case"details":Ur("toggle",e),i=r;break;case"input":Q(e,r),i=Z(e,r),Ur("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=B({},r,{value:void 0}),Ur("invalid",e);break;case"textarea":ie(e,r),i=re(e,r),Ur("invalid",e)}for(o in ye(n,i),l=i)if(l.hasOwnProperty(o)){var u=l[o];"style"===o?ge(e,u):"dangerouslySetInnerHTML"===o?null!=(u=u?u.__html:void 0)&&ue(e,u):"children"===o?"string"===typeof u?("textarea"!==n||""!==u)&&de(e,u):"number"===typeof u&&de(e,""+u):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(a.hasOwnProperty(o)?null!=u&&"onScroll"===o&&Ur("scroll",e):null!=u&&w(e,o,u,c))}switch(n){case"input":G(e),$(e,r,!1);break;case"textarea":G(e),oe(e);break;case"option":null!=r.value&&e.setAttribute("value",""+H(r.value));break;case"select":e.multiple=!!r.multiple,null!=(o=r.value)?ne(e,!!r.multiple,o,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=Zr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Wa(t),null;case 6:if(e&&null!=t.stateNode)Pa(e,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(s(166));if(n=Hs(qs.current),Hs(zs.current),as(t)){if(r=t.stateNode,n=t.memoizedProps,r[ci]=t,(o=r.nodeValue!==n)&&null!==(e=Xi))switch(e.tag){case 3:Jr(r.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Jr(r.nodeValue,n,0!==(1&e.mode))}o&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[ci]=t,t.stateNode=r}return Wa(t),null;case 13:if(Ai(Zs),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(es&&null!==$i&&0!==(1&t.mode)&&0===(128&t.flags))cs(),ls(),t.flags|=98560,o=!1;else if(o=as(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(s(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(s(317));o[ci]=t}else ls(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Wa(t),o=!1}else null!==ts&&(nl(ts),ts=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&Zs.current)?0===Pc&&(Pc=3):dl())),null!==t.updateQueue&&(t.flags|=4),Wa(t),null);case 4:return Gs(),Ta(e,t),null===e&&Dr(t.stateNode.containerInfo),Wa(t),null;case 10:return xs(t.type._context),Wa(t),null;case 19:if(Ai(Zs),null===(o=t.memoizedState))return Wa(t),null;if(r=0!==(128&t.flags),null===(c=o.rendering))if(r)za(o,!1);else{if(0!==Pc||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(c=Qs(e))){for(t.flags|=128,za(o,!1),null!==(r=c.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(o=n).flags&=14680066,null===(c=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,e=c.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _i(Zs,1&Zs.current|2),t.child}e=e.sibling}null!==o.tail&&Qe()>Dc&&(t.flags|=128,r=!0,za(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Qs(c))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),za(o,!0),null===o.tail&&"hidden"===o.tailMode&&!c.alternate&&!es)return Wa(t),null}else 2*Qe()-o.renderingStartTime>Dc&&1073741824!==n&&(t.flags|=128,r=!0,za(o,!1),t.lanes=4194304);o.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=o.last)?n.sibling=c:t.child=c,o.last=c)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qe(),t.sibling=null,n=Zs.current,_i(Zs,r?1&n|2:1&n),t):(Wa(t),null);case 22:case 23:return al(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Tc)&&(Wa(t),6&t.subtreeFlags&&(t.flags|=8192)):Wa(t),null;case 24:case 25:return null}throw Error(s(156,t.tag))}function Ha(e,t){switch(Yi(t),t.tag){case 1:return Ti(t.type)&&Ci(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Gs(),Ai(ki),Ai(Ei),Xs(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Js(t),null;case 13:if(Ai(Zs),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(s(340));ls()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Ai(Zs),null;case 4:return Gs(),null;case 10:return xs(t.type._context),null;case 22:case 23:return al(),null;default:return null}}Ia=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ta=function(){},Ca=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Hs(zs.current);var s,o=null;switch(n){case"input":i=Z(e,i),r=Z(e,r),o=[];break;case"select":i=B({},i,{value:void 0}),r=B({},r,{value:void 0}),o=[];break;case"textarea":i=re(e,i),r=re(e,r),o=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=Zr)}for(u in ye(n,r),n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&null!=i[u])if("style"===u){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(a.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(c=null!=i?i[u]:void 0,r.hasOwnProperty(u)&&l!==c&&(null!=l||null!=c))if("style"===u)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else"dangerouslySetInnerHTML"===u?(l=l?l.__html:void 0,c=c?c.__html:void 0,null!=l&&c!==l&&(o=o||[]).push(u,l)):"children"===u?"string"!==typeof l&&"number"!==typeof l||(o=o||[]).push(u,""+l):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(a.hasOwnProperty(u)?(null!=l&&"onScroll"===u&&Ur("scroll",e),o||c===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},Pa=function(e,t,n,r){n!==r&&(t.flags|=4)};var Va=!1,Ga=!1,Ka="function"===typeof WeakSet?WeakSet:Set,Ja=null;function Za(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){bl(e,t,r)}else n.current=null}function Qa(e,t,n){try{n()}catch(r){bl(e,t,r)}}var Ya=!1;function Xa(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,void 0!==s&&Qa(t,n,s)}i=i.next}while(i!==r)}}function $a(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ec(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function tc(e){var t=e.alternate;null!==t&&(e.alternate=null,tc(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[ci],delete t[li],delete t[di],delete t[hi],delete t[pi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nc(e){return 5===e.tag||3===e.tag||4===e.tag}function rc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||nc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ic(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Zr));else if(4!==r&&null!==(e=e.child))for(ic(e,t,n),e=e.sibling;null!==e;)ic(e,t,n),e=e.sibling}function sc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(sc(e,t,n),e=e.sibling;null!==e;)sc(e,t,n),e=e.sibling}var oc=null,ac=!1;function cc(e,t,n){for(n=n.child;null!==n;)lc(e,t,n),n=n.sibling}function lc(e,t,n){if(it&&"function"===typeof it.onCommitFiberUnmount)try{it.onCommitFiberUnmount(rt,n)}catch(a){}switch(n.tag){case 5:Ga||Za(n,t);case 6:var r=oc,i=ac;oc=null,cc(e,t,n),ac=i,null!==(oc=r)&&(ac?(e=oc,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):oc.removeChild(n.stateNode));break;case 18:null!==oc&&(ac?(e=oc,n=n.stateNode,8===e.nodeType?ii(e.parentNode,n):1===e.nodeType&&ii(e,n),zt(e)):ii(oc,n.stateNode));break;case 4:r=oc,i=ac,oc=n.stateNode.containerInfo,ac=!0,cc(e,t,n),oc=r,ac=i;break;case 0:case 11:case 14:case 15:if(!Ga&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,void 0!==o&&(0!==(2&s)||0!==(4&s))&&Qa(n,t,o),i=i.next}while(i!==r)}cc(e,t,n);break;case 1:if(!Ga&&(Za(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){bl(n,t,a)}cc(e,t,n);break;case 21:cc(e,t,n);break;case 22:1&n.mode?(Ga=(r=Ga)||null!==n.memoizedState,cc(e,t,n),Ga=r):cc(e,t,n);break;default:cc(e,t,n)}}function uc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ka),t.forEach(function(t){var r=El.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function dc(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,c=a;e:for(;null!==c;){switch(c.tag){case 5:oc=c.stateNode,ac=!1;break e;case 3:case 4:oc=c.stateNode.containerInfo,ac=!0;break e}c=c.return}if(null===oc)throw Error(s(160));lc(o,a,i),oc=null,ac=!1;var l=i.alternate;null!==l&&(l.return=null),i.return=null}catch(u){bl(i,t,u)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)hc(t,e),t=t.sibling}function hc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dc(t,e),pc(e),4&r){try{Xa(3,e,e.return),$a(3,e)}catch(m){bl(e,e.return,m)}try{Xa(5,e,e.return)}catch(m){bl(e,e.return,m)}}break;case 1:dc(t,e),pc(e),512&r&&null!==n&&Za(n,n.return);break;case 5:if(dc(t,e),pc(e),512&r&&null!==n&&Za(n,n.return),32&e.flags){var i=e.stateNode;try{de(i,"")}catch(m){bl(e,e.return,m)}}if(4&r&&null!=(i=e.stateNode)){var o=e.memoizedProps,a=null!==n?n.memoizedProps:o,c=e.type,l=e.updateQueue;if(e.updateQueue=null,null!==l)try{"input"===c&&"radio"===o.type&&null!=o.name&&Y(i,o),ve(c,a);var u=ve(c,o);for(a=0;a<l.length;a+=2){var d=l[a],h=l[a+1];"style"===d?ge(i,h):"dangerouslySetInnerHTML"===d?ue(i,h):"children"===d?de(i,h):w(i,d,h,u)}switch(c){case"input":X(i,o);break;case"textarea":se(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var f=o.value;null!=f?ne(i,!!o.multiple,f,!1):p!==!!o.multiple&&(null!=o.defaultValue?ne(i,!!o.multiple,o.defaultValue,!0):ne(i,!!o.multiple,o.multiple?[]:"",!1))}i[li]=o}catch(m){bl(e,e.return,m)}}break;case 6:if(dc(t,e),pc(e),4&r){if(null===e.stateNode)throw Error(s(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){bl(e,e.return,m)}}break;case 3:if(dc(t,e),pc(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{zt(t.containerInfo)}catch(m){bl(e,e.return,m)}break;case 4:default:dc(t,e),pc(e);break;case 13:dc(t,e),pc(e),8192&(i=e.child).flags&&(o=null!==i.memoizedState,i.stateNode.isHidden=o,!o||null!==i.alternate&&null!==i.alternate.memoizedState||(Bc=Qe())),4&r&&uc(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Ga=(u=Ga)||d,dc(t,e),Ga=u):dc(t,e),pc(e),8192&r){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&0!==(1&e.mode))for(Ja=e,d=e.child;null!==d;){for(h=Ja=d;null!==Ja;){switch(f=(p=Ja).child,p.tag){case 0:case 11:case 14:case 15:Xa(4,p,p.return);break;case 1:Za(p,p.return);var g=p.stateNode;if("function"===typeof g.componentWillUnmount){r=p,n=p.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(m){bl(r,n,m)}}break;case 5:Za(p,p.return);break;case 22:if(null!==p.memoizedState){yc(h);continue}}null!==f?(f.return=p,Ja=f):yc(h)}d=d.sibling}e:for(d=null,h=e;;){if(5===h.tag){if(null===d){d=h;try{i=h.stateNode,u?"function"===typeof(o=i.style).setProperty?o.setProperty("display","none","important"):o.display="none":(c=h.stateNode,a=void 0!==(l=h.memoizedProps.style)&&null!==l&&l.hasOwnProperty("display")?l.display:null,c.style.display=fe("display",a))}catch(m){bl(e,e.return,m)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){bl(e,e.return,m)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:dc(t,e),pc(e),4&r&&uc(e);case 21:}}function pc(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(nc(n)){var r=n;break e}n=n.return}throw Error(s(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(de(i,""),r.flags&=-33),sc(e,rc(e),i);break;case 3:case 4:var o=r.stateNode.containerInfo;ic(e,rc(e),o);break;default:throw Error(s(161))}}catch(a){bl(e,e.return,a)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function fc(e,t,n){Ja=e,gc(e,t,n)}function gc(e,t,n){for(var r=0!==(1&e.mode);null!==Ja;){var i=Ja,s=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||Va;if(!o){var a=i.alternate,c=null!==a&&null!==a.memoizedState||Ga;a=Va;var l=Ga;if(Va=o,(Ga=c)&&!l)for(Ja=i;null!==Ja;)c=(o=Ja).child,22===o.tag&&null!==o.memoizedState?vc(i):null!==c?(c.return=o,Ja=c):vc(i);for(;null!==s;)Ja=s,gc(s,t,n),s=s.sibling;Ja=i,Va=a,Ga=l}mc(e)}else 0!==(8772&i.subtreeFlags)&&null!==s?(s.return=i,Ja=s):mc(e)}}function mc(e){for(;null!==Ja;){var t=Ja;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Ga||$a(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Ga)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Xo(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;null!==o&&js(t,o,r);break;case 3:var a=t.updateQueue;if(null!==a){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}js(t,a,n)}break;case 5:var c=t.stateNode;if(null===n&&4&t.flags){n=c;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&zt(h)}}}break;default:throw Error(s(163))}Ga||512&t.flags&&ec(t)}catch(p){bl(t,t.return,p)}}if(t===e){Ja=null;break}if(null!==(n=t.sibling)){n.return=t.return,Ja=n;break}Ja=t.return}}function yc(e){for(;null!==Ja;){var t=Ja;if(t===e){Ja=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Ja=n;break}Ja=t.return}}function vc(e){for(;null!==Ja;){var t=Ja;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{$a(4,t)}catch(c){bl(t,n,c)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(c){bl(t,i,c)}}var s=t.return;try{ec(t)}catch(c){bl(t,s,c)}break;case 5:var o=t.return;try{ec(t)}catch(c){bl(t,o,c)}}}catch(c){bl(t,t.return,c)}if(t===e){Ja=null;break}var a=t.sibling;if(null!==a){a.return=t.return,Ja=a;break}Ja=t.return}}var wc,bc=Math.ceil,Ac=b.ReactCurrentDispatcher,_c=b.ReactCurrentOwner,xc=b.ReactCurrentBatchConfig,Ec=0,kc=null,Sc=null,Ic=0,Tc=0,Cc=bi(0),Pc=0,Oc=null,Nc=0,Rc=0,Mc=0,Uc=null,Lc=null,Bc=0,Dc=1/0,jc=null,Fc=!1,zc=null,Wc=null,qc=!1,Hc=null,Vc=0,Gc=0,Kc=null,Jc=-1,Zc=0;function Qc(){return 0!==(6&Ec)?Qe():-1!==Jc?Jc:Jc=Qe()}function Yc(e){return 0===(1&e.mode)?1:0!==(2&Ec)&&0!==Ic?Ic&-Ic:null!==ds.transition?(0===Zc&&(Zc=ft()),Zc):0!==(e=vt)?e:e=void 0===(e=window.event)?16:Zt(e.type)}function Xc(e,t,n,r){if(50<Gc)throw Gc=0,Kc=null,Error(s(185));mt(e,n,r),0!==(2&Ec)&&e===kc||(e===kc&&(0===(2&Ec)&&(Rc|=n),4===Pc&&rl(e,Ic)),$c(e,r),1===n&&0===Ec&&0===(1&t.mode)&&(Dc=Qe()+500,Ui&&Di()))}function $c(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-st(s),a=1<<o,c=i[o];-1===c?0!==(a&n)&&0===(a&r)||(i[o]=ht(a,t)):c<=t&&(e.expiredLanes|=a),s&=~a}}(e,t);var r=dt(e,e===kc?Ic:0);if(0===r)null!==n&&Ke(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ke(n),1===t)0===e.tag?function(e){Ui=!0,Bi(e)}(il.bind(null,e)):Bi(il.bind(null,e)),ni(function(){0===(6&Ec)&&Di()}),n=null;else{switch(wt(r)){case 1:n=Xe;break;case 4:n=$e;break;case 16:default:n=et;break;case 536870912:n=nt}n=kl(n,el.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function el(e,t){if(Jc=-1,Zc=0,0!==(6&Ec))throw Error(s(327));var n=e.callbackNode;if(vl()&&e.callbackNode!==n)return null;var r=dt(e,e===kc?Ic:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=hl(e,r);else{t=r;var i=Ec;Ec|=2;var o=ul();for(kc===e&&Ic===t||(jc=null,Dc=Qe()+500,cl(e,t));;)try{fl();break}catch(c){ll(e,c)}_s(),Ac.current=o,Ec=i,null!==Sc?t=0:(kc=null,Ic=0,t=Pc)}if(0!==t){if(2===t&&(0!==(i=pt(e))&&(r=i,t=tl(e,i))),1===t)throw n=Oc,cl(e,0),rl(e,r),$c(e,Qe()),n;if(6===t)rl(e,r);else{if(i=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!rr(s(),i))return!1}catch(a){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=hl(e,r))&&(0!==(o=pt(e))&&(r=o,t=tl(e,o))),1===t))throw n=Oc,cl(e,0),rl(e,r),$c(e,Qe()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(s(345));case 2:case 5:yl(e,Lc,jc);break;case 3:if(rl(e,r),(130023424&r)===r&&10<(t=Bc+500-Qe())){if(0!==dt(e,0))break;if(((i=e.suspendedLanes)&r)!==r){Qc(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=$r(yl.bind(null,e,Lc,jc),t);break}yl(e,Lc,jc);break;case 4:if(rl(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-st(r);o=1<<a,(a=t[a])>i&&(i=a),r&=~o}if(r=i,10<(r=(120>(r=Qe()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bc(r/1960))-r)){e.timeoutHandle=$r(yl.bind(null,e,Lc,jc),r);break}yl(e,Lc,jc);break;default:throw Error(s(329))}}}return $c(e,Qe()),e.callbackNode===n?el.bind(null,e):null}function tl(e,t){var n=Uc;return e.current.memoizedState.isDehydrated&&(cl(e,t).flags|=256),2!==(e=hl(e,t))&&(t=Lc,Lc=n,null!==t&&nl(t)),e}function nl(e){null===Lc?Lc=e:Lc.push.apply(Lc,e)}function rl(e,t){for(t&=~Mc,t&=~Rc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-st(t),r=1<<n;e[n]=-1,t&=~r}}function il(e){if(0!==(6&Ec))throw Error(s(327));vl();var t=dt(e,0);if(0===(1&t))return $c(e,Qe()),null;var n=hl(e,t);if(0!==e.tag&&2===n){var r=pt(e);0!==r&&(t=r,n=tl(e,r))}if(1===n)throw n=Oc,cl(e,0),rl(e,t),$c(e,Qe()),n;if(6===n)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,yl(e,Lc,jc),$c(e,Qe()),null}function sl(e,t){var n=Ec;Ec|=1;try{return e(t)}finally{0===(Ec=n)&&(Dc=Qe()+500,Ui&&Di())}}function ol(e){null!==Hc&&0===Hc.tag&&0===(6&Ec)&&vl();var t=Ec;Ec|=1;var n=xc.transition,r=vt;try{if(xc.transition=null,vt=1,e)return e()}finally{vt=r,xc.transition=n,0===(6&(Ec=t))&&Di()}}function al(){Tc=Cc.current,Ai(Cc)}function cl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ei(n)),null!==Sc)for(n=Sc.return;null!==n;){var r=n;switch(Yi(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&Ci();break;case 3:Gs(),Ai(ki),Ai(Ei),Xs();break;case 5:Js(r);break;case 4:Gs();break;case 13:case 19:Ai(Zs);break;case 10:xs(r.type._context);break;case 22:case 23:al()}n=n.return}if(kc=e,Sc=e=Cl(e.current,null),Ic=Tc=t,Pc=0,Oc=null,Mc=Rc=Nc=0,Lc=Uc=null,null!==Is){for(t=0;t<Is.length;t++)if(null!==(r=(n=Is[t]).interleaved)){n.interleaved=null;var i=r.next,s=n.pending;if(null!==s){var o=s.next;s.next=i,r.next=o}n.pending=r}Is=null}return e}function ll(e,t){for(;;){var n=Sc;try{if(_s(),$s.current=Jo,so){for(var r=no.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}so=!1}if(to=0,io=ro=no=null,oo=!1,ao=0,_c.current=null,null===n||null===n.return){Pc=1,Oc=t,Sc=null;break}e:{var o=e,a=n.return,c=n,l=t;if(t=Ic,c.flags|=32768,null!==l&&"object"===typeof l&&"function"===typeof l.then){var u=l,d=c,h=d.tag;if(0===(1&d.mode)&&(0===h||11===h||15===h)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=ha(a);if(null!==f){f.flags&=-257,pa(f,a,c,0,t),1&f.mode&&da(o,u,t),l=u;var g=(t=f).updateQueue;if(null===g){var m=new Set;m.add(l),t.updateQueue=m}else g.add(l);break e}if(0===(1&t)){da(o,u,t),dl();break e}l=Error(s(426))}else if(es&&1&c.mode){var y=ha(a);if(null!==y){0===(65536&y.flags)&&(y.flags|=256),pa(y,a,c,0,t),us(sa(l,c));break e}}o=l=sa(l,c),4!==Pc&&(Pc=2),null===Uc?Uc=[o]:Uc.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t,Bs(o,la(0,l,t));break e;case 1:c=l;var v=o.type,w=o.stateNode;if(0===(128&o.flags)&&("function"===typeof v.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===Wc||!Wc.has(w)))){o.flags|=65536,t&=-t,o.lanes|=t,Bs(o,ua(o,c,t));break e}}o=o.return}while(null!==o)}ml(n)}catch(b){t=b,Sc===n&&null!==n&&(Sc=n=n.return);continue}break}}function ul(){var e=Ac.current;return Ac.current=Jo,null===e?Jo:e}function dl(){0!==Pc&&3!==Pc&&2!==Pc||(Pc=4),null===kc||0===(268435455&Nc)&&0===(268435455&Rc)||rl(kc,Ic)}function hl(e,t){var n=Ec;Ec|=2;var r=ul();for(kc===e&&Ic===t||(jc=null,cl(e,t));;)try{pl();break}catch(i){ll(e,i)}if(_s(),Ec=n,Ac.current=r,null!==Sc)throw Error(s(261));return kc=null,Ic=0,Pc}function pl(){for(;null!==Sc;)gl(Sc)}function fl(){for(;null!==Sc&&!Je();)gl(Sc)}function gl(e){var t=wc(e.alternate,e,Tc);e.memoizedProps=e.pendingProps,null===t?ml(e):Sc=t,_c.current=null}function ml(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=qa(n,t,Tc)))return void(Sc=n)}else{if(null!==(n=Ha(n,t)))return n.flags&=32767,void(Sc=n);if(null===e)return Pc=6,void(Sc=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Sc=t);Sc=t=e}while(null!==t);0===Pc&&(Pc=5)}function yl(e,t,n){var r=vt,i=xc.transition;try{xc.transition=null,vt=1,function(e,t,n,r){do{vl()}while(null!==Hc);if(0!==(6&Ec))throw Error(s(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-st(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}(e,o),e===kc&&(Sc=kc=null,Ic=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||qc||(qc=!0,kl(et,function(){return vl(),null})),o=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||o){o=xc.transition,xc.transition=null;var a=vt;vt=1;var c=Ec;Ec|=4,_c.current=null,function(e,t){if(Qr=qt,lr(e=cr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(A){n=null;break e}var a=0,c=-1,l=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var f;h!==n||0!==i&&3!==h.nodeType||(c=a+i),h!==o||0!==r&&3!==h.nodeType||(l=a+r),3===h.nodeType&&(a+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===n&&++u===i&&(c=a),p===o&&++d===r&&(l=a),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}n=-1===c||-1===l?null:{start:c,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yr={focusedElem:e,selectionRange:n},qt=!1,Ja=t;null!==Ja;)if(e=(t=Ja).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Ja=e;else for(;null!==Ja;){t=Ja;try{var g=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var m=g.memoizedProps,y=g.memoizedState,v=t.stateNode,w=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Xo(t.type,m),y);v.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(s(163))}}catch(A){bl(t,t.return,A)}if(null!==(e=t.sibling)){e.return=t.return,Ja=e;break}Ja=t.return}g=Ya,Ya=!1}(e,n),hc(n,e),ur(Yr),qt=!!Qr,Yr=Qr=null,e.current=n,fc(n,e,i),Ze(),Ec=c,vt=a,xc.transition=o}else e.current=n;if(qc&&(qc=!1,Hc=e,Vc=i),o=e.pendingLanes,0===o&&(Wc=null),function(e){if(it&&"function"===typeof it.onCommitFiberRoot)try{it.onCommitFiberRoot(rt,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),$c(e,Qe()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Fc)throw Fc=!1,e=zc,zc=null,e;0!==(1&Vc)&&0!==e.tag&&vl(),o=e.pendingLanes,0!==(1&o)?e===Kc?Gc++:(Gc=0,Kc=e):Gc=0,Di()}(e,t,n,r)}finally{xc.transition=i,vt=r}return null}function vl(){if(null!==Hc){var e=wt(Vc),t=xc.transition,n=vt;try{if(xc.transition=null,vt=16>e?16:e,null===Hc)var r=!1;else{if(e=Hc,Hc=null,Vc=0,0!==(6&Ec))throw Error(s(331));var i=Ec;for(Ec|=4,Ja=e.current;null!==Ja;){var o=Ja,a=o.child;if(0!==(16&Ja.flags)){var c=o.deletions;if(null!==c){for(var l=0;l<c.length;l++){var u=c[l];for(Ja=u;null!==Ja;){var d=Ja;switch(d.tag){case 0:case 11:case 15:Xa(8,d,o)}var h=d.child;if(null!==h)h.return=d,Ja=h;else for(;null!==Ja;){var p=(d=Ja).sibling,f=d.return;if(tc(d),d===u){Ja=null;break}if(null!==p){p.return=f,Ja=p;break}Ja=f}}}var g=o.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(null!==m)}}Ja=o}}if(0!==(2064&o.subtreeFlags)&&null!==a)a.return=o,Ja=a;else e:for(;null!==Ja;){if(0!==(2048&(o=Ja).flags))switch(o.tag){case 0:case 11:case 15:Xa(9,o,o.return)}var v=o.sibling;if(null!==v){v.return=o.return,Ja=v;break e}Ja=o.return}}var w=e.current;for(Ja=w;null!==Ja;){var b=(a=Ja).child;if(0!==(2064&a.subtreeFlags)&&null!==b)b.return=a,Ja=b;else e:for(a=w;null!==Ja;){if(0!==(2048&(c=Ja).flags))try{switch(c.tag){case 0:case 11:case 15:$a(9,c)}}catch(_){bl(c,c.return,_)}if(c===a){Ja=null;break e}var A=c.sibling;if(null!==A){A.return=c.return,Ja=A;break e}Ja=c.return}}if(Ec=i,Di(),it&&"function"===typeof it.onPostCommitFiberRoot)try{it.onPostCommitFiberRoot(rt,e)}catch(_){}r=!0}return r}finally{vt=n,xc.transition=t}}return!1}function wl(e,t,n){e=Us(e,t=la(0,t=sa(n,t),1),1),t=Qc(),null!==e&&(mt(e,1,t),$c(e,t))}function bl(e,t,n){if(3===e.tag)wl(e,e,n);else for(;null!==t;){if(3===t.tag){wl(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Wc||!Wc.has(r))){t=Us(t,e=ua(t,e=sa(n,e),1),1),e=Qc(),null!==t&&(mt(t,1,e),$c(t,e));break}}t=t.return}}function Al(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Qc(),e.pingedLanes|=e.suspendedLanes&n,kc===e&&(Ic&n)===n&&(4===Pc||3===Pc&&(130023424&Ic)===Ic&&500>Qe()-Bc?cl(e,0):Mc|=n),$c(e,t)}function _l(e,t){0===t&&(0===(1&e.mode)?t=1:(t=lt,0===(130023424&(lt<<=1))&&(lt=4194304)));var n=Qc();null!==(e=Ps(e,t))&&(mt(e,t,n),$c(e,n))}function xl(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),_l(e,n)}function El(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}null!==r&&r.delete(t),_l(e,n)}function kl(e,t){return Ge(e,t)}function Sl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Il(e,t,n,r){return new Sl(e,t,n,r)}function Tl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Cl(e,t){var n=e.alternate;return null===n?((n=Il(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pl(e,t,n,r,i,o){var a=2;if(r=e,"function"===typeof e)Tl(e)&&(a=1);else if("string"===typeof e)a=5;else e:switch(e){case x:return Ol(n.children,i,o,t);case E:a=8,i|=8;break;case k:return(e=Il(12,n,t,2|i)).elementType=k,e.lanes=o,e;case C:return(e=Il(13,n,t,i)).elementType=C,e.lanes=o,e;case P:return(e=Il(19,n,t,i)).elementType=P,e.lanes=o,e;case R:return Nl(n,i,o,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case S:a=10;break e;case I:a=9;break e;case T:a=11;break e;case O:a=14;break e;case N:a=16,r=null;break e}throw Error(s(130,null==e?e:typeof e,""))}return(t=Il(a,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Ol(e,t,n,r){return(e=Il(7,e,r,t)).lanes=n,e}function Nl(e,t,n,r){return(e=Il(22,e,r,t)).elementType=R,e.lanes=n,e.stateNode={isHidden:!1},e}function Rl(e,t,n){return(e=Il(6,e,null,t)).lanes=n,e}function Ml(e,t,n){return(t=Il(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ul(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ll(e,t,n,r,i,s,o,a,c){return e=new Ul(e,t,n,a,c),1===t?(t=1,!0===s&&(t|=8)):t=0,s=Il(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ns(s),e}function Bl(e){if(!e)return xi;e:{if(ze(e=e._reactInternals)!==e||1!==e.tag)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ti(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(s(171))}if(1===e.tag){var n=e.type;if(Ti(n))return Oi(e,n,t)}return t}function Dl(e,t,n,r,i,s,o,a,c){return(e=Ll(n,r,!0,e,0,s,0,a,c)).context=Bl(null),n=e.current,(s=Ms(r=Qc(),i=Yc(n))).callback=void 0!==t&&null!==t?t:null,Us(n,s,i),e.current.lanes=i,mt(e,i,r),$c(e,r),e}function jl(e,t,n,r){var i=t.current,s=Qc(),o=Yc(i);return n=Bl(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ms(s,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Us(i,t,o))&&(Xc(e,i,o,s),Ls(e,i,o)),o}function Fl(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function zl(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Wl(e,t){zl(e,t),(e=e.alternate)&&zl(e,t)}wc=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||ki.current)ga=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return ga=!1,function(e,t,n){switch(t.tag){case 3:ka(t),ls();break;case 5:Ks(t);break;case 1:Ti(t.type)&&Ni(t);break;case 4:Vs(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;_i(vs,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(_i(Zs,1&Zs.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Ra(e,t,n):(_i(Zs,1&Zs.current),null!==(e=Fa(e,t,n))?e.sibling:null);_i(Zs,1&Zs.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return Da(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),_i(Zs,Zs.current),r)break;return null;case 22:case 23:return t.lanes=0,ba(e,t,n)}return Fa(e,t,n)}(e,t,n);ga=0!==(131072&e.flags)}else ga=!1,es&&0!==(1048576&t.flags)&&Zi(t,Wi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ja(e,t),e=t.pendingProps;var i=Ii(t,Ei.current);ks(t,n),i=ho(null,t,r,e,i,n);var o=po();return t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ti(r)?(o=!0,Ni(t)):o=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ns(t),i.updater=ea,t.stateNode=i,i._reactInternals=t,ia(t,r,e,n),t=Ea(null,t,r,!0,o,n)):(t.tag=0,es&&o&&Qi(t),ma(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ja(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"===typeof e)return Tl(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===T)return 11;if(e===O)return 14}return 2}(r),e=Xo(r,e),i){case 0:t=_a(null,t,r,e,n);break e;case 1:t=xa(null,t,r,e,n);break e;case 11:t=ya(null,t,r,e,n);break e;case 14:t=va(null,t,r,Xo(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,_a(e,t,r,i=t.elementType===r?i:Xo(r,i),n);case 1:return r=t.type,i=t.pendingProps,xa(e,t,r,i=t.elementType===r?i:Xo(r,i),n);case 3:e:{if(ka(t),null===e)throw Error(s(387));r=t.pendingProps,i=(o=t.memoizedState).element,Rs(e,t),Ds(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Sa(e,t,r,n,i=sa(Error(s(423)),t));break e}if(r!==i){t=Sa(e,t,r,n,i=sa(Error(s(424)),t));break e}for($i=si(t.stateNode.containerInfo.firstChild),Xi=t,es=!0,ts=null,n=ys(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(ls(),r===i){t=Fa(e,t,n);break e}ma(e,t,r,n)}t=t.child}return t;case 5:return Ks(t),null===e&&ss(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,Xr(r,i)?a=null:null!==o&&Xr(r,o)&&(t.flags|=32),Aa(e,t),ma(e,t,a,n),t.child;case 6:return null===e&&ss(t),null;case 13:return Ra(e,t,n);case 4:return Vs(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ms(t,null,r,n):ma(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,ya(e,t,r,i=t.elementType===r?i:Xo(r,i),n);case 7:return ma(e,t,t.pendingProps,n),t.child;case 8:case 12:return ma(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,_i(vs,r._currentValue),r._currentValue=a,null!==o)if(rr(o.value,a)){if(o.children===i.children&&!ki.current){t=Fa(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var c=o.dependencies;if(null!==c){a=o.child;for(var l=c.firstContext;null!==l;){if(l.context===r){if(1===o.tag){(l=Ms(-1,n&-n)).tag=2;var u=o.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Es(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(10===o.tag)a=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(a=o.return))throw Error(s(341));a.lanes|=n,null!==(c=a.alternate)&&(c.lanes|=n),Es(a,n,t),a=o.sibling}else a=o.child;if(null!==a)a.return=o;else for(a=o;null!==a;){if(a===t){a=null;break}if(null!==(o=a.sibling)){o.return=a.return,a=o;break}a=a.return}o=a}ma(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ks(t,n),r=r(i=Ss(i)),t.flags|=1,ma(e,t,r,n),t.child;case 14:return i=Xo(r=t.type,t.pendingProps),va(e,t,r,i=Xo(r.type,i),n);case 15:return wa(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xo(r,i),ja(e,t),t.tag=1,Ti(r)?(e=!0,Ni(t)):e=!1,ks(t,n),na(t,r,i),ia(t,r,i,n),Ea(null,t,r,!0,e,n);case 19:return Da(e,t,n);case 22:return ba(e,t,n)}throw Error(s(156,t.tag))};var ql="function"===typeof reportError?reportError:function(e){console.error(e)};function Hl(e){this._internalRoot=e}function Vl(e){this._internalRoot=e}function Gl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Kl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Jl(){}function Zl(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if("function"===typeof i){var a=i;i=function(){var e=Fl(o);a.call(e)}}jl(t,o,e,i)}else o=function(e,t,n,r,i){if(i){if("function"===typeof r){var s=r;r=function(){var e=Fl(o);s.call(e)}}var o=Dl(t,r,e,0,null,!1,0,"",Jl);return e._reactRootContainer=o,e[ui]=o.current,Dr(8===e.nodeType?e.parentNode:e),ol(),o}for(;i=e.lastChild;)e.removeChild(i);if("function"===typeof r){var a=r;r=function(){var e=Fl(c);a.call(e)}}var c=Ll(e,0,!1,null,0,!1,0,"",Jl);return e._reactRootContainer=c,e[ui]=c.current,Dr(8===e.nodeType?e.parentNode:e),ol(function(){jl(t,c,n,r)}),c}(n,t,e,i,r);return Fl(o)}Vl.prototype.render=Hl.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(s(409));jl(e,t,null,null)},Vl.prototype.unmount=Hl.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;ol(function(){jl(null,e,null,null)}),t[ui]=null}},Vl.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nt.length&&0!==t&&t<Nt[n].priority;n++);Nt.splice(n,0,e),0===n&&Lt(e)}},bt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ut(t.pendingLanes);0!==n&&(yt(t,1|n),$c(t,Qe()),0===(6&Ec)&&(Dc=Qe()+500,Di()))}break;case 13:ol(function(){var t=Ps(e,1);if(null!==t){var n=Qc();Xc(t,e,1,n)}}),Wl(e,1)}},At=function(e){if(13===e.tag){var t=Ps(e,134217728);if(null!==t)Xc(t,e,134217728,Qc());Wl(e,134217728)}},_t=function(e){if(13===e.tag){var t=Yc(e),n=Ps(e,t);if(null!==n)Xc(n,e,t,Qc());Wl(e,t)}},xt=function(){return vt},Et=function(e,t){var n=vt;try{return vt=e,t()}finally{vt=n}},Ae=function(e,t,n){switch(t){case"input":if(X(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=yi(r);if(!i)throw Error(s(90));K(r),X(r,i)}}}break;case"textarea":se(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Ie=sl,Te=ol;var Ql={usingClientEntryPoint:!1,Events:[gi,mi,yi,ke,Se,sl]},Yl={findFiberByHostInstance:fi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xl={bundleType:Yl.bundleType,version:Yl.version,rendererPackageName:Yl.rendererPackageName,rendererConfig:Yl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=He(e))?null:e.stateNode},findFiberByHostInstance:Yl.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var $l=__REACT_DEVTOOLS_GLOBAL_HOOK__;
2if(!$l.isDisabled&&$l.supportsFiber)try{rt=$l.inject(Xl),it=$l}catch(eu){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ql,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Gl(t))throw Error(s(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Gl(e))throw Error(s(299));var n=!1,r="",i=ql;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Ll(e,1,!1,null,0,n,0,r,i),e[ui]=t.current,Dr(8===e.nodeType?e.parentNode:e),new Hl(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(s(188));throw e=Object.keys(e).join(","),Error(s(268,e))}return e=null===(e=He(t))?null:e.stateNode},t.flushSync=function(e){return ol(e)},t.hydrate=function(e,t,n){if(!Kl(t))throw Error(s(200));return Zl(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Gl(e))throw Error(s(405));var r=null!=n&&n.hydratedSources||null,i=!1,o="",a=ql;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),t=Dl(t,null,e,1,null!=n?n:null,i,0,o,a),e[ui]=t.current,Dr(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Vl(t)},t.render=function(e,t,n){if(!Kl(t))throw Error(s(200));return Zl(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Kl(e))throw Error(s(40));return!!e._reactRootContainer&&(ol(function(){Zl(null,null,e,!1,function(){e._reactRootContainer=null,e[ui]=null})}),!0)},t.unstable_batchedUpdates=sl,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Kl(n))throw Error(s(200));if(null==e||void 0===e._reactInternals)throw Error(s(38));return Zl(e,t,n,!1,r)},t.version="18.3.1-next-f1338f8080-20240426"},29213:(e,t,n)=>{"use strict";n.d(t,{$:()=>o,R:()=>a});var r=n(24107),i=n(38910),s=n(47e3);function o(e,t){var n;const i=(null!==(n=e.transactions)&&void 0!==n?n:[]).map(e=>"string"===typeof e?e:(0,s.uP)(e));return(0,r.A)((0,r.A)({},e),{},{baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:i,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null})}const a=(0,i.q)("block",o)},29476:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},29581:(e,t,n)=>{"use strict";n.d(t,{O:()=>a});var r=n(57722),i=n(42922),s=n(56973),o=n(25087);function a(e,t,n){let a=(0,o.Y)(e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()});(0,r.useEffect)(()=>{if(!e)return;let n=null===t?null:s.sb(t)?t:t.current;if(!n)return;let r=(0,i.e)();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(()=>a.current(n));e.observe(n),r.add(()=>e.disconnect())}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver(()=>a.current(n));e.observe(n),r.add(()=>e.disconnect())}return()=>r.dispose()},[t,a,e])}},29668:(e,t,n)=>{"use strict";n.d(t,{M:()=>s});var r=n(10133),i=n(59892);function s(e){const t=(0,i.S)("0x".concat(e.substring(4))).substring(26);return(0,r.o)("0x".concat(t))}},29836:(e,t,n)=>{"use strict";e.exports=n(34129)},30105:(e,t,n)=>{var r="undefined"!==typeof globalThis&&globalThis||"undefined"!==typeof self&&self||"undefined"!==typeof n.g&&n.g,i=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||"undefined"!==typeof n.g&&n.g||{},i="URLSearchParams"in r,s="Symbol"in r&&"iterator"in Symbol,o="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in r,c="ArrayBuffer"in r;if(c)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
2]"],u=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function h(e){return"string"!==typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return s&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function g(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function m(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function y(e){var t=new FileReader,n=m(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"===typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"===typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=g(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(o)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=m(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8";return t.readAsText(e,i),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=d(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[d(e)]},f.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},f.prototype.set=function(e,t){this.map[d(e)]=h(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),p(e)},f.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),p(e)},f.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),p(e)},s&&(f.prototype[Symbol.iterator]=f.prototype.entries);var b=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function A(e,t){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object c
2onstructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof A){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=function(e){var t=e.toUpperCase();return b.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in r)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),("GET"===this.method||"HEAD"===this.method)&&("no-store"===t.cache||"no-cache"===t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function _(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function x(e){var t=new f;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{t.append(r,i)}catch(s){console.warn("Response "+s.message)}}}),t}function E(e,t){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},w.call(A.prototype),w.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var k=[301,302,303,307,308];E.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(I){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise(function(i,s){var a=new A(e,n);if(a.signal&&a.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function u(){l.abort()}if(l.onload=function(){var e={statusText:l.statusText,headers:x(l.getAllResponseHeaders()||"")};0===a.url.indexOf("file://")&&(l.status<200||l.status>599)?e.status=200:e.status=l.status,e.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL");var t="response"in l?l.response:l.responseText;setTimeout(function(){i(new E(t,e))},0)},l.onerror=function(){setTimeout(function(){s(new TypeError("Network request failed"))},0)},l.ontimeout=function(){setTimeout(function(){s(new TypeError("Network request timed out"))},0)},l.onabort=function(){setTimeout(function(){s(new t.DOMException("Aborted","AbortError"))},0)}
2,l.open(a.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?l.withCredentials=!0:"omit"===a.credentials&&(l.withCredentials=!1),"responseType"in l&&(o?l.responseType="blob":c&&(l.responseType="arraybuffer")),n&&"object"===typeof n.headers&&!(n.headers instanceof f||r.Headers&&n.headers instanceof r.Headers)){var p=[];Object.getOwnPropertyNames(n.headers).forEach(function(e){p.push(d(e)),l.setRequestHeader(e,h(n.headers[e]))}),a.headers.forEach(function(e,t){-1===p.indexOf(t)&&l.setRequestHeader(t,e)})}else a.headers.forEach(function(e,t){l.setRequestHeader(t,e)});a.signal&&(a.signal.addEventListener("abort",u),l.onreadystatechange=function(){4===l.readyState&&a.signal.removeEventListener("abort",u)}),l.send("undefined"===typeof a._bodyInit?null:a._bodyInit)})}S.polyfill=!0,r.fetch||(r.fetch=S,r.Headers=f,r.Request=A,r.Response=E),t.Headers=f,t.Request=A,t.Response=E,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var s=r.fetch?r:i;(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},30340:(e,t,n)=>{"use strict";n.d(t,{ER:()=>s,Im:()=>c,dZ:()=>l,eX:()=>o,e_:()=>a});var r=n(31229),i=n(59314);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;
2return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function o(){return BigInt(s(arguments.length>0&&void 0!==arguments[0]?arguments[0]:6))}function a(e,t,n){return{id:n||s(),jsonrpc:"2.0",method:e,params:t}}function c(e,t){return{id:e,jsonrpc:"2.0",result:t}}function l(e,t,n){return{id:e,jsonrpc:"2.0",error:u(t,n)}}function u(e,t){return"undefined"===typeof e?(0,r.vG)(i.zR):("string"===typeof e&&(e=Object.assign(Object.assign({},(0,r.vG)(i.fO)),{message:e})),"undefined"!==typeof t&&(e.data=t),(0,r.mE)(e.code)&&(e=(0,r.rI)(e.code)),e)}},30349:(e,t,n)=>{"use strict";n.d(t,{A:()=>O});var r=n(24107),i=n(40767);function s(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return(i=e(...n))&&"function"===typeof i.then?i:Promise.resolve(i)}catch(s){return Promise.reject(s)}var i}function o(e){if(function(e){const t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"===typeof e.toJSON)return o(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const a="base64:";function c(e){return"string"===typeof e?e:a+function(e){if(globalThis.Buffer)return Buffer.from(e).toString("base64");return globalThis.btoa(String.fromCodePoint(...e))}(e)}function l(e){return"string"!==typeof e?e:e.startsWith(a)?function(e){if(globalThis.Buffer)return Buffer.from(e,"base64");return Uint8Array.from(globalThis.atob(e),e=>e.codePointAt(0))}(e.slice(7)):e}function u(e){var t;return e&&(null===(t=e.split("?")[0])||void 0===t?void 0:t.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(t.join(":"))}function h(e){return(e=u(e))?e+":":""}const p=()=>{const e=new Map;return{name:"memory",getInstance:()=>e,hasItem:t=>e.has(t),getItem(t){var n;return null!==(n=e.get(t))&&void 0!==n?n:null},getItemRaw(t){var n;return null!==(n=e.get(t))&&void 0!==n?n:null},setItem(t,n){e.set(t,n)},setItemRaw(t,n){e.set(t,n)},removeItem(t){e.delete(t)},getKeys:()=>[...e.keys()],clear(){e.clear()},dispose(){e.clear()}}};function f(){const e={mounts:{"":(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).driver||p()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=t=>{for(const n of e.mountpoints)if(t.startsWith(n))return{base:n,relativeKey:t.slice(n.length),driver:e.mounts[n]};return{base:"",relativeKey:t,driver:e.mounts[""]}},n=(t,n)=>e.mountpoints.filter(e=>e.startsWith(t)||n&&t.startsWith(e)).map(n=>({relativeBase:t.length>n.length?t.slice(n.length):void 0,mountpoint:n,driver:e.mounts[n]})),a=(t,n)=>{if(e.watching){n=u(n);for(const r of e.watchListeners)r(t,n)}},f=async()=>{if(e.watching){for(const t in e.unwatch)await e.unwatch[t]();e.unwatch={},e.watching=!1}},y=(e,n,i)=>{const s=new Map,o=e=>{let t=s.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},s.set(e.base,t)),t};for(const a of e){const e="string"===typeof a,i=u(e?a:a.key),s=e?void 0:a.value,c=e||!a.options?n:(0,r.A)((0,r.A)({},n),a.options),l=t(i);o(l).items.push({key:i,value:s,relativeKey:l.relativeKey,options:c})}return Promise.all([...s.values()].map(e=>i(e))).then(e=>e.flat())},v={hasItem(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=u(e);const{relativeKey:r,driver:i}=t(e);return s(i.hasItem,r,n)},getItem(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=u(e);const{relativeKey:r,driver:o}=t(e);return s(o.getItem,r,n).then(e=>(0,i.Ay)(e))},getItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y(e,t,e=>e.driver.getItems?s(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:d(e.base,t.key),value:(0,i.Ay)(t.value)}))):Promise.all(e.items.map(t=>s(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:(0,i.Ay)(e)})))))},getItemRaw(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=u(e);const{relativeKey:r,driver:i}=t(e);return i.getItemRaw?s(i.getItemRaw,r,n):s(i.getItem,r,n).then(e=>l(e))},async setItem(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===n)return v.removeItem(e);e=u(e);const{relativeKey:i,driver:c}=t(e);
2c.setItem&&(await s(c.setItem,i,o(n),r),c.watch||a("update",e))},async setItems(e,t){await y(e,t,async e=>{if(e.driver.setItems)return s(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:o(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>s(e.driver.setItem,t.relativeKey,o(t.value),t.options)))})},async setItemRaw(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===n)return v.removeItem(e,r);e=u(e);const{relativeKey:i,driver:o}=t(e);if(o.setItemRaw)await s(o.setItemRaw,i,n,r);else{if(!o.setItem)return;await s(o.setItem,i,c(n),r)}o.watch||a("update",e)},async removeItem(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"===typeof n&&(n={removeMeta:n}),e=u(e);const{relativeKey:r,driver:i}=t(e);i.removeItem&&(await s(i.removeItem,r,n),(n.removeMeta||n.removeMata)&&await s(i.removeItem,r+"$",n),i.watch||a("remove",e))},async getMeta(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"boolean"===typeof n&&(n={nativeOnly:n}),e=u(e);const{relativeKey:r,driver:o}=t(e),a=Object.create(null);if(o.getMeta&&Object.assign(a,await s(o.getMeta,r,n)),!n.nativeOnly){const e=await s(o.getItem,r+"$",n).then(e=>(0,i.Ay)(e));e&&"object"===typeof e&&("string"===typeof e.atime&&(e.atime=new Date(e.atime)),"string"===typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(a,e))}return a},setMeta(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.setItem(e+"$",t,n)},removeMeta(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.removeItem(e+"$",t)},async getKeys(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=h(e);const r=n(e,!0);let i=[];const o=[];let a=!0;for(const n of r){var c;null!==(c=n.driver.flags)&&void 0!==c&&c.maxDepth||(a=!1);const e=await s(n.driver.getKeys,n.relativeBase,t);for(const t of e){const e=n.mountpoint+u(t);i.some(t=>e.startsWith(t))||o.push(e)}i=[n.mountpoint,...i.filter(e=>!e.startsWith(n.mountpoint))]}const l=void 0!==t.maxDepth&&!a;return o.filter(n=>(!l||function(e,t){if(void 0===t)return!0;let n=0,r=e.indexOf(":");for(;r>-1;)n++,r=e.indexOf(":",r+1);return n<=t}(n,t.maxDepth))&&function(e,t){return t?e.startsWith(t)&&"$"!==e[e.length-1]:"$"!==e[e.length-1]}(n,e))},async clear(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=h(e),await Promise.all(n(e,!1).map(async e=>{if(e.driver.clear)return s(e.driver.clear,e.relativeBase,t);if(e.driver.removeItem){const n=await e.driver.getKeys(e.relativeBase||"",t);return Promise.all(n.map(n=>e.driver.removeItem(n,t)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(e=>m(e)))},watch:async t=>(await(async()=>{if(!e.watching){e.watching=!0;for(const t in e.mounts)e.unwatch[t]=await g(e.mounts[t],a,t)}})(),e.watchListeners.push(t),async()=>{e.watchListeners=e.watchListeners.filter(e=>e!==t),0===e.watchListeners.length&&await f()}),async unwatch(){e.watchListeners=[],await f()},mount(t,n){if((t=h(t))&&e.mounts[t])throw new Error("already mounted at ".concat(t));return t&&(e.mountpoints.push(t),e.mountpoints.sort((e,t)=>t.length-e.length)),e.mounts[t]=n,e.watching&&Promise.resolve(g(n,a,t)).then(n=>{e.unwatch[t]=n}).catch(console.error),v},async unmount(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if((t=h(t))&&e.mounts[t]){var r,i;if(e.watching&&t in e.unwatch)null===(r=(i=e.unwatch)[t])||void 0===r||r.call(i),delete e.unwatch[t];n&&await m(e.mounts[t]),e.mountpoints=e.mountpoints.filter(e=>e!==t),delete e.mounts[t]}},getMount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=u(e)+":";const n=t(e);return{driver:n.driver,base:n.base}},getMounts(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=u(e);return n(e,t.parents).map(e=>({driver:e.driver,base:e.mountpoint}))},keys:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return v.getKeys(e,t)},get:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return v.getItem(e,t)},set:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return v.setItem(e,t,n)},has:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return v.hasItem(e,t)},del:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return v.removeItem(e,t)},remove:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return v.removeItem(e,t)}};return v}function g(e,t,n){return e.watch?e.watch((e,r)=>t(e,n+r)):()=>{}}async function m(e){"function"===typeof e.dispose&&await s(e.dispose)}function y(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function v(e,t){let n;return(r,i)=>(()=>
2{if(n)return n;const r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(t),n=y(r),n.then(e=>{e.onclose=()=>n=void 0},()=>{}),n})().then(e=>i(e.transaction(t,r).objectStore(t)))}let w;function b(){return w||(w=v("keyval-store","keyval")),w}function A(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:b())("readonly",t=>y(t.get(e)))}function _(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},y(e.transaction)}var x=n(77101);var E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.base&&e.base.length>0?"".concat(e.base,":"):"",n=e=>t+e;let r;return e.dbName&&e.storeName&&(r=v(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await A(n(e),r)>"u"),async getItem(e){var t;return null!==(t=await A(n(e),r))&&void 0!==t?t:null},setItem:(e,t)=>function(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:b())("readwrite",n=>(n.put(t,e),y(n.transaction)))}(n(e),t,r),removeItem:e=>function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:b())("readwrite",t=>(t.delete(e),y(t.transaction)))}(n(e),r),getKeys:()=>function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:b())("readonly",e=>{if(e.getAllKeys)return y(e.getAllKeys());const t=[];return _(e,e=>t.push(e.key)).then(()=>t)})}(r),clear:()=>function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:b())("readwrite",e=>(e.clear(),y(e.transaction)))}(r)}};class k{constructor(){this.indexedDb=f({driver:E({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,(0,x.h)(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof n.g<"u"?n.g:typeof self<"u"?self:{},I={exports:{}};function T(e){var t;return[e[0],(0,x.j)(null!=(t=e[1])?t:"")]}!function(){let e;function t(){}e=t,e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){const e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof S<"u"&&S.localStorage?I.exports=S.localStorage:typeof window<"u"&&window.localStorage?I.exports=window.localStorage:I.exports=new t}();class C{constructor(){this.localStorage=I.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(T)}async getItem(e){const t=this.localStorage.getItem(e);if(null!==t)return(0,x.j)(t)}async setItem(e,t){this.localStorage.setItem(e,(0,x.h)(t))}async removeItem(e){this.localStorage.removeItem(e)}}const P=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class O{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};const e=new C;this.storage=e;try{(async(e,t,n)=>{const r="wc_storage_version",i=await t.getItem(r);if(i&&i>=1)return void n(t);const s=await e.getKeys();if(!s.length)return void n(t);const o=[];for(;s.length;){const n=s.shift();if(!n)continue;const r=n.toLowerCase();if(r.includes("wc@")||r.includes("walletconnect")||r.includes("wc_")||r.includes("wallet_connect")){const r=await e.getItem(n);await t.setItem(n,r),o.push(n)}}await t.setItem(r,1),n(t),P(e,o)})(e,new k,this.setInitialized)}catch(t){this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}}
2,30549:(e,t,n)=>{"use strict";n.d(t,{A:()=>i,b:()=>r});var r=n(38435);const i=r},31012:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},31229:(e,t,n)=>{"use strict";n.d(t,{eF:()=>a,mE:()=>i,rI:()=>o,vG:()=>s});var r=n(59314);function i(e){return r.jf.includes(e)}function s(e){return Object.keys(r.Uf).includes(e)?r.Uf[e]:r.Uf[r.XW]}function o(e){const t=Object.values(r.Uf).find(t=>t.code===e);return t||r.Uf[r.XW]}function a(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error("Unavailable ".concat(n," RPC url at ").concat(t)):e}},31442:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(45482);function i(e){return new r.A(e,0)}},31445:(e,t,n)=>{"use strict";n.d(t,{Ac:()=>d,Ci:()=>p,FX:()=>v,mK:()=>h,oE:()=>w,v6:()=>y,zv:()=>_});var r=n(15882),i=n(24107),s=n(57722),o=n(54088),a=n(64284);const c=["static"],l=["unmount"],u=["as","children","refName"];var d=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(d||{}),h=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(h||{});function p(){let e=function(){let e=(0,s.useRef)([]),t=(0,s.useCallback)(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(!r.every(e=>null==e))return e.current=r,t}}();return(0,s.useCallback)(t=>function(e){let{ourProps:t,theirProps:n,slot:s,defaultTag:o,features:u,visible:d=!0,name:h,mergeRefs:p}=e;p=null!=p?p:g;let y=m(n,t);if(d)return f(y,s,o,h,p);let v=null!=u?u:0;if(2&v){let{static:e=!1}=y,t=(0,r.A)(y,c);if(e)return f(t,s,o,h,p)}if(1&v){let{unmount:e=!0}=y,t=(0,r.A)(y,l);return(0,a.Y)(e?0:1,{0:()=>null,1:()=>f((0,i.A)((0,i.A)({},t),{},{hidden:!0,style:{display:"none"}}),s,o,h,p)})}return f(y,s,o,h,p)}((0,i.A)({mergeRefs:e},t)),[e])}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,c=b(e,["unmount","static"]),{as:l=n,children:d,refName:h="ref"}=c,p=(0,r.A)(c,u),f=void 0!==e.ref?{[h]:e.ref}:{},g="function"==typeof d?d(t):d;"className"in p&&p.className&&"function"==typeof p.className&&(p.className=p.className(t)),p["aria-labelledby"]&&p["aria-labelledby"]===p.id&&(p["aria-labelledby"]=void 0);let y={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase())));if(e){y["data-headlessui-state"]=n.join(" ");for(let e of n)y["data-".concat(e)]=""}}if(_(l)&&(Object.keys(w(p)).length>0||Object.keys(w(y)).length>0)){if(!(!(0,s.isValidElement)(g)||Array.isArray(g)&&g.length>1||function(e){return _(e.type)}(g))){let e=g.props,t=null==e?void 0:e.className,n="function"==typeof t?function(){return(0,o.x)(t(...arguments),p.className)}:(0,o.x)(t,p.className),r=n?{className:n}:{},i=m(g.props,w(b(p,["ref"])));for(let s in y)s in i&&delete y[s];return(0,s.cloneElement)(g,Object.assign({},i,y,f,{ref:a(A(g),f.ref)},r))}if(Object.keys(w(p)).length>0)throw new Error(['Passing props on "Fragment"!',"","The current component <".concat(i,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(w(p)).concat(Object.keys(w(y))).map(e=>" - ".concat(e)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>" - ".concat(e)).join("\n")].join("\n"))}return(0,s.createElement)(l,Object.assign({},b(p,["ref"]),!_(l)&&f,!_(l)&&y),g)}function g(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(e=>null==e)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function m(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return{};if(1===t.length)return t[0];let r={},i={};for(let s of t)for(let e in s)e.startsWith("on")&&"function"==typeof s[e]?(null!=i[e]||(i[e]=[]),i[e].push(s[e])):r[e]=s[e];if(r.disabled||r["aria-disabled"])for(let s in i)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(s)&&(i[s]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let s in i)Object.assign(r,{[s](e){let t=i[s];for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(let i of t){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;i(e,...r)}}});return r}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return{};if(1===t.length)return t[0];let r={},i={};for(let s of t)for(let e in s)e.startsWith("on")&&"function"==typeof s[e]?(null!=i[e]||(i[e]=[]),i[e].push(s[e])):r[e]=s[e];for(let s in i)Object.assign(r,{[s](){let e=i[s];for(let t of e)null==t||t(...arguments)}});return r}function v(e){var t;return Object.assign((0,s.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function w(e){let t=Object.assign({},e);for(let n in t)void 0===t[n]&&delete t[n];return t}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function A(e){return s.version.split(".")[0]>="19"?e.props.ref:e.ref}function _(e){return e===s.Fragment||e===Symbol.for("react.fragment")}},31479:(e,t,n)=>{"use strict";n.d(t,{I:()=>i,R:()=>r});const r=e=>e,i=e=>e},31576:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(29476);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},32182:(e,t,n)=>{"use strict";n.d(t,{A1:()=>a,q$:()=>o,z:()=>c});const r="^https?:",i="^wss?:";function s(e,t){const n=function(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return"undefined"!==typeof n&&new RegExp(t).test(n)}function o(e){return s(e,r)}function a(e){return s(e,i)}function c(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}},32326:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var r=n(16046);const i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new r.hX({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new r.SK({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new r.B4({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new r.B4({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=null!==t&&void 0!==t?t:this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=null!==t&&void 0!==t?t:e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function s(e){let{recursiveReadLimit:t=8192}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Object.create(i);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}},32381:(e,t,n)=>{"use strict";n.d(t,{m:()=>v,o:()=>w});var r=n(50022),i=n(43621),s=n(72735),o=n(42627),a=n(61395),c=n(20238);var l=n(5843);var u=n(89407);var d=n(3756),h=n(76058),p=n(48633),f=n(61314),g=n(2724);var m=n(56915),y=n(87034);const v=[d.r,m.G,{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},r.D,i.Y,h.R,p.i,f.n,g.n,l.A,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol
2:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},a.E,c.Z,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:56,network:"bsc",name:"Binance Smart Chain",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{privy:{http:["https://bsc-mainnet.rpc.privy.systems"]},default:{http:["https://56.rpc.thirdweb.com"]},public:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{etherscan:{name:"BscScan",url:"https://bscscan.com"},default:{name:"BscScan",url:"https://bscscan.com"}}},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},u._,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},s.m,o.C,y.L,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}
2,rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],w=new Set(v.map(e=>e.id))},33809:(e,t,n)=>{"use strict";n.d(t,{J9:()=>s,Mc:()=>i,fD:()=>r});const r={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},s={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},34129:(e,t)=>{"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<s(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var a=2*(r+1)-1,c=e[a],l=a+1,u=e[l];if(0>s(c,n))l<i&&0>s(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[a]=n,r=a);else{if(!(l<i&&0>s(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}var l=[],u=[],d=1,h=null,p=3,f=!1,g=!1,m=!1,y="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,w="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var t=r(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,n(l,t)}t=r(u)}}function A(e){if(m=!1,b(e),!g)if(null!==r(l))g=!0,R(_);else{var t=r(u);null!==t&&M(A,t.startTime-e)}}function _(e,n){g=!1,m&&(m=!1,v(S),S=-1),f=!0;var s=p;try{for(b(n),h=r(l);null!==h&&(!(h.expirationTime>n)||e&&!C());){var o=h.callback;if("function"===typeof o){h.callback=null,p=h.priorityLevel;var a=o(h.expirationTime<=n);n=t.unstable_now(),"function"===typeof a?h.callback=a:h===r(l)&&i(l),b(n)}else i(l);h=r(l)}if(null!==h)var c=!0;else{var d=r(u);null!==d&&M(A,d.startTime-n),c=!1}return c}finally{h=null,p=s,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,E=!1,k=null,S=-1,I=5,T=-1;function C(){return!(t.unstable_now()-T<I)}function P(){if(null!==k){var e=t.unstable_now();T=e;var n=!0;try{n=k(!0,e)}finally{n?x():(E=!1,k=null)}}else E=!1}if("function"===typeof w)x=function(){w(P)};else if("undefined"!==typeof MessageChannel){var O=new MessageChannel,N=O.port2;O.port1.onmessage=P,x=function(){N.postMessage(null)}}else x=function(){y(P,0)};function R(e){k=e,E||(E=!0,x())}function M(e,n){S=y(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){g||f||(g=!0,R(_))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,i,s){var o=t.unstable_now();switch("object"===typeof s&&null!==s?s="number"===typeof(s=s.delay)&&0<s?o+s:o:s=o,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:s,expirationTime:a=s+a,sortIndex:-1},s>o?(e.sortIndex=s,n(u,e),null===r(l)&&e===r(u)&&(m?(v(S),S=-1):m=!0,M(A,s-o))):(e.sortIndex=a,n(l,e),g||f||(g=!0,R(_))),e},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},34182:(e,t,n)=>{"use strict";n.d(t,{Hx:()=>l,RL:()=>c,b_:()=>a});var r=n(19812),i=n(10860),s=Object.freeze({name:"Ed25519"});async function o(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.byteLength;if(32!==n)throw new i.tsw(i.Dgp,{actualLength:n});const r=function(e){return new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32,...e])}(e);return await crypto.subtle.importKey("pkcs8",r,s,t,["sign"])}async function a(e,t){(0,r.f_)();const n=await crypto.subtle.sign(s,e,t);return new Uint8Array(n)}async function c(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,r.XF)(),64!==e.byteLength)throw new i.tsw(i.Y5q,{byteLength:e.byteLength});const[n,c]=await Promise.all([crypto.subtle.importKey("raw",e.slice(32),s,!0,["verify"]),o(e.slice(0,32),t)]),l=new Uint8Array(32);crypto.getRandomValues(l);const u=await a(c,l);if(!await async function(e,t,n){return(0,r.Zg)(),await crypto.subtle.verify(s,e,t,n)}(n,u,l))throw new i.tsw(i.VO0);return{privateKey:c,publicKey:n}}async function l(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=o(e,t),[s,a]=await Promise.all([(t?n:o(e,!0)).then(async e=>await async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,r.sw)(),!1===e.extractable)throw new i.tsw(i.rXw,{key:e});const n=await crypto.subtle.exportKey("jwk",e);return await crypto.subtle.importKey("jwk",{crv:"Ed25519",ext:t,key_ops:["verify"],kty:"OKP",x:n.x},"Ed25519",t,["verify"])}(e,!0)),n]);return{privateKey:a,publicKey:s}}},34406:(e,t,n)=>{"use strict";function r(e){const t=e.length;let n=0,r=0;for(;r<t;){let i=e.charCodeAt(r++);if(0!==(4294967168&i))if(0===(4294965248&i))n+=2;else{if(i>=55296&&i<=56319&&r<t){const t=e.charCodeAt(r);56320===(64512&t)&&(++r,i=((1023&i)<<10)+(1023&t)+65536)}n+=0===(4294901760&i)?3:4}else n++}return n}n.d(t,{Zf:()=>c,_u:()=>d,dS:()=>r,yi:()=>o});const i=new TextEncoder,s=50;function o(e,t,n){e.length>s?function(e,t,n){i.encodeInto(e,t.subarray(n))}
2(e,t,n):function(e,t,n){const r=e.length;let i=n,s=0;for(;s<r;){let n=e.charCodeAt(s++);if(0!==(4294967168&n)){if(0===(4294965248&n))t[i++]=n>>6&31|192;else{if(n>=55296&&n<=56319&&s<r){const t=e.charCodeAt(s);56320===(64512&t)&&(++s,n=((1023&n)<<10)+(1023&t)+65536)}0===(4294901760&n)?(t[i++]=n>>12&15|224,t[i++]=n>>6&63|128):(t[i++]=n>>18&7|240,t[i++]=n>>12&63|128,t[i++]=n>>6&63|128)}t[i++]=63&n|128}else t[i++]=n}}(e,t,n)}const a=4096;function c(e,t,n){let r=t;const i=r+n,s=[];let o="";for(;r<i;){const t=e[r++];if(0===(128&t))s.push(t);else if(192===(224&t)){const n=63&e[r++];s.push((31&t)<<6|n)}else if(224===(240&t)){const n=63&e[r++],i=63&e[r++];s.push((31&t)<<12|n<<6|i)}else if(240===(248&t)){let n=(7&t)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++];n>65535&&(n-=65536,s.push(n>>>10&1023|55296),n=56320|1023&n),s.push(n)}else s.push(t);s.length>=a&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}const l=new TextDecoder,u=200;function d(e,t,n){return n>u?function(e,t,n){const r=e.subarray(t,t+n);return l.decode(r)}(e,t,n):c(e,t,n)}},34651:(e,t,n)=>{"use strict";n.d(t,{k:()=>l});var r=n(91638),i=n(59892);const s=e=>(0,i.S)((0,r.ZJ)(e));var o=n(23096),a=n(51659);const c=e=>function(e){let t=!0,n="",r=0,i="",s=!1;for(let o=0;o<e.length;o++){const a=e[o];if(["(",")",","].includes(a)&&(t=!0),"("===a&&r++,")"===a&&r--,t)if(0!==r)" "!==a?(i+=a,n+=a):","!==e[o-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===a&&["event","function",""].includes(i))i="";else if(i+=a,")"===a){s=!0;break}}if(!s)throw new a.C("Unable to normalize signature.");return i}("string"===typeof e?e:(0,o.B)(e));function l(e){return t=c(e),s(t);var t}},34673:(e,t,n)=>{"use strict";n.d(t,{B4:()=>f,CQ:()=>A,CW:()=>b,Ei:()=>h,F8:()=>_,P5:()=>p,TH:()=>x,Vl:()=>v,Vr:()=>w,WM:()=>g,WQ:()=>y,im:()=>m,jm:()=>c,lD:()=>o,qh:()=>d,rE:()=>l,ry:()=>u,xn:()=>a});const r=BigInt(2**32-1),i=BigInt(32);function s(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(e&r),l:Number(e>>i&r)}:{h:0|Number(e>>i&r),l:0|Number(e&r)}}function o(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let o=0;o<n;o++){const{h:n,l:a}=s(e[o],t);[r[o],i[o]]=[n,a]}return[r,i]}const a=(e,t,n)=>e>>>n,c=(e,t,n)=>e<<32-n|t>>>n,l=(e,t,n)=>e>>>n|t<<32-n,u=(e,t,n)=>e<<32-n|t>>>n,d=(e,t,n)=>e<<64-n|t>>>n-32,h=(e,t,n)=>e>>>n-32|t<<64-n,p=(e,t,n)=>e<<n|t>>>32-n,f=(e,t,n)=>t<<n|e>>>32-n,g=(e,t,n)=>t<<n-32|e>>>64-n,m=(e,t,n)=>e<<n-32|t>>>64-n;function y(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}}const v=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),w=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,b=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),A=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,_=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),x=(e,t,n,r,i,s)=>t+n+r+i+s+(e/2**32|0)|0},34903:(e,t,n)=>{const r=n(57066),i=n(81705);e.exports={blake2b:r.blake2b,blake2bHex:r.blake2bHex,blake2bInit:r.blake2bInit,blake2bUpdate:r.blake2bUpdate,blake2bFinal:r.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},35653:(e,t,n)=>{"use strict";n.d(t,{M:()=>s});var r=n(57722),i=n(25087);function s(e,t,n,s){let o=(0,i.Y)(n);(0,r.useEffect)(()=>{if(e)return window.addEventListener(t,n,s),()=>window.removeEventListener(t,n,s);function n(e){o.current(e)}},[e,t,s])}},36073:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(71488),i=n(23328),s=n(19582);function o(e){const t=(0,i.e)(e),n=[],o=e.length;for(let i=0;i<o;i++){const o=e[i];(0,r.WL)(o)||n.push((0,s.uT)(o,t))}return n}},36122:(e,t,n)=>{"use strict";n.d(t,{T:()=>I});var r=n(24107),i=n(15882),s=n(36073),o=n(86658),a=n(25741),c=n(42483);const l="0x82ad56cb";var u=n(21165),d=n(51659),h=n(52763),p=n(82281),f=n(15208),g=n(78686),m=n(76416),y=n(67885),v=n(652),w=n(8448),b=n(99705),A=n(56523),_=n(57579),x=n(7919),E=n(45226);const k=["account","authorizationList","batch","blockNumber","blockTag","accessList","blobs","blockOverrides","code","data","factory","factoryData","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","
2nonce","to","value","stateOverride"],S=["data","to"];async function I(e,t){var I,C;const{account:P=e.account,authorizationList:O,batch:N=Boolean(null===(I=e.batch)||void 0===I?void 0:I.multicall),blockNumber:R,blockTag:M=(null!==(C=e.experimental_blockTag)&&void 0!==C?C:"latest"),accessList:U,blobs:L,blockOverrides:B,code:D,data:j,factory:F,factoryData:z,gas:W,gasPrice:q,maxFeePerBlobGas:H,maxFeePerGas:V,maxPriorityFeePerGas:G,nonce:K,to:J,value:Z,stateOverride:Q}=t,Y=(0,i.A)(t,k),X=P?(0,a.J)(P):void 0;if(D&&(F||z))throw new d.C("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(D&&J)throw new d.C("Cannot provide both `code` & `to` as parameters.");const $=D&&j,ee=F&&z&&J&&j,te=$||ee,ne=$?T({code:D,data:j}):ee?function(e){const{data:t,factory:n,factoryData:r,to:i}=e;return(0,g.m)({abi:(0,s.U)(["constructor(address, bytes, address, bytes)"]),bytecode:u.WN,args:[i,t,n,r]})}({data:j,factory:F,factoryData:z,to:J}):j;try{var re;(0,E.c)(t);const n=("bigint"===typeof R?(0,v.cK)(R):void 0)||M,s=B?o.J(B):void 0,a=(0,x.yH)(Q),d=null===(re=e.chain)||void 0===re||null===(re=re.formatters)||void 0===re||null===(re=re.transactionRequest)||void 0===re?void 0:re.format,g=(d||A.Bv)((0,r.A)((0,r.A)({},(0,b.o)(Y,{format:d})),{},{accessList:U,account:X,authorizationList:O,blobs:L,data:ne,gas:W,gasPrice:q,maxFeePerBlobGas:H,maxFeePerGas:V,maxPriorityFeePerGas:G,nonce:K,to:te?void 0:J,value:Z}),"call");if(N&&function(e){let{request:t}=e;const{data:n,to:r}=t,s=(0,i.A)(t,S);return!!n&&(!n.startsWith(l)&&(!!r&&!(Object.values(s).filter(e=>"undefined"!==typeof e).length>0)))}({request:g})&&!a&&!s)try{return await async function(e,t){var n,i;const{batchSize:s=1024,deployless:o=!1,wait:a=0}="object"===typeof(null===(n=e.batch)||void 0===n?void 0:n.multicall)?e.batch.multicall:{},{blockNumber:l,blockTag:d=(null!==(i=e.experimental_blockTag)&&void 0!==i?i:"latest"),data:g,to:w}=t,b=(()=>{if(o)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return(0,y.M)({blockNumber:l,chain:e.chain,contract:"multicall3"});throw new h.YE})(),A="bigint"===typeof l?(0,v.cK)(l):void 0,x=A||d,{schedule:E}=(0,_.u)({id:"".concat(e.uid,".").concat(x),wait:a,shouldSplitBatch(e){const t=e.reduce((e,t)=>{let{data:n}=t;return e+(n.length-2)},0);return t>2*s},fn:async t=>{const n=t.map(e=>({allowFailure:!0,callData:e.data,target:e.to})),i=(0,m.p)({abi:c.v2,args:[n],functionName:"aggregate3"}),s=await e.request({method:"eth_call",params:[(0,r.A)({},null===b?{data:T({code:u.Ez,data:i})}:{to:b,data:i}),x]});return(0,f.e)({abi:c.v2,args:[n],functionName:"aggregate3",data:s||"0x"})}}),[{returnData:k,success:S}]=await E({data:g,to:w});if(!S)throw new p.$S({data:k});return"0x"===k?{data:void 0}:{data:k}}(e,(0,r.A)((0,r.A)({},g),{},{blockNumber:R,blockTag:M}))}catch(ie){if(!(ie instanceof h.YE)&&!(ie instanceof h.rj))throw ie}const w=(()=>{const e=[g,n];return a&&s?[...e,a,s]:a?[...e,a]:s?[...e,{},s]:e})(),k=await e.request({method:"eth_call",params:w});return"0x"===k?{data:void 0}:{data:k}}catch(ie){const i=function(e){var t;if(!(e instanceof d.C))return;const n=e.walk();return"object"===typeof(null===n||void 0===n?void 0:n.data)?null===(t=n.data)||void 0===t?void 0:t.data:n.data}(ie),{offchainLookup:s,offchainLookupSignature:o}=await n.e(2187).then(n.bind(n,62187));if(!1!==e.ccipRead&&(null===i||void 0===i?void 0:i.slice(0,10))===o&&J)return{data:await s(e,{data:i,to:J})};if(te&&"0x101bb98d"===(null===i||void 0===i?void 0:i.slice(0,10)))throw new p.Po({factory:F});throw(0,w.d)(ie,(0,r.A)((0,r.A)({},t),{},{account:X,chain:e.chain}))}}function T(e){const{code:t,data:n}=e;return(0,g.m)({abi:(0,s.U)(["constructor(bytes, bytes)"]),bytecode:u.LX,args:[t,n]})}},36231:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var r=n(51659);class i extends r.C{constructor(e){let{blockHash:t,blockNumber:n}=e,r="Block";t&&(r='Block at hash "'.concat(t,'"')),n&&(r='Block at number "'.concat(n,'"')),super("".concat(r," could not be found."),{name:"BlockNotFoundError"})}}},36457:(e,t,n)=>{"use strict";n.d(t,{sc:()=>A,qt:()=>x,Zf:()=>_});var r=n(5282);function i(e,t,n){return e&t^~e&n}function s(e,t,n){return e&t^e&n^t&n}class o extends r.Vw{constructor(e,t,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=(0,r.O8)(this.buffer)}update(e){(0,r.CC)(this),e=(0,r.ZJ)(e),(0,r.DO)(e);const{view:t,buffer:n,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const t=(0,r.O8)(e);for(;i<=s-o;o+=i)this.process(t,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,r.CC)(this),(0,r.Ht)(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;t[o++]=128,(0,r.uH)(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(n,0),o=0);for(let r=o;r<i;r++)t[r]=0;!function(e,t,n,r){if("function"===typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,a,r)}(n,i-8,BigInt(8*this.length),s),this.process(n,0);const a=(0,r.O8)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let r=0;r<l;r++)a.setUint32(4*r,u[r],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:i,destroyed:s,pos:o}=this;return e.destroyed=s,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const a=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),l=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var u=n(34673);const d=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 2,115 bytes, line 2
2734187,3204031479,3329325298]),h=new Uint32Array(64);class p extends o{constructor(){super(64,arguments.length>0&&void 0!==arguments[0]?arguments[0]:32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:n,D:r,E:i,F:s,G:o,H:a}=this;return[e,t,n,r,i,s,o,a]}set(e,t,n,r,i,s,o,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)h[r]=e.getUint32(t,!1);for(let i=16;i<64;i++){const e=h[i-15],t=h[i-2],n=(0,r.Ow)(e,7)^(0,r.Ow)(e,18)^e>>>3,s=(0,r.Ow)(t,17)^(0,r.Ow)(t,19)^t>>>10;h[i]=s+h[i-7]+n+h[i-16]|0}let{A:n,B:o,C:a,D:c,E:l,F:u,G:p,H:f}=this;for(let g=0;g<64;g++){const e=f+((0,r.Ow)(l,6)^(0,r.Ow)(l,11)^(0,r.Ow)(l,25))+i(l,u,p)+d[g]+h[g]|0,t=((0,r.Ow)(n,2)^(0,r.Ow)(n,13)^(0,r.Ow)(n,22))+s(n,o,a)|0;f=p,p=u,u=l,l=c+e|0,c=a,a=o,o=n,n=e+t|0}n=n+this.A|0,o=o+this.B|0,a=a+this.C|0,c=c+this.D|0,l=l+this.E|0,u=u+this.F|0,p=p+this.G|0,f=f+this.H|0,this.set(n,o,a,c,l,u,p,f)}roundClean(){(0,r.uH)(h)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,r.uH)(this.buffer)}}const f=(()=>u.lD(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
25771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),g=(()=>f[0])(),m=(()=>f[1])(),y=new Uint32Array(80),v=new Uint32Array(80);class w extends o{constructor(){super(128,arguments.length>0&&void 0!==arguments[0]?arguments[0]:64,16,!1),this.Ah=0|l[0],this.Al=0|l[1],this.Bh=0|l[2],this.Bl=0|l[3],this.Ch=0|l[4],this.Cl=0|l[5],this.Dh=0|l[6],this.Dl=0|l[7],this.Eh=0|l[8],this.El=0|l[9],this.Fh=0|l[10],this.Fl=0|l[11],this.Gh=0|l[12],this.Gl=0|l[13],this.Hh=0|l[14],this.Hl=0|l[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:s,Dh:o,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g]}set(e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|s,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let u=0;u<16;u++,t+=4)y[u]=e.getUint32(t),v[u]=e.getUint32(t+=4);for(let g=16;g<80;g++){const e=0|y[g-15],t=0|v[g-15],n=u.rE(e,t,1)^u.rE(e,t,8)^u.xn(e,t,7),r=u.ry(e,t,1)^u.ry(e,t,8)^u.jm(e,t,7),i=0|y[g-2],s=0|v[g-2],o=u.rE(i,s,19)^u.qh(i,s,61)^u.xn(i,s,6),a=u.ry(i,s,19)^u.Ei(i,s,61)^u.jm(i,s,6),c=u.CW(r,a,v[g-7],v[g-16]),l=u.CQ(c,n,o,y[g-7],y[g-16]);y[g]=0|l,v[g]=0|c}let{Ah:n,Al:r,Bh:i,Bl:s,Ch:o,Cl:a,Dh:c,Dl:l,Eh:d,El:h,Fh:p,Fl:f,Gh:w,Gl:b,Hh:A,Hl:_}=this;for(let x=0;x<80;x++){const e=u.rE(d,h,14)^u.rE(d,h,18)^u.qh(d,h,41),t=u.ry(d,h,14)^u.ry(d,h,18)^u.Ei(d,h,41),E=d&p^~d&w,k=h&f^~h&b,S=u.F8(_,t,k,m[x],v[x]),I=u.TH(S,A,e,E,g[x],y[x]),T=0|S,C=u.rE(n,r,28)^u.qh(n,r,34)^u.qh(n,r,39),P=u.ry(n,r,28)^u.Ei(n,r,34)^u.Ei(n,r,39),O=n&i^n&o^i&o,N=r&s^r&a^s&a;A=0|w,_=0|b,w=0|p,b=0|f,p=0|d,f=0|h,({h:d,l:h}=u.WQ(0|c,0|l,0|I,0|T)),c=0|o,l=0|a,o=0|i,a=0|s,i=0|n,s=0|r;const R=u.Vl(T,P,N);n=u.Vr(R,I,C,O),r=0|R}({h:n,l:r}=u.WQ(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:s}=u.WQ(0|this.Bh,0|this.Bl,0|i,0|s)),({h:o,l:a}=u.WQ(0|this.Ch,0|this.Cl,0|o,0|a)),({h:c,l:l}=u.WQ(0|this.Dh,0|this.Dl,0|c,0|l)),({h:d,l:h}=u.WQ(0|this.Eh,0|this.El,0|d,0|h)),({h:p,l:f}=u.WQ(0|this.Fh,0|this.Fl,0|p,0|f)),({h:w,l:b}=u.WQ(0|this.Gh,0|this.Gl,0|w,0|b)),({h:A,l:_}=u.WQ(0|this.Hh,0|this.Hl,0|A,0|_)),this.set(n,r,i,s,o,a,c,l,d,h,p,f,w,b,A,_)}roundClean(){(0,r.uH)(y,v)}destroy(){(0,r.uH)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class b extends w{constructor(){super(48),this.Ah=0|c[0],this.Al=0|c[1],this.Bh=0|c[2],this.Bl=0|c[3],this.Ch=0|c[4],this.Cl=0|c[5],this.Dh=0|c[6],this.Dl=0|c[7],this.Eh=0|c[8],this.El=0|c[9],this.Fh=0|c[10],this.Fl=0|c[11],this.Gh=0|c[12],this.Gl=0|c[13],this.Hh=0|c[14],this.Hl=0|c[15]}}const A=(0,r.qj)(()=>new p),_=(0,r.qj)(()=>new w),x=(0,r.qj)(()=>new b)},36679:(e,t,n)=>{"use strict";n.d(t,{W:()=>f});var r=n(24107),i=n(15882),s=n(25741),o=n(3717),a=n(84090),c=n(652),l=n(56523),u=n(44288),d=n(45226),h=n(97562);const p=["account","chain"];async function f(e,t){var n,f,g;const{account:m=e.account,chain:y=e.chain}=t,v=(0,i.A)(t,p);if(!m)throw new o.T({docsPath:"/docs/actions/wallet/signTransaction"});const w=(0,s.J)(m);(0,d.c)((0,r.A)({account:w},t));const b=await(0,u.T)(e,h.T,"getChainId")({});null!==y&&(0,a.v)({currentChainId:b,chain:y});const A=(null===y||void 0===y?void 0:y.formatters)||(null===(n=e.chain)||void 0===n?void 0:n.formatters),_=(null===A||void 0===A||null===(f=A.transactionRequest)||void 0===f?void 0:f.format)||l.Bv;return w.signTransaction?w.signTransaction((0,r.A)((0,r.A)({},v),{},{chainId:b}),{serializer:null===(g=e.chain)||void 0===g||null===(g=g.serializers)||void 0===g?void 0:g.transaction}):await e.request({method:"eth_signTransaction",params:[(0,r.A)((0,r.A)({},_((0,r.A)((0,r.A)({},v),{},{account:w}),"signTransaction")),{},{chainId:(0,c.cK)(b),from:w.address})]},{retryCount:0})}}
2,36733:(e,t,n)=>{"use strict";n.d(t,{_:()=>d,k:()=>l});var r=n(24107),i=n(15882),s=n(6806),o=n(652);const a=["type"];let c={0:"legacy",1:"eip2930",2:"eip1559",3:"eip4844",4:"eip7702"};const l={legacy:0,eip2930:1,eip1559:2,eip4844:3,eip7702:4};let u=e=>void 0!==e?BigInt(e):void 0;function d(e){var t,n;let l,d="string"==typeof e?JSON.parse(e):e,{type:h=2}=d,p=(0,i.A)(d,a);p.accessList&&Array.isArray(p.accessList)?l=p.accessList.map(e=>Array.isArray(e)?{address:e[0],storageKeys:e[1]}:e):p.accessList&&(l=Object.entries(p.accessList).map(e=>({address:e[0],storageKeys:e[1]})));let f=Number(null!==(t=p.chainId)&&void 0!==t?t:1),g=(0,s.q)(p.data)?p.data:p.data?(0,o.nj)(Uint8Array.from(p.data)):void 0,m=p.nonce?Number(p.nonce):void 0,y={chainId:f,data:g,nonce:m,value:u(p.value),gas:u(null!==(n=p.gas)&&void 0!==n?n:p.gasLimit)},v=Number(h);if(0===v)return(0,r.A)((0,r.A)((0,r.A)({},p),{},{type:c[v]},y),{},{gasPrice:u(p.gasPrice),accessList:void 0,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0});if(1===v)return(0,r.A)((0,r.A)((0,r.A)({},p),{},{type:c[v]},y),{},{gasPrice:u(p.gasPrice),accessList:l,maxFeePerGas:void 0,maxPriorityFeePerGas:void 0});if(2===v)return(0,r.A)((0,r.A)((0,r.A)({},p),{},{type:c[v]},y),{},{nonce:m,accessList:l,maxFeePerGas:u(p.maxFeePerGas),maxPriorityFeePerGas:u(p.maxPriorityFeePerGas),gasPrice:void 0,maxFeePerBlobGas:void 0});throw Error("Unsupported transaction type: ".concat(h))}},36954:(e,t,n)=>{"use strict";n.d(t,{t:()=>s});var r=n(91638),i=n(652);function s(e){var t;const{kzg:n}=e,s=null!==(t=e.to)&&void 0!==t?t:"string"===typeof e.blobs[0]?"hex":"bytes",o="string"===typeof e.blobs[0]?e.blobs.map(e=>(0,r.aT)(e)):e.blobs,a="string"===typeof e.commitments[0]?e.commitments.map(e=>(0,r.aT)(e)):e.commitments,c=[];for(let r=0;r<o.length;r++){const e=o[r],t=a[r];c.push(Uint8Array.from(n.computeBlobKzgProof(e,t)))}return"bytes"===s?c:c.map(e=>(0,i.My)(e))}},37017:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});const r=e=>{let{origin:t,path:n,query:r={},hash:i={}}=e,s=new URL(n,t.endsWith("/")?t:"".concat(t,"/"));for(let[a,c]of Object.entries(r))void 0!==c&&s.searchParams.set(a,c);let o=Object.entries(i);if(o.length>0){let e=new URLSearchParams;for(let[t,n]of o)void 0!==n&&e.append(t,n);s.hash=e.toString()}return s.href}},38203:(e,t,n)=>{"use strict";n.d(t,{Dg:()=>v,Ej:()=>y,Fl:()=>S,HT:()=>l,Ho:()=>f,M7:()=>g,Ro:()=>w,Ty:()=>A,di:()=>m,ii:()=>k,oB:()=>h,sH:()=>p,tf:()=>b,u:()=>E,uK:()=>d,xW:()=>c,xb:()=>u});var r=n(1207),i=n(87247),s=n(92146);const o=new TextEncoder,a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function c(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"0x".concat(t.reduce((e,t)=>e+t.replace("0x",""),""))}function l(e){return e instanceof Uint8Array?d(e):Array.isArray(e)?d(new Uint8Array(e)):e}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n="0x".concat(Number(e));return"number"===typeof t.size?(i.Sl(n,t.size),f(n,t.size)):n}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="";for(let i=0;i<e.length;i++)n+=a[e[i]];const r="0x".concat(n);return"number"===typeof t.size?(i.Sl(r,t.size),g(r,t.size)):r}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{signed:n,size:r}=t,i=BigInt(e);let s;r?s=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"===typeof e&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o="bigint"===typeof s&&n?-s-1n:0;if(s&&i>s||i<o){const t="bigint"===typeof e?"n":"";throw new A({max:s?"".concat(s).concat(t):void 0,min:"".concat(o).concat(t),signed:n,size:r,value:"".concat(e).concat(t)})}const a=(n&&i<0?(1n<<BigInt(8*r))+BigInt(i):i).toString(16),c="0x".concat(a);return r?f(c,r):c}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return d(o.encode(e),t)}function f(e,t){return i.eV(e,{dir:"left",size:t})}function g(e,t){return i.eV(e,{dir:"right",size:t})}function m(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{strict:s}=r;i.kK(e,t);const o="0x".concat(e.replace("0x","").slice(2*(null!==t&&void 0!==t?t:0),2*(null!==n&&void 0!==n?n:e.length)));return s&&i.X(o,t,n),o}function y(e){return Math.ceil((e.length-2)/2)}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{signed:n}=t;t.size&&i.Sl(e,t.size);const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,o=(1n<<8n*BigInt(s))-1n;return r<=o>>1n?r:r-o-1n}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{signed:n,size:r}=t;return Number(n||r?v(e,t):e)}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{strict:n=!1}=t;try{return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{strict:n=!1}=t;if(!e)throw new _(e);
2if("string"!==typeof e)throw new _(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new x(e);if(!e.startsWith("0x"))throw new x(e)}(e,{strict:n}),!0}catch(r){return!1}}class A extends r.C{constructor(e){let{max:t,min:n,signed:r,size:i,value:s}=e;super("Number `".concat(s,"` is not in safe").concat(i?" ".concat(8*i,"-bit"):"").concat(r?" signed":" unsigned"," integer range ").concat(t?"(`".concat(n,"` to `").concat(t,"`)"):"(above `".concat(n,"`)"))),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}r.C;class _ extends r.C{constructor(e){super("Value `".concat("object"===typeof e?s.A(e):e,"` of type `").concat(typeof e,"` is an invalid hex type."),{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class x extends r.C{constructor(e){super("Value `".concat(e,"` is an invalid hex value."),{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}r.C;class E extends r.C{constructor(e){let{givenSize:t,maxSize:n}=e;super("Size cannot exceed `".concat(n,"` bytes. Given size: `").concat(t,"` bytes.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class k extends r.C{constructor(e){let{offset:t,position:n,size:r}=e;super("Slice ".concat("start"===n?"starting":"ending"," at offset `").concat(t,"` is out-of-bounds (size: `").concat(r,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class S extends r.C{constructor(e){let{size:t,targetSize:n,type:r}=e;super("".concat(r.charAt(0).toUpperCase()).concat(r.slice(1).toLowerCase()," size (`").concat(t,"`) exceeds padding size (`").concat(n,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}}
2,38254:(e,t,n)=>{"use strict";n.d(t,{v:()=>A});var r=n(24107),i=n(15882),s=n(25741),o=n(3717),a=n(51659),c=n(6259),l=n(84090),u=n(81946),d=n(99705),h=n(56523),p=n(44288),f=n(6195),g=n(45226),m=n(97562),y=n(4386),v=n(75470);const w=["account","chain","accessList","authorizationList","blobs","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","nonce","type","value"],b=new f.A(128);async function A(e,t){const{account:n=e.account,chain:f=e.chain,accessList:A,authorizationList:_,blobs:x,data:E,gas:k,gasPrice:S,maxFeePerBlobGas:I,maxFeePerGas:T,maxPriorityFeePerGas:C,nonce:P,type:O,value:N}=t,R=(0,i.A)(t,w);if("undefined"===typeof n)throw new o.T({docsPath:"/docs/actions/wallet/sendTransaction"});const M=n?(0,s.J)(n):null;try{(0,g.c)(t);const n=await(async()=>t.to?t.to:null!==t.to&&_&&_.length>0?await(0,c.g)({authorization:_[0]}).catch(()=>{throw new a.C("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if("json-rpc"===(null===M||void 0===M?void 0:M.type)||null===M){var U;let t;null!==f&&(t=await(0,p.T)(e,m.T,"getChainId")({}),(0,l.v)({currentChainId:t,chain:f}));const i=null===(U=e.chain)||void 0===U||null===(U=U.formatters)||void 0===U||null===(U=U.transactionRequest)||void 0===U?void 0:U.format,s=(i||h.Bv)((0,r.A)((0,r.A)({},(0,d.o)(R,{format:i})),{},{accessList:A,account:M,authorizationList:_,blobs:x,chainId:t,data:E,gas:k,gasPrice:S,maxFeePerBlobGas:I,maxFeePerGas:T,maxPriorityFeePerGas:C,nonce:P,to:n,type:O,value:N}),"sendTransaction"),o=b.get(e.uid),a=o?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:a,params:[s]},{retryCount:0})}catch(B){if(!1===o)throw B;const t=B;if("InvalidInputRpcError"===t.name||"InvalidParamsRpcError"===t.name||"MethodNotFoundRpcError"===t.name||"MethodNotSupportedRpcError"===t.name)return await e.request({method:"wallet_sendTransaction",params:[s]},{retryCount:0}).then(t=>(b.set(e.uid,!0),t)).catch(n=>{const r=n;if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw b.set(e.uid,!1),t;throw r});throw t}}if("local"===(null===M||void 0===M?void 0:M.type)){var L;const t=await(0,p.T)(e,y.ft,"prepareTransactionRequest")((0,r.A)((0,r.A)({account:M,accessList:A,authorizationList:_,blobs:x,chain:f,data:E,gas:k,gasPrice:S,maxFeePerBlobGas:I,maxFeePerGas:T,maxPriorityFeePerGas:C,nonce:P,nonceManager:M.nonceManager,parameters:[...y.MM,"sidecars"],type:O,value:N},R),{},{to:n})),i=null===f||void 0===f||null===(L=f.serializers)||void 0===L?void 0:L.transaction,s=await M.signTransaction(t,{serializer:i});return await(0,p.T)(e,v.L,"sendRawTransaction")({serializedTransaction:s})}if("smart"===(null===M||void 0===M?void 0:M.type))throw new o.Z({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new o.Z({docsPath:"/docs/actions/wallet/sendTransaction",type:null===M||void 0===M?void 0:M.type})}catch(D){if(D instanceof o.Z)throw D;throw(0,u.p)(D,(0,r.A)((0,r.A)({},t),{},{account:M,chain:t.chain||void 0}))}}},38274:(e,t,n)=>{"use strict";n.d(t,{lB:()=>o});const r=new Map,i=new Map;let s=0;function o(e,t,n){const o=++s,a=()=>r.get(e)||[],c=()=>{const t=a();if(!t.some(e=>e.id===o))return;const n=i.get(e);if(1===t.length&&n){const e=n();e instanceof Promise&&e.catch(()=>{})}(()=>{const t=a();r.set(e,t.filter(e=>e.id!==o))})()},l=a();if(r.set(e,[...l,{id:o,fns:t}]),l&&l.length>0)return c;const u={};for(const r in t)u[r]=function(){const e=a();if(0!==e.length){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(const t of e){var s,o;null===(s=(o=t.fns)[r])||void 0===s||s.call(o,...n)}}};const d=n(u);return"function"===typeof d&&i.set(e,d),c}},38314:(e,t,n)=>{"use strict";n.d(t,{d:()=>o});var r=n(652),i=n(80028);function s(e){var t;const{commitment:n,version:s=1}=e,o=null!==(t=e.to)&&void 0!==t?t:"string"===typeof n?"hex":"bytes",a=(0,i.s)(n,"bytes");return a.set([s],0),"bytes"===o?a:(0,r.My)(a)}function o(e){var t;const{commitments:n,version:r}=e,i=null!==(t=e.to)&&void 0!==t?t:"string"===typeof n[0]?"hex":"bytes",o=[];for(const a of n)o.push(s({commitment:a,to:i,version:r}));return o}},38420:(e,t,n)=>{"use strict";n.d(t,{w:()=>s});var r=n(5282);class i extends r.Vw{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,r.sd)(e);const n=(0,r.ZJ)(t);if(this.iHash=e.create(),"function"!==typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let r=0;r<s.length;r++)s[r]^=54;this.iHash.update(s),this.oHash=e.create();for(let r=0;r<s.length;r++)s[r]^=106;this.oHash.update(s),(0,r.uH)(s)}update(e){return(0,r.CC)(this),this.iHash.update(e),this}digestInto(e){(0,r.CC)(this),(0,r.DO)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:s,outputLen:o}=this;return e.finished=r,e.destroyed=i,e.blockLen=s,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const s=(e,t,n)=>new i(e,t).update(n).digest();s.create=(e,t)=>
2new i(e,t)},38435:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,r,s,o){if("function"!==typeof r)throw new TypeError("The listener must be a function");var a=new i(r,s||e,o),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i<s;i++)o[i]=r[i].fn;return o},a.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},a.prototype.emit=function(e,t,r,i,s,o){var a=n?n+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,i),!0;case 5:return u.fn.call(u.context,t,r,i,s),!0;case 6:return u.fn.call(u.context,t,r,i,s,o),!0}for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,r);break;case 4:u[l].fn.call(u[l].context,t,r,i);break;default:if(!c)for(h=1,c=new Array(d-1);h<d;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,r,i){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||i&&!a.once||r&&a.context!==r||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||i&&!a[c].once||r&&a[c].context!==r)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a},38910:(e,t,n)=>{"use strict";n.d(t,{q:()=>i});var r=n(24107);function i(e,t){return n=>{let{exclude:i,format:s}=n;return{exclude:i,format:(e,n)=>{const o=t(e,n);if(i)for(const t of i)delete o[t];return(0,r.A)((0,r.A)({},o),s(e,n))},type:e}}}},39898:(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let s=new class{constructor(){i(this,"current",this.detect()),i(this,"handoffState","pending"),i(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}}},40767:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>a});const r=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,s=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function o(e,t){if(!("__proto__"===e||"constructor"===e&&t&&"object"===typeof t&&"prototype"in t))return t;!function(e){console.warn('[destr] Dropping "'.concat(e,'" key to prevent prototype pollution.'))}(e)}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!==typeof e)return e;if('"'===e[0]&&'"'===e[e.length-1]&&-1===e.indexOf("\\"))return e.slice(1,-1);const n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!s.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(r.test(e)||i.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,o)}return JSON.parse(e)}catch(a){if(t.strict)throw a;return e}}},41226:(e,t,n)=>{"use strict";n.d(t,{$s:()=>u,Kc:()=>h,Kz:()=>d,Sq:()=>p,Vg:()=>c,WA:()=>f,aO:()=>o,fZ:()=>l,zW:()=>a});var r=n(62016),i=n(10802),s=n(51659);function o(e){const t=Object.entries(e).map(e=>{let[t,n]=e;return void 0===n||!1===n?null:[t,n]}
2).filter(Boolean),n=t.reduce((e,t)=>{let[n]=t;return Math.max(e,n.length)},0);return t.map(e=>{let[t,r]=e;return" ".concat("".concat(t,":").padEnd(n+1)," ").concat(r)}).join("\n")}s.C;class a extends s.C{constructor(e){let{v:t}=e;super('Invalid `v` value "'.concat(t,'". Expected 27 or 28.'),{name:"InvalidLegacyVError"})}}class c extends s.C{constructor(e){let{transaction:t}=e;super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",o(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}s.C;s.C;class l extends s.C{constructor(e){let{storageKey:t}=e;super('Size for storage key "'.concat(t,'" is invalid. Expected 32 bytes. Got ').concat(Math.floor((t.length-2)/2)," bytes."),{name:"InvalidStorageKeySizeError"})}}class u extends s.C{constructor(e,t){var n;let{account:s,docsPath:a,chain:c,data:l,gas:u,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:f,to:g,value:m}=t;const y=o({chain:c&&"".concat(null===c||void 0===c?void 0:c.name," (id: ").concat(null===c||void 0===c?void 0:c.id,")"),from:null===s||void 0===s?void 0:s.address,to:g,value:"undefined"!==typeof m&&"".concat((0,r.c)(m)," ").concat((null===c||void 0===c||null===(n=c.nativeCurrency)||void 0===n?void 0:n.symbol)||"ETH"),data:l,gas:u,gasPrice:"undefined"!==typeof d&&"".concat((0,i.Q)(d)," gwei"),maxFeePerGas:"undefined"!==typeof h&&"".concat((0,i.Q)(h)," gwei"),maxPriorityFeePerGas:"undefined"!==typeof p&&"".concat((0,i.Q)(p)," gwei"),nonce:f});super(e.shortMessage,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",y].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class d extends s.C{constructor(e){let{blockHash:t,blockNumber:n,blockTag:r,hash:i,index:s}=e,o="Transaction";r&&void 0!==s&&(o='Transaction at block time "'.concat(r,'" at index "').concat(s,'"')),t&&void 0!==s&&(o='Transaction at block hash "'.concat(t,'" at index "').concat(s,'"')),n&&void 0!==s&&(o='Transaction at block number "'.concat(n,'" at index "').concat(s,'"')),i&&(o='Transaction with hash "'.concat(i,'"')),super("".concat(o," could not be found."),{name:"TransactionNotFoundError"})}}class h extends s.C{constructor(e){let{hash:t}=e;super('Transaction receipt with hash "'.concat(t,'" could not be found. The Transaction may not be processed on a block yet.'),{name:"TransactionReceiptNotFoundError"})}}class p extends s.C{constructor(e){let{receipt:t}=e;super('Transaction with hash "'.concat(t.transactionHash,'" reverted.'),{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class f extends s.C{constructor(e){let{hash:t}=e;super('Timed out while waiting for transaction with hash "'.concat(t,'" to be confirmed.'),{name:"WaitForTransactionReceiptTimeoutError"})}}},41661:(e,t,n)=>{"use strict";n.d(t,{CL:()=>c,D5:()=>u,Di:()=>h,G1:()=>P,Gi:()=>l,L5:()=>k,MI:()=>N,RV:()=>_,Sf:()=>A,WT:()=>S,XU:()=>a,YW:()=>g,ab:()=>m,bq:()=>d,cg:()=>T,ch:()=>E,hA:()=>p,hl:()=>I,jz:()=>O,qZ:()=>f,s0:()=>y,sV:()=>b,uL:()=>C,vx:()=>w,xQ:()=>v,xq:()=>x});var r=n(51659),i=n(65015);class s extends r.C{constructor(e,t){let{code:n,docsPath:r,metaMessages:s,name:o,shortMessage:a}=t;super(a,{cause:e,docsPath:r,metaMessages:s||(null===e||void 0===e?void 0:e.metaMessages),name:o||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}
2),this.name=o||e.name,this.code=e instanceof i.J8?e.code:null!==n&&void 0!==n?n:-1}}class o extends s{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class a extends s{constructor(e){super(e,{code:a.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class c extends s{constructor(e){super(e,{code:c.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class l extends s{constructor(e){let{method:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,{code:l.code,name:"MethodNotFoundRpcError",shortMessage:"The method".concat(t?' "'.concat(t,'"'):""," does not exist / is not available.")})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends s{constructor(e){super(e,{code:u.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends s{constructor(e){super(e,{code:d.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class h extends s{constructor(e){super(e,{code:h.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join("\n")})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class p extends s{constructor(e){super(e,{code:p.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class f extends s{constructor(e){super(e,{code:f.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class g extends s{constructor(e){super(e,{code:g.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class m extends s{constructor(e){let{method:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,{code:m.code,name:"MethodNotSupportedRpcError",shortMessage:"Method".concat(t?' "'.concat(t,'"'):""," is not supported.")})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class y extends s{constructor(e){super(e,{code:y.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class v extends s{constructor(e){super(e,{code:v.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class w extends o{constructor(e){super(e,{code:w.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class b extends o{constructor(e){super(e,{code:b.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class A extends o{constructor(e){let{method:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,{code:A.code,name:"UnsupportedProviderMethodError",shortMessage:"The Provider does not support the requested method".concat(t?' " '.concat(t,'"'):"",".")})}}Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class _ extends o{constructor(e){super(e,{code:_.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class x extends o{constructor(e){super(e,{code:x.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class E extends o{constructor(e){super(e,{code:E.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class k extends o{constructor(e){super(e,{code:k.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(k,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class S extends o{constructor(e){super(e,{code:S.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class I extends o{constructor(e){super(e,{code:I.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(I,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class T extends o{constructor(e){super(e,{code:T.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(T,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class C extends o{constructor(e){super(e,{code:C.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class P extends o{constructor(e){super(e,{code:P.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(P,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
2);class O extends o{constructor(e){super(e,{code:O.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class N extends s{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}},41684:(e,t,n)=>{"use strict";n.d(t,{$C:()=>c,Bq:()=>g,C1:()=>p,FU:()=>x,Ns:()=>y,QM:()=>o,Ru:()=>m,Sc:()=>l,iO:()=>_,mC:()=>d,pI:()=>v,vt:()=>E,xL:()=>h,xv:()=>a});var r=n(24107),i=n(10860);var s=(e,t)=>function(e,t){if(e.length>=t)return e;const n=new Uint8Array(t).fill(0);return n.set(e),n}(e.length<=t?e:e.slice(0,t),t);function o(e,t){return"fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function a(e){return Object.freeze((0,r.A)((0,r.A)({},e),{},{encode:t=>{const n=new Uint8Array(o(t,e));return e.write(t,n,0),n}}))}function c(e){return Object.freeze((0,r.A)((0,r.A)({},e),{},{decode:function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.read(t,n)[0]}}))}function l(e){return"fixedSize"in e&&"number"===typeof e.fixedSize}function u(e){return!l(e)}function d(e,t){if(l(e)!==l(t))throw new i.tsw(i.CvZ);if(l(e)&&l(t)&&e.fixedSize!==t.fixedSize)throw new i.tsw(i.Uq4,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!l(e)&&!l(t)&&e.maxSize!==t.maxSize)throw new i.tsw(i.SHY,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return(0,r.A)((0,r.A)((0,r.A)({},t),e),{},{decode:t.decode,encode:e.encode,read:t.read,write:e.write})}function h(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(t.length-n<=0)throw new i.tsw(i.Ot7,{codecDescription:e})}function p(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=n.length-r;if(s<t)throw new i.tsw(i.Uyo,{bytesLength:s,codecDescription:e,expected:t})}function f(e,t,n){if(t<0||t>n)throw new i.tsw(i.v8P,{bytesLength:n,codecDescription:e,offset:t})}function g(e,t){var n,i;const s=(n,r,i)=>{const s=e.encode(n);return i=t.write(s.length,r,i),r.set(s,i),i+s.length};if(l(t)&&l(e))return a((0,r.A)((0,r.A)({},e),{},{fixedSize:t.fixedSize+e.fixedSize,write:s}));const c=l(t)?t.fixedSize:null!==(n=t.maxSize)&&void 0!==n?n:null,u=l(e)?e.fixedSize:null!==(i=e.maxSize)&&void 0!==i?i:null,d=null!==c&&null!==u?c+u:null;return a((0,r.A)((0,r.A)((0,r.A)({},e),null!==d?{maxSize:d}:{}),{},{getSizeFromValue:n=>{const r=o(n,e);return o(r,t)+r},write:s}))}function m(e,t){var n,i;const s=(n,r)=>{const[i,s]=t.read(n,r),o=Number(i);return((r=s)>0||n.length>o)&&(n=n.slice(r,r+o)),p("addDecoderSizePrefix",o,n),[e.decode(n),r+o]};if(l(t)&&l(e))return c((0,r.A)((0,r.A)({},e),{},{fixedSize:t.fixedSize+e.fixedSize,read:s}));const o=l(t)?t.fixedSize:null!==(n=t.maxSize)&&void 0!==n?n:null,a=l(e)?e.fixedSize:null!==(i=e.maxSize)&&void 0!==i?i:null,u=null!==o&&null!==a?o+a:null;return c((0,r.A)((0,r.A)((0,r.A)({},e),null!==u?{maxSize:u}:{}),{},{read:s}))}function y(e,t){return a({fixedSize:t,write:(n,r,i)=>{const s=e.encode(n),o=s.length>t?s.slice(0,t):s;return r.set(o,i),i+t}})}function v(e,t){return c({fixedSize:t,read:(n,r)=>{p("fixCodecSize",t,n,r),(r>0||n.length>t)&&(n=n.slice(r,r+t)),l(e)&&(n=s(n,e.fixedSize));const[i]=e.read(n,0);return[i,r+t]}})}function w(e,t){return c((0,r.A)((0,r.A)({},e),{},{read:(n,r)=>{const i=e=>b(e,n.length),s=t.preOffset?t.preOffset({bytes:n,preOffset:r,wrapBytes:i}):r;f("offsetDecoder",s,n.length);const[o,a]=e.read(n,s),c=t.postOffset?t.postOffset({bytes:n,newPreOffset:s,postOffset:a,preOffset:r,wrapBytes:i}):a;return f("offsetDecoder",c,n.length),[o,c]}}))}function b(e,t){return 0===t?0:(e%t+t)%t}function A(e,t){if(l(e)){const n=t(e.fixedSize);if(n<0)throw new i.tsw(i.rIW,{bytesLength:n,codecDescription:"resizeDecoder"});return c((0,r.A)((0,r.A)({},e),{},{fixedSize:n}))}return e}function _(e,t){return w(A(e,e=>e+t),{postOffset:e=>{let{postOffset:n}=e;return n+t}})}function x(e,t){return a((0,r.A)((0,r.A)({},u(e)?(0,r.A)((0,r.A)({},e),{},{getSizeFromValue:n=>e.getSizeFromValue(t(n))}):e),{},{write:(n,r,i)=>e.write(t(n),r,i)}))}function E(e,t){return c((0,r.A)((0,r.A)({},e),{},{read:(n,r)=>{const[i,s]=e.read(n,r);return[t(i,n,r),s]}}))}},41773:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(41226);function i(e){if(e.type)return e.type;if("undefined"!==typeof e.authorizationList)return"eip7702";if("undefined"!==typeof e.blobs||"undefined"!==typeof e.blobVersionedHashes||"undefined"!==typeof e.maxFeePerBlobGas||"undefined"!==typeof e.sidecars)return"eip4844";if("undefined"!==typeof e.maxFeePerGas||"undefined"!==typeof e.maxPriorityFeePerGas)return"eip1559";if("undefined"!==typeof e.gasPrice)return"undefined"!==typeof e.accessList?"eip2930":"legacy";throw new r.Vg({transaction:e})}}
2,41893:(e,t,n)=>{"use strict";e.exports=n(65997)},42483:(e,t,n)=>{"use strict";n.d(t,{Ag:()=>o,E5:()=>d,Rm:()=>l,SJ:()=>c,UW:()=>u,b2:()=>i,oX:()=>a,v2:()=>r,xw:()=>h});const r=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],i=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],s=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],o=[...s,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],a=[...s,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],c=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],l=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],u=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],d=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],h=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}]},42509:(e,t,n)=>{"use strict";n.d(t,{C:()=>c});var r=n(73183),i=n(91638),s=n(652),o=n(175),a=n(59892);function c(e){var t;const{chainId:n,nonce:c,to:l}=e,u=null!==(t=e.contractAddress)&&void 0!==t?t:e.address,d=(0,a.S)((0,r.aP)(["0x05",(0,o.EQ)([n?(0,s.cK)(n):"0x",u,c?(0,s.cK)(c):"0x"])]));return"bytes"===l?(0,i.aT)(d):d}},42627:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});
2const r={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0}},42922:(e,t,n)=>{"use strict";n.d(t,{e:()=>i});var r=n(44179);function i(){let e=[],t={addEventListener:(e,n,r,i)=>(e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))),requestAnimationFrame(){let e=requestAnimationFrame(...arguments);return t.add(()=>cancelAnimationFrame(e))},nextFrame(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(){let e=setTimeout(...arguments);return t.add(()=>clearTimeout(e))},microTask(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];let s={current:!0};return(0,r._)(()=>{s.current&&n[0]()}),t.add(()=>{s.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=i();return e(t),this.add(()=>t.dispose())},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}},42983:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function i(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}n.d(t,{$:()=>i})},43069:(e,t,n)=>{"use strict";n.d(t,{Ao:()=>i,Au:()=>r});const r=65535n,i=2n**256n-1n},43157:(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var r=n(57722),i=n(42922);function s(){let[e]=(0,r.useState)(i.e);return(0,r.useEffect)(()=>()=>e.dispose(),[e]),e}},43302:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:()=>r})},43470:(e,t,n)=>{"use strict";n.d(t,{S:()=>a});var r=n(57722),i=n(91866),s=n(74324),o=n(73660);function a(e,t){let n=(0,r.useId)(),a=i.D.get(t),[c,l]=(0,s.y)(a,(0,r.useCallback)(e=>[a.selectors.isTop(e,n),a.selectors.inStack(e,n)],[a,n]));return(0,o.s)(()=>{if(e)return a.actions.push(n),()=>a.actions.pop(n)},[a,e,n]),!!e&&(!l||c)}},43537:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var r=n(24107);function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var s=0;function o(e){return"__private_"+s+++"_"+e}var a=o("_wallet"),c=o("_account");class l{get standardWallet(){return i(this,a)[a]}get address(){return i(this,c)[c].address}async disconnect(){var e;if(null===(e=i(this,a)[a].features["standard:disconnect"])||void 0===e||!e.disconnect)throw Error("Wallet does not support disconnect");await i(this,a)[a].features["standard:disconnect"].disconnect()}async signMessage(){var e;if(null===(e=i(this,a)[a].features["solana:signMessage"])||void 0===e||!e.signMessage)throw Error("Wallet does not support signMessage");for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];let o=await i(this,a)[a].features["solana:signMessage"].signMessage(...n.map(e=>(0,r.A)((0,r.A)({},e),{},{account:i(this,c)[c]})));return 1===n.length?o[0]:[...o]}async signTransaction(){var e;if(null===(e=i(this,a)[a].features["solana:signTransaction"])||void 0===e||!e.signTransaction)throw Error("Wallet does not support signTransaction");for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];let o=await i(this,a)[a].features["solana:signTransaction"].signTransaction(...n.map(e=>(0,r.A)((0,r.A)({},e),{},{account:i(this,c)[c]})));return 1===n.length?o[0]:[...o]}async signAndSendTransaction(){var e;if(null===(e=i(this,a)[a].features["solana:signAndSendTransaction"])||void 0===e||!e.signAndSendTransaction)throw Error("Wallet does not support signAndSendTransaction");for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];let o=await i(this,a)[a].features["solana:signAndSendTransaction"].signAndSendTransaction(...n.map(e=>(0,r.A)((0,r.A)({},e),{},{account:i(this,c)[c]})));return 1===n.length?o[0]:[...o]}async signAndSendAllTransactions(e){var t;if(null===(t=i(this,a)[a].features["solana:signAndSendTransaction"])||void 0===t||!t.signAndSendTransaction)throw Error("Wallet does not support signAndSendTransaction");return[...await i(this,a)[a].features["solana:signAndSendTransaction"].signAndSendTransaction(...e.map(e=>(0,r.A)((0,r.A)({},e),{},{account:i(this,c)[c]})))]}constructor(e){let{wallet:t,account:n}=e;Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:void 0}),i(this,a)[a]=t,i(this,c)[c]=n}}},43621:(e,t,n)=>{"use strict";n.d(t,{Y:()=>r});const r={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol
2:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0}},43888:(e,t,n)=>{"use strict";n.d(t,{v:()=>d});var r=n(42922),i=n(95554),s=n(43470),o=n(73660);let a=new Map,c=new Map;function l(e){var t;let n=null!=(t=c.get(e))?t:0;return c.set(e,n+1),0!==n||(a.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>u(e)}function u(e){var t;let n=null!=(t=c.get(e))?t:1;if(1===n?c.delete(e):c.set(e,n-1),1!==n)return;let r=a.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,a.delete(e))}function d(e){let{allowed:t,disallowed:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(0,s.S)(e,"inert-others");(0,o.s)(()=>{var e,s;if(!a)return;let o=(0,r.e)();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&o.add(l(t));let c=null!=(s=null==t?void 0:t())?s:[];for(let t of c){if(!t)continue;let e=(0,i.TW)(t);if(!e)continue;let n=t.parentElement;for(;n&&n!==e.body;){for(let e of n.children)c.some(t=>e.contains(t))||o.add(l(e));n=n.parentElement}}return o.dispose},[a,t,n])}},44131:(e,t,n)=>{"use strict";n.d(t,{U:()=>a,g:()=>o,t:()=>s,u:()=>c});var r=n(49931),i=n(57722);const s=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-ver
2ifier"};throw Error("Failed to get account entropy details")},o=(e,t)=>{if(null!==t&&void 0!==t&&t.imported)return s(t);let n=(0,r.g)(e);if(!n)throw Error("Failed to find primary wallet");return s(n)},a=(0,i.createContext)(null);function c(){let e=(0,i.useContext)(a);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e}},44154:(e,t,n)=>{"use strict";n.d(t,{N:()=>l,b:()=>c});var r=n(94718),i=n(63015),s=n(44288),o=n(11383),a=n(60086);async function c(e,t){return l(e,t)}async function l(e,t){const{block:n,chain:c=e.chain,request:l}=t||{};try{var u,d,h;const t=null!==(u=null===c||void 0===c||null===(d=c.fees)||void 0===d?void 0:d.maxPriorityFeePerGas)&&void 0!==u?u:null===c||void 0===c||null===(h=c.fees)||void 0===h?void 0:h.defaultPriorityFee;if("function"===typeof t){const r=n||await(0,s.T)(e,o.g,"getBlock")({}),i=await t({block:r,client:e,request:l});if(null===i)throw new Error;return i}if("undefined"!==typeof t)return t;const r=await e.request({method:"eth_maxPriorityFeePerGas"});return(0,i.uU)(r)}catch(p){const[t,i]=await Promise.all([n?Promise.resolve(n):(0,s.T)(e,o.g,"getBlock")({}),(0,s.T)(e,a.L,"getGasPrice")({})]);if("bigint"!==typeof t.baseFeePerGas)throw new r.pw;const c=i-t.baseFeePerGas;return c<0n?0n:c}}},44179:(e,t,n)=>{"use strict";function r(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}n.d(t,{_:()=>r})},44270:(e,t,n)=>{"use strict";n.d(t,{iY:()=>l});var r=n(24107),i=n(18656),s=n(6806),o=n(27133),a=n(47573),c=n(78203);function l(e){const{abi:t,args:n=[],name:r}=e,o=(0,s.q)(r,{strict:!1}),l=t.filter(e=>o?"function"===e.type?(0,c.V)(e)===r:"event"===e.type&&(0,a.h)(e)===r:"name"in e&&e.name===r);if(0===l.length)return;if(1===l.length)return l[0];let h;for(const s of l){if(!("inputs"in s))continue;if(!n||0===n.length){if(!s.inputs||0===s.inputs.length)return s;continue}if(!s.inputs)continue;if(0===s.inputs.length)continue;if(s.inputs.length!==n.length)continue;if(n.every((e,t)=>{const n="inputs"in s&&s.inputs[t];return!!n&&u(e,n)})){if(h&&"inputs"in h&&h.inputs){const e=d(s.inputs,h.inputs,n);if(e)throw new i.nM({abiItem:s,type:e[0]},{abiItem:h,type:e[1]})}h=s}}return h||l[0]}function u(e,t){const n=typeof e,i=t.type;switch(i){case"address":return(0,o.P)(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===i&&"components"in t?Object.values(t.components).every((t,n)=>u(Object.values(e)[n],t)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i)&&(Array.isArray(e)&&e.every(e=>u(e,(0,r.A)((0,r.A)({},t),{},{type:i.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function d(e,t,n){for(const r in e){const i=e[r],s=t[r];if("tuple"===i.type&&"tuple"===s.type&&"components"in i&&"components"in s)return d(i.components,s.components,n[r]);const a=[i.type,s.type];if((()=>!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&(0,o.P)(n[r],{strict:!1}))())return a}}},44288:(e,t,n)=>{"use strict";function r(e,t,n){const r=e[t.name];if("function"===typeof r)return r;const i=e[n];return"function"===typeof i?i:n=>t(e,n)}n.d(t,{T:()=>r})},44423:(e,t,n)=>{"use strict";n.d(t,{Zh:()=>l});var r=n(24107),i=n(70759),s=n(73183),o=n(652),a=n(59892),c=n(17236);function l(e){const{domain:t={},message:n,primaryType:i}=e,o=(0,r.A)({EIP712Domain:(0,c.H4)({domain:t})},e.types);(0,c.$$)({domain:t,message:n,primaryType:i,types:o});const l=["0x1901"];return t&&l.push(function(e){let{domain:t,types:n}=e;return u({data:t,primaryType:"EIP712Domain",types:n})}({domain:t,types:o})),"EIP712Domain"!==i&&l.push(u({data:n,primaryType:i,types:o})),(0,a.S)((0,s.xW)(l))}function u(e){let{data:t,primaryType:n,types:r}=e;const i=d({data:t,primaryType:n,types:r});return(0,a.S)(i)}function d(e){let{data:t,primaryType:n,types:r}=e;const s=[{type:"bytes32"}],o=[h({primaryType:n,types:r})];for(const i of r[n]){const[e,n]=f({types:r,name:i.name,type:i.type,value:t[i.name]});s.push(e),o.push(n)}return(0,i.h)(s,o)}function h(e){let{primaryType:t,types:n}=e;const r=(0,o.nj)(function(e){let{primaryType:t,types:n}=e,r="";const i=p({primaryType:t,types:n});i.delete(t);const s=[t,...Array.from(i).sort()];for(const o of s)r+="".concat(o,"(").concat(n[o].map(e=>{let{name:t,type:n}=e;return"".concat(n," ").concat(t)}).join(","),")");return r}({primaryType:t,types:n}));return(0,a.S)(r)}function p(e){let{primaryType:t,types:n}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;const i=t.match(/^[0-9A-Z_a-z]*/),s=null===i||void 0===i?void 0:i[0];if(r.has(s)||void 0===n[s])return r;r.add(s);for(const o of n[s])p({primaryType:o.type,types:n},r);return r}function f(e){let{types:t,name:n,type:r,value:s}=e;if(void 0!==t[r])return[{type:"bytes32"},(0,a.S)(d({data:s,primaryType:r,types:t}))];if("bytes"===r)return[{type:"bytes32"},(0,a.S)(s)];if("string"===r)return[{type:"bytes32"},(0,a.S)((0,o.nj)(s))];if(r.lastIndexOf("]")===r.length-1){const e=r.slice(0,r.lastIndexOf("[")),o=s.map(r=>f({name:n,type:e,types:t,value:r}));return[{type:"bytes32"},(0,a.S)((0,i.h)(o.map(e=>{let[t]=e;return t}),o.map(e=>{let[,t]=e;return t})))]}return[{type:r},s]}},44464:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},45207:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});
2class r extends Error{constructor(e){super(e);const t=Object.create(r.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:r.name})}}},45226:(e,t,n)=>{"use strict";n.d(t,{c:()=>c});var r=n(25741),i=n(43069),s=n(23422),o=n(14764),a=n(27133);function c(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:c,to:l}=e,u=t?(0,r.J)(t):void 0;if(u&&!(0,a.P)(u.address))throw new s.M({address:u.address});if(l&&!(0,a.P)(l))throw new s.M({address:l});if(n&&n>i.Ao)throw new o.BG({maxFeePerGas:n});if(c&&n&&c>n)throw new o.lN({maxFeePerGas:n,maxPriorityFeePerGas:c})}},45334:(e,t,n)=>{"use strict";n.d(t,{Q:()=>_});var r=n(24107),i=n(15882),s=n(25741),o=n(51659),a=n(6259),c=n(652),l=n(62016),u=n(10802),d=n(41226);class h extends o.C{constructor(e,t){var n;let{account:r,docsPath:i,chain:s,data:o,gas:a,gasPrice:c,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:f,to:g,value:m}=t;const y=(0,d.aO)({from:null===r||void 0===r?void 0:r.address,to:g,value:"undefined"!==typeof m&&"".concat((0,l.c)(m)," ").concat((null===s||void 0===s||null===(n=s.nativeCurrency)||void 0===n?void 0:n.symbol)||"ETH"),data:o,gas:a,gasPrice:"undefined"!==typeof c&&"".concat((0,u.Q)(c)," gwei"),maxFeePerGas:"undefined"!==typeof h&&"".concat((0,u.Q)(h)," gwei"),maxPriorityFeePerGas:"undefined"!==typeof p&&"".concat((0,u.Q)(p)," gwei"),nonce:f});super(e.shortMessage,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",y].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}var p=n(14764),f=n(66320);const g=["docsPath"];var m=n(99705),y=n(56523),v=n(7919),w=n(45226),b=n(4386);const A=["accessList","authorizationList","blobs","blobVersionedHashes","blockNumber","blockTag","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","nonce","value","stateOverride"];async function _(e,t){const{account:n=e.account,prepare:l=!0}=t,u=n?(0,s.J)(n):void 0,d=Array.isArray(l)?l:"local"!==(null===u||void 0===u?void 0:u.type)?["blobVersionedHashes"]:void 0;try{var _,x;const n=await(async()=>t.to?t.to:t.authorizationList&&t.authorizationList.length>0?await(0,a.g)({authorization:t.authorizationList[0]}).catch(()=>{throw new o.C("`to` is required. Could not infer from `authorizationList`")}):void 0)(),s=l?await(0,b.ft)(e,(0,r.A)((0,r.A)({},t),{},{parameters:d,to:n})):t,{accessList:h,authorizationList:p,blobs:f,blobVersionedHashes:g,blockNumber:E,blockTag:k,data:S,gas:I,gasPrice:T,maxFeePerBlobGas:C,maxFeePerGas:P,maxPriorityFeePerGas:O,nonce:N,value:R,stateOverride:M}=s,U=(0,i.A)(s,A);if(I&&t.gas!==I)return I;const L=("bigint"===typeof E?(0,c.cK)(E):void 0)||k,B=(0,v.yH)(M);(0,w.c)(t);const D=null===(_=e.chain)||void 0===_||null===(_=_.formatters)||void 0===_||null===(_=_.transactionRequest)||void 0===_?void 0:_.format,j=(D||y.Bv)((0,r.A)((0,r.A)({},(0,m.o)(U,{format:D})),{},{account:u,accessList:h,authorizationList:p,blobs:f,blobVersionedHashes:g,data:S,gasPrice:T,maxFeePerBlobGas:C,maxFeePerGas:P,maxPriorityFeePerGas:O,nonce:N,to:n,value:R}),"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:B?[j,null!==(x=null!==L&&void 0!==L?L:e.experimental_blockTag)&&void 0!==x?x:"latest",B]:L?[j,L]:[j]}))}catch(E){throw function(e,t){let{docsPath:n}=t,s=(0,i.A)(t,g);const o=(()=>{const t=(0,f.l)(e,s);return t instanceof p.RM?e:t})();return new h(o,(0,r.A)({docsPath:n},s))}(E,(0,r.A)((0,r.A)({},t),{},{account:u,chain:e.chain}))}}},45482:(e,t,n)=>{"use strict";function r(e,t){this.v=e,this.k=t}n.d(t,{A:()=>r})},46455:(e,t,n)=>{"use strict";n.d(t,{H:()=>r});class r{}},46755:(e,t,n)=>{"use strict";n.d(t,{L:()=>p});var r=n(65015),i=n(51659);class s extends i.C{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}var o=n(57579),a=n(24107);var c=n(73251);function l(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const u=l();function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{async request(n){var i,s,o,l;const{body:d,fetchFn:h=(null!==(i=t.fetchFn)&&void 0!==i?i:fetch),onRequest:p=t.onRequest,onResponse:f=t.onResponse,timeout:g=(null!==(s=t.timeout)&&void 0!==s?s:1e4)}=n,m=(0,a.A)((0,a.A)({},null!==(o=t.fetchOptions)&&void 0!==o?o:{}),null!==(l=n.fetchOptions)&&void 0!==l?l:{}),{headers:y,method:v,signal:w}=m;try{var b;const t=await function(e,t){let{errorInstance:n=new Error("timed out"),timeout:r,signal:i}=t;return new Promise((t,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{i?a.abort():s(n)},r)),t(await e({signal:(null===a||void 0===a?void 0:a.signal)||null}))}catch(a){"AbortError"===(null===a||void 0===a?void 0:a.name)&&s(n),s(a)}finally{clearTimeout(o)}})()})}(async t=>{var n,r,i;let{signal:s}=t;const o=(0,a.A)((0,a.A)({},m),{},{body:Array.isArray(d)?(0,c.A)(d.map(e=>{var t;return(0,a.A)({jsonrpc:"2.0",id:null!==(t=e.id)&&void 0!==t?t:u.take()},e)})):(0,c.A)((0,a.A)({jsonrpc:"2.0",id:null!==(n=d.id)&&void 0!==n?n:u.take()},d)),headers:(0,a.A)({"Content-Type":"application/json"},y),method:v||"POST",signal:w||(g>0?s:null)}
2),l=new Request(e,o),f=null!==(r=await(null===p||void 0===p?void 0:p(l,o)))&&void 0!==r?r:(0,a.A)((0,a.A)({},o),{},{url:e});return await h(null!==(i=f.url)&&void 0!==i?i:e,f)},{errorInstance:new r.MU({body:d,url:e}),timeout:g,signal:!0});let n;if(f&&await f(t),null!==(b=t.headers.get("Content-Type"))&&void 0!==b&&b.startsWith("application/json"))n=await t.json();else{n=await t.text();try{n=JSON.parse(n||"{}")}catch(A){if(t.ok)throw A;n={error:n}}}if(!t.ok)throw new r.Ci({body:d,details:(0,c.A)(n.error)||t.statusText,headers:t.headers,status:t.status,url:e});return n}catch(A){if(A instanceof r.Ci)throw A;if(A instanceof r.MU)throw A;throw new r.Ci({body:d,cause:A,url:e})}}}}var h=n(8447);function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{batch:n,fetchFn:i,fetchOptions:a,key:c="http",methods:l,name:u="HTTP JSON-RPC",onFetchRequest:p,onFetchResponse:f,retryDelay:g,raw:m}=t;return y=>{var v,w;let{chain:b,retryCount:A,timeout:_}=y;const{batchSize:x=1e3,wait:E=0}="object"===typeof n?n:{},k=null!==(v=t.retryCount)&&void 0!==v?v:A,S=null!==(w=null!==_&&void 0!==_?_:t.timeout)&&void 0!==w?w:1e4,I=e||(null===b||void 0===b?void 0:b.rpcUrls.default.http[0]);if(!I)throw new s;const T=d(I,{fetchFn:i,fetchOptions:a,onRequest:p,onResponse:f,timeout:S});return(0,h.o)({key:c,methods:l,name:u,async request(e){let{method:t,params:i}=e;const s={method:t,params:i},{schedule:a}=(0,o.u)({id:I,wait:E,shouldSplitBatch:e=>e.length>x,fn:e=>T.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:c,result:l}]=await(async e=>n?a(e):[await T.request({body:e})])(s);if(m)return{error:c,result:l};if(c)throw new r.J8({body:s,error:c,url:I});return l},retryCount:k,retryDelay:g,timeout:S,type:"http"},{fetchOptions:a,url:I})}}}
2,47e3:(e,t,n)=>{"use strict";n.d(t,{b4:()=>o,gU:()=>c,uP:()=>a});var r=n(24107),i=n(63015),s=n(38910);const o={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function a(e,t){const n=(0,r.A)((0,r.A)({},e),{},{blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?(0,i.ME)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,i.ME)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?o[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0});return e.authorizationList&&(n.authorizationList=e.authorizationList.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"===typeof n.v){if(0n===n.v||27n===n.v)return 0;if(1n===n.v||28n===n.v)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),"legacy"===n.type&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),"eip2930"===n.type&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),"eip1559"===n.type&&delete n.maxFeePerBlobGas,n}const c=(0,s.q)("transaction",a)},47197:(e,t,n)=>{"use strict";n.d(t,{E:()=>h});var r=n(24107),i=n(15882),s=n(25741),o=n(3717),a=n(76416),c=n(92674),l=n(44288),u=n(38254);const d=["abi","account","address","args","dataSuffix","functionName"];async function h(e,t){return h.internal(e,u.v,"sendTransaction",t)}!function(e){e.internal=async function(e,t,n,u){const{abi:h,account:p=e.account,address:f,args:g,dataSuffix:m,functionName:y}=u,v=(0,i.A)(u,d);if("undefined"===typeof p)throw new o.T({docsPath:"/docs/contract/writeContract"});const w=p?(0,s.J)(p):null,b=(0,a.p)({abi:h,args:g,functionName:y});try{return await(0,l.T)(e,t,n)((0,r.A)({data:"".concat(b).concat(m?m.replace("0x",""):""),to:f,account:w},v))}catch(A){throw(0,c.j)(A,{abi:h,address:f,args:g,docsPath:"/docs/contract/writeContract",functionName:y,sender:null===w||void 0===w?void 0:w.address})}}}(h||(h={}))},47563:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(91638),i=n(652);function s(e){var t;const{kzg:n}=e,s=null!==(t=e.to)&&void 0!==t?t:"string"===typeof e.blobs[0]?"hex":"bytes",o="string"===typeof e.blobs[0]?e.blobs.map(e=>(0,r.aT)(e)):e.blobs,a=[];for(const r of o)a.push(Uint8Array.from(n.blobToKzgCommitment(r)));return"bytes"===s?a:a.map(e=>(0,i.My)(e))}},47573:(e,t,n)=>{"use strict";n.d(t,{h:()=>r});const r=n(34651).k},47677:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var r=n(57722),i=n(95554);function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)(()=>(0,i.TW)(...t),[...t])}},48106:(e,t,n)=>{"use strict";n.d(t,{rC:()=>s,xn:()=>o,yF:()=>i});var r=n(5708);function i(e){return(0,r.PW)(e)}function s(e){return e}function o(e){return e}},48117:(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var r=n(57722);let i=(0,r.createContext)(void 0);function s(){return(0,r.useContext)(i)}},48633:(e,t,n)=>{"use strict";n.d(t,{i:()=>r});const r={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0}},49080:(e,t,n)=>{"use strict";n.d(t,{C:()=>T,P:()=>I,S:()=>L,W:()=>j,a:()=>W,b:()=>z,c:()=>N,d:()=>E,e:()=>P,f:()=>k,g:()=>V,h:()=>D,i:()=>F,j:()=>S,l:()=>R,p:()=>H,t:()=>U,u:()=>O});var r=n(15882),i=n(24107),s=n(27999),o=n(50022),a=n(43621),c=n(72735),l=n(42627),u=n(61395),d=n(20238),h=n(3756),p=n(76058),f=n(48633),g=n(61314),m=n(2724),y=n(56915),v=n(43537),w=n(30549),b=n(51380),A=n(99844),_=n(90034);const x=["style"];class E extends b.P{constructor(){super("Wallet timeout"),this.type="wallet_error"}}const k=e=>e instanceof b.P?e:null!==e&&void 0!==e&&e.code?new I(e):new b.P("Unknown connector error",e);class S extends b.c{constructor(e,t,n){super(e),this.type="provider_error",this.co
2de=t,this.data=n}}class I extends S{constructor(e){var t,n,r;super(e.message,e.code,e.data);let i=Object.values(s.Z9).find(t=>t.eipCode===e.code);this.details=i||s.Z9.UNKNOWN_ERROR,-32002===e.code&&(null!==(t=e.message)&&void 0!==t&&t.includes("already pending for origin")?null!==(n=e.message)&&void 0!==n&&n.includes("wallet_requestPermissions")?this.details=s.Z9.E32002_CONNECTION_ALREADY_PENDING:this.details=s.Z9.E32002_REQUEST_ALREADY_PENDING:(null===(r=e.message)||void 0===r?void 0:r.includes("Already processing"))&&e.message.includes("eth_requestAccounts")&&(this.details=s.Z9.E32002_WALLET_LOCKED))}}const T=(0,i.A)({ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},s.Z9);class C{get(e){let t=localStorage.getItem(e);return null===t?void 0:JSON.parse(t)}put(e,t){void 0!==t?localStorage.setItem(e,JSON.stringify(t)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(e=>{let[t]=e;return t})}}function P(){try{let e="privy:__session_storage__test",t=new C;return t.put(e,"blobby"),t.del(e),!0}catch(e){return!1}}var O="undefined"!=typeof window&&window.localStorage?new C:new class{get(e){return this._cache[e]}put(e,t){void 0!==t?this._cache[e]=t:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};class N extends w.A{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const R=()=>{let e=O.get(A.b);return e&&Array.isArray(e)&&e.map(e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e)).every(Boolean)?e:[]};let M=["phantom","glow","solflare","backpack","okx_wallet","walletconnect","mobile_wallet_adapter","jupiter"];function U(e){return e.toLowerCase().split(" ").join("_")}class L extends N{get isInstalled(){return!0}get wallet(){return this._wallet}buildConnectedWallet(){return this._wallet.accounts.map(e=>({type:"solana",provider:new v.W({wallet:this._wallet,account:e}),address:e.address,connectedAt:Date.now(),walletClientType:this._wallet.name,connectorType:this.connectorType,imported:!1,meta:{name:this._wallet.name,id:this._wallet.name,icon:this._wallet.icon},isConnected:async()=>this._wallet.accounts.length>0,disconnect:async()=>{await this.disconnect()}}))}async syncAccounts(){this.wallets=this.buildConnectedWallet(),this.emit("walletsUpdated")}get walletBranding(){return{id:B(this.wallet)?"walletconnect_solana":this.wallet.name,name:this.wallet.name,icon:this.wallet.icon}}async initialize(){var e;this.subscribeListeners(),await this.syncAccounts(),this.shouldAttemptAutoConnect()&&(await(null===(e=this.wallet.features["standard:connect"])||void 0===e?void 0:e.connect({silent:!0}).catch(()=>{})),await this.isConnected()&&await this.syncAccounts()),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?(await this.syncAccounts(),this.getConnectedWallet()):null}async getConnectedWallet(){return this.wallets.sort((e,t)=>t.connectedAt-e.connectedAt)[0]||null}async isConnected(){return this._wallet.accounts.length>0}subscribeListeners(){var e;this._unsubscribeListeners=null===(e=this.wallet.features["standard:events"])||void 0===e?void 0:e.on("change",this.onChange)}unsubscribeListeners(){var e;null===(e=this._unsubscribeListeners)||void 0===e||e.call(this)}shouldAttemptAutoConnect(){return!(!this.autoConnectEnabled||!M.includes(this.walletClientType))&&("phantom"!==this.walletClientType&&"metamask"!==this.walletClientType.toLowerCase()||R().some(e=>{let{walletClientType:t}=e;return"phantom"===t||"metamask"===t.toLowerCase()}))}constructor(e,t){super(U(B(e)?"walletconnect_solana":e.name)),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=async()=>{var e;await(null===(e=this.wallet.features["standard:disconnect"])||void 0===e?void 0:e.disconnect().catch(e=>console.error("Error disconnecting",e))),await this.syncAccounts()},this.promptConnection=async()=>{try{var t;await(null===(t=this.wallet.features["standard:connect"])||void 0===t?void 0:t.connect())}catch(e){throw k(e)}},this.onChange=()=>{this.syncAccounts()},this._wallet=e,this.autoConnectEnabled=t,this.wallets=[]}}
2function B(e){return"isWalletConnectSolana"in e&&e.isWalletConnectSolana}const D=e=>{let{style:t}=e,n=(0,r.A)(e,x),s=(0,A.u)();return(0,_.jsxs)("svg",(0,i.A)((0,i.A)({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:(0,i.A)({height:"28px",width:"28px"},t)},n),{},{children:[(0,_.jsx)("rect",{width:"28",height:"28",rx:"3",fill:"dark"===(null===s||void 0===s?void 0:s.appearance.palette.colorScheme)?"#3396ff":"#141414"}),(0,_.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,_.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,_.jsx)("defs",{children:(0,_.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,_.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]}))},j="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscA
2wXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC";function F(e){return["ethereum","solana"].includes(e.chainType)}function z(e){let t=e.replace("eip155:","");if(t)return parseInt(t);throw Error("Chain ID not compatible with CAIP-2 format.")}const W=e=>e.filter(e=>"wallets"===e.method||("exchange"===e.method?"coinbase"===e.provider:"card"===e.method||"payment-request"===e.method?"coinbase"===e.provider||"moonpay"===e.provider:(e.method,!1))),q={[h.r.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[y.G.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[p.R.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[f.i.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[g.n.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[m.n.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[u.E.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[d.Z.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[c.m.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[l.C.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[o.D.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[a.Y.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},H=e=>{var t,n,r;let i,s,{address:o,appConfig:a,fundWalletConfig:c,methodScreen:l,chainIdOverride:u,comingFromSendTransactionScreen:d=!1,onComplete:h,onError:p}=e;if(!a.fundingConfig)throw Error("Wallet funding is not enabled");let f=W(a.fundingConfig.options);if(f.length<1)throw Error("Wallet funding is not enabled");i=u||(null!==c&&void 0!==c&&c.chain?c.chain.id:z(a.fundingConfig.defaultRecommendedCurrency.chain));let g=a.chains.find(e=>e.id===i);if(!g)throw new b.a("Funding chain ".concat(i," is not in PrivyProvider chains list"));let m=null!==(t=null===c||void 0===c?void 0:c.amount)&&void 0!==t?t:a.fundingConfig.defaultRecommendedAmount,y=!1;function v(){if(!i)return;let e=q[i];f.find(e=>"wallets"===e.method)&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),s=e,y=!0}c&&"asset"in c?"USDC"===c.asset?v():"string"!=typeof c.asset&&"erc20"in c.asset&&(y=((e,t)=>e===q[t.id])(s=c.asset.erc20,g)):"USDC"===a.fundingConfig.defaultRecommendedCurrency.asset&&v();let w=null===c||void 0===c?void 0:c.defaultFundingMethod;return{chainType:"ethereum",address:o,amount:m,chain:g,erc20Address:s,erc20ContractInfo:y?{symbol:"USDC",decimals:6}:void 0,isUSDC:y,methodScreen:l,supportedOptions:f,comingFromSendTransactionScreen:d,defaultFundingMethod:w,usingDefaultFundingMethod:!!w,preferredCardProvider:null===c||void 0===c||null===(n=c.card)||void 0===n?void 0:n.preferredProvider,crossChainBridgingEnabled:null!==(r=a.fundingConfig.crossChainBridgingEnabled)&&void 0!==r&&r,solanaChain:"solana:mainnet",uiConfig:c&&"uiConfig"in c?c.uiConfig:void 0,externalSolanaFundingScreen:null,onComplete:null!==h&&void 0!==h?h:()=>{},onError:null!==p&&void 0!==p?p:()=>{}}};function V(e){var t,n,r;let{address:i,fundWalletConfig:s,appConfig:o,comingFromSendTransactionScreen:a,externalSolanaFundingScreen:c,methodScreen:l}=e;if(!o.fundingConfig)throw Error("Wallet funding is not enabled");let u=W(o.fundingConfig.options);if(u.length<1)throw Error("Wallet funding is not enabled");if("USDC"===(null===s||void 0===s?void 0:s.asset)&&"solana:testnet"===(null===s||void 0===s?void 0:s.chain))throw Error("USDC funding is not supported on the Solana testnet");let d=null!==(t=null===s||void 0===s?void 0:s.amount)&&void 0!==t?t:o.fundingConfig.defaultRecommendedAmount,h=null===s||void 0===s?void 0:s.defaultFundingMethod;return{chainType:"solana",address:i,supportedOptions:u,amount:d,isUSDC:"USDC"===(null===s||void 0===s?void 0:s.asset),methodScreen:l,comingFromSendTransactionScreen:a,chain:(null===s||void 0===s?void 0:s.chain)||"solana:mainnet",crossChainBridgingEnabled:null!==(n=o.fundingConfig.crossChainBridgingEnabled)&&void 0!==n&&n,defaultFundingMethod:h,preferredCardProvider:null===s||void 0===s||null===(r=s.card)||void 0===r?void 0:r.preferredProvider,usingDefaultFundingMethod:!!h,uiConfig:null===s||void 0===s?void 0:s.uiConfig,externalSolanaFundingScreen:c,onComplete:()=>{},onError:()=>{}}}},49645:(e,t,n)=>{"use strict";n.d(t,{J:()=>c});var r=n(18656),i=n(14061),s=n(78203),o=n(90934),a=n(68419);function c(e){const{abi:t,data:n}=e,c=(0,i.di)(n,0,4),l=t.find(e=>"function"===e.type&&c===(0,s.V)((0,a.B)(e)));if(!l)throw new r.EB(c,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:l.name,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,o.n)(l.inputs,(0,i.di)(n,4)):void 0}}},49931:(e,t,n)=>{"use strict";n.d(t,{M:()=>T,P:()=>P,a:()=>C,b:()=>f,c:()=>v,d:()=>N,e:()=>g,f:()=>w,g:()=>E,h:()=>_,i:()=>d,j:()=>b,k:()=>x,l:()=>k,o:()=>y,u:()=>O});var r=n(24107),i=n(15882),s=n(10133),o=n(90034),a=n(57722),c=n(99844),l=n(51380);const u=["src"];function d(e){return"string"==typeof e&&/^custom:[a-zA-Z0-9_-]+$/i.test(e)}function h(e){return e?new Date(1e3*e):null}function p(e,t){return e.slice().sort((e,t)=>
2{var n,r,i,s;return(null!==(n=null===(r=e.firstVerifiedAt)||void 0===r?void 0:r.getTime())&&void 0!==n?n:0)-(null!==(i=null===(s=t.firstVerifiedAt)||void 0===s?void 0:s.getTime())&&void 0!==i?i:0)}).find(e=>e.type===t)}const f=e=>{var t;return e&&null!==(t=g(e).find(e=>0===e.walletIndex))&&void 0!==t?t:null},g=e=>e?m(e,"ethereum"):[],m=(e,t)=>e.linkedAccounts.filter(e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t),y=e=>e?m(e,"solana"):[],v=e=>{var t;return e&&null!==(t=y(e).find(e=>0===e.walletIndex))&&void 0!==t?t:null},w=e=>{var t;return(null!==(t=null===e||void 0===e?void 0:e.linkedAccounts)&&void 0!==t?t:[]).filter(e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType)},b=e=>{var t;return(null!==(t=null===e||void 0===e?void 0:e.linkedAccounts)&&void 0!==t?t:[]).filter(e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType)},A=(e,t)=>e===t||!(!e.startsWith("0x")||!t.startsWith("0x"))&&(0,s.b)(e)===(0,s.b)(t),_=(e,t)=>(null===e||void 0===e?void 0:e.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&A(e.address,t)))||null,x=(e,t)=>e.find(e=>A(e.address,t))||null,E=e=>{var t;return null!==(t=f(e))&&void 0!==t?t:v(e)};function k(e){var t;if(!e)return null;let n=function(e){let t=[];for(let n of e){let e=n.type;switch(n.type){case"wallet":let r={id:n.id,address:n.address,type:n.type,imported:n.imported,delegated:n.delegated,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at),chainType:n.chain_type,walletClientType:n.wallet_client_type,connectorType:n.connector_type,recoveryMethod:n.recovery_method,walletIndex:n.wallet_index,publicKey:n.public_key};t.push(r);break;case"smart_wallet":let i={address:n.address,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at),smartWalletType:n.smart_wallet_type,smartWalletVersion:n.smart_wallet_version};t.push(i);break;case"cross_app":let s={type:n.type,subject:n.subject,embeddedWallets:n.embedded_wallets,smartWallets:n.smart_wallets,providerApp:{id:n.provider_app_id},firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(s);break;case"email":let o={address:n.address,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(o);break;case"phone":let a={number:n.phoneNumber,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(a);break;case"google_oauth":let c={subject:n.subject,email:n.email,name:n.name,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(c);break;case"spotify_oauth":let l={subject:n.subject,email:n.email,name:n.name,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(l);break;case"instagram_oauth":let u={subject:n.subject,username:n.username,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(u);break;case"twitter_oauth":let p={subject:n.subject,username:n.username,name:n.name,type:n.type,profilePictureUrl:n.profile_picture_url,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(p);break;case"discord_oauth":let f={subject:n.subject,username:n.username,email:n.email,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(f);break;case"github_oauth":let g={subject:n.subject,username:n.username,name:n.name,email:n.email,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(g);break;case"tiktok_oauth":let m={subject:n.subject,username:n.username,name:n.name,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(m);break;case"line_oauth":let y={subject:n.subject,name:n.name,email:n.email,profilePictureUrl:n.profile_picture_url,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(y);break;case"twitch_oauth":let v={subject:n.subject,username:n.username,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let w={subject:n.subject,name:n.name,email:n.email,vanityName:n.vanity_name,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(w);break;case"apple_oauth":let b={subject:n.subject,email:n.email,type:n.type,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:n.type,customUserId:n.custom_user_id,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)});break;case"farcaster":let A={type:n.type,fid:n.fid,ownerAddress:n.owner_address,displayName:n.display_name,username:n.username,bio:n.bio,pfp:n.profile_picture_url,url:n.homepage_url,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at),signerPublicKey:n.signer_public_key};t.push(A);break;case"passkey":let _={type:n.type,enrolledInMfa:n.enrolled_in_mfa,credentialId:n.credential_id,publicKey:n.public_key,authenticatorName:n.authenticator_name,createdWithDevice:n.created_with_device,createdWithOs:n.created_with_os,createdWithBrowser:n.created_with_browser,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(_);break;case"telegram":let x={type:n.type,telegramUserId:n.telegram_user_id,firstName:n.first_name,lastName:n.last_name,username:n.username,photoUrl:n.photo_url,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(x);break;
2default:if(d(n.type)){let e={type:n.type,subject:n.subject,name:n.name,username:n.username,email:n.email,profilePictureUrl:n.profile_picture_url,firstVerifiedAt:h(n.first_verified_at),latestVerifiedAt:h(n.latest_verified_at)};t.push(e);break}console.warn("Unrecognized account type: ".concat(e,". Please consider upgrading the Privy SDK."))}}return t}(e.linked_accounts),r=p(n,"wallet"),i=p(n,"smart_wallet"),s=p(n,"email"),o=p(n,"phone"),a=p(n,"google_oauth"),c=p(n,"twitter_oauth"),l=p(n,"discord_oauth"),u=p(n,"github_oauth"),f=p(n,"spotify_oauth"),g=p(n,"instagram_oauth"),m=p(n,"tiktok_oauth"),y=p(n,"line_oauth"),v=p(n,"twitch_oauth"),w=p(n,"linkedin_oauth"),b=p(n,"apple_oauth"),A=p(n,"farcaster"),_=p(n,"telegram"),x=e.mfa_methods.map(e=>{let{type:t,verified_at:n}=e;return{type:t,verifiedAt:h(n)}});return{id:e.id,createdAt:h(e.created_at),linkedAccounts:n,email:s&&{address:null===s||void 0===s?void 0:s.address},phone:o&&{number:null===o||void 0===o?void 0:o.number},wallet:r&&{id:r.id,address:r.address,chainType:r.chainType,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,delegated:r.delegated,walletIndex:r.walletIndex,publicKey:r.publicKey},smartWallet:i&&{address:i.address,smartWalletType:i.smartWalletType,smartWalletVersion:i.smartWalletVersion},google:a&&{subject:a.subject,email:a.email,name:a.name},twitter:c&&{subject:c.subject,username:c.username,name:c.name,profilePictureUrl:c.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:u&&{subject:u.subject,username:u.username,name:u.name,email:u.email},spotify:f&&{subject:f.subject,email:f.email,name:f.name},instagram:g&&{subject:g.subject,username:g.username},tiktok:m&&{subject:m.subject,username:m.username,name:m.name},line:y&&{subject:y.subject,name:y.name,email:y.email,profilePictureUrl:y.profilePictureUrl},twitch:v&&{subject:v.subject,username:v.username},linkedin:w&&{subject:w.subject,name:w.name,email:w.email,vanityName:w.vanityName},apple:b&&{subject:b.subject,email:b.email},farcaster:A&&{fid:A.fid,ownerAddress:A.ownerAddress,displayName:A.displayName,username:A.username,bio:A.bio,pfp:A.pfp,url:A.url,signerPublicKey:A.signerPublicKey},telegram:_&&{telegramUserId:_.telegramUserId,firstName:_.firstName,lastName:_.lastName,username:_.username,photoUrl:_.photoUrl},delegatedWallets:[],mfaMethods:x.map(e=>e.type),hasAcceptedTerms:null!==(t=e.has_accepted_terms)&&void 0!==t&&t,isGuest:e.is_guest,customMetadata:e.custom_metadata}}function S(e){let{src:t}=e,n=(0,i.A)(e,u);return(0,o.jsx)("img",(0,r.A)((0,r.A)({src:t},n),{},{style:{display:"none"}}))}const I=(0,a.createContext)({currentScreen:null,lastScreen:null,navigate:l.n,navigateBack:l.n,resetNavigation:l.n,setModalData:l.n,onUserCloseViaDialogOrKeybindRef:void 0}),T=e=>{var t;let n=(0,c.u)(),[r,i]=(0,a.useState)(e.initialScreen),s=(0,a.useRef)(null);(0,a.useEffect)(()=>{e.open||(s.current=null)},[e.open]),(0,a.useEffect)(()=>{s.current=null},[e.initialScreen]);let l={data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:function(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.setInitialScreen(t),n&&i(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),i(null)},onUserCloseViaDialogOrKeybindRef:s};return(0,o.jsxs)(I.Provider,{value:l,children:[("string"==typeof n.appearance.logo||"img"===(null===(t=n.appearance.logo)||void 0===t?void 0:t.type))&&(0,o.jsx)(S,{src:"string"==typeof n.appearance.logo?n.appearance.logo:n.appearance.logo.props.src}),e.children]})},C=()=>(0,a.useContext)(I),P=(0,a.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:l.n,login:l.n,connectOrCreateWallet:l.n,linkEmail:l.n,linkPhone:l.n,linkFarcaster:l.n,linkWallet:l.n,startCrossAppAuthFlow:l.n,linkGoogle:l.n,linkTwitter:l.n,linkTwitch:l.n,linkDiscord:l.n,linkGithub:l.n,linkSpotify:l.n,linkInstagram:l.n,linkTelegram:l.n,linkTiktok:l.n,linkLine:l.n,linkLinkedIn:l.n,linkApple:l.n,linkPasskey:l.n,updateEmail:l.n,updatePhone:l.n,logout:l.n,getAccessToken:l.n,unlinkEmail:l.n,unlinkPhone:l.n,unlinkWallet:l.n,unlinkGoogle:l.n,unlinkTwitter:l.n,unlinkTwitch:l.n,unlinkDiscord:l.n,unlinkGithub:l.n,unlinkSpotify:l.n,unlinkInstagram:l.n,unlinkTiktok:l.n,unlinkLine:l.n,unlinkLinkedIn:l.n,unlinkApple:l.n,unlinkCrossAppAccount:l.n,unlinkFarcaster:l.n,unlinkTelegram:l.n,unlinkPasskey:l.n,signMessage:l.n,signTypedData:l.n,enrollInMfa:l.n,initEnrollmentWithSms:l.n,initEnrollmentWithTotp:l.n,initEnrollmentWithPasskey:l.n,promptMfa:l.n,init:l.n,submitEnrollmentWithSms:l.n,submitEnrollmentWithTotp:l.n,submitEnrollmentWithPasskey:l.n,unenroll:l.n,submit:l.n,cancel:l.n,sendTransaction:l.n,signTransaction:l.n,exportWallet:l.n,setWalletPassword:l.n,setWalletRecovery:l.n,requestFarcasterSignerFromWarpcast:l.n,getFarcasterSignerPublicKey:l.n,signFarcasterMessage:l.n,signMessageWithCrossAppWallet:l.n,signTypedDataWithCrossAppWallet:l.n,sendTransactionWithCrossAppWallet:l.n,signTransactionWithCrossAppWallet:l.n,isModalOpen:!1,mfaMethods:[]}),O=()=>(0,a.useContext)(P),N=e=>!!e.id&&"privy-v2"===e.recoveryMethod},50022:(e,t,n)=>{"use strict";n.d(t,{D:()=>r});const r={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol
2:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}}},50448:(e,t,n)=>{"use strict";n.d(t,{_:()=>l});var r=n(24107),i=n(15882),s=n(15548),o=n(54798),a=n(67821);const c=["wallet_id"];async function l(e,t,n){let{wallet_id:l}=n,u=(0,i.A)(n,c),d={version:1,url:e.getCompiledPath(s.H_,{params:{wallet_id:l}}),method:s.H_.method,headers:{"privy-app-id":e.app.appId},body:(0,r.A)({},u)},{signature:h}=await async function(e,t){let n=o(t);if(void 0===n)throw new a.wE({error:"Failed to prepare the payload for signing",code:"invalid_input"});let r=Buffer.from(n).toString("base64"),{signature:i}=await e({message:r});return{signature:i}}(t,d);return await e.fetchPrivyRoute(s.H_,{body:u,params:{wallet_id:l},headers:{"privy-authorization-signature":h}})}},50543:(e,t,n)=>{"use strict";t.g=void 0;const r=n(70121);t.g=function(){let e,t;try{e=r.getDocumentOrThrow(),t=r.getLocationOrThrow()}catch(s){return null}function n(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i=e.getElementsByTagName("meta");for(let e=0;e<i.length;e++){const t=i[e],r=["itemprop","property","name"].map(e=>t.getAttribute(e)).filter(e=>!!e&&n.includes(e));if(r.length&&r){const e=t.getAttribute("content");if(e)return e}}return""}const i=function(){let t=n("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}();return{description:n("description","og:description","twitter:description","keywords"),url:t.origin,icons:function(){const n=e.getElementsByTagName("link"),r=[];for(let e=0;e<n.length;e++){const i=n[e],s=i.getAttribute("rel");if(s&&s.toLowerCase().indexOf("icon")>-1){const e=i.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let n=t.protocol+"//"+t.host;if(0===e.indexOf("/"))n+=e;else{const r=t.pathname.split("/");r.pop();n+=r.join("/")+"/"+e}r.push(n)}else if(0===e.indexOf("//")){const n=t.protocol+e;r.push(n)}else r.push(e)}}return r}(),name:i}}},51145:(e,t,n)=>{"use strict";n.d(t,{BD:()=>l,Bm:()=>f,CU:()=>A,Fh:()=>g,MZ:()=>p,Me:()=>u,Uo:()=>a,p9:()=>b,pW:()=>y,wl:()=>w});var r=n(42922),i=n(56973),s=n(64284),o=n(95554);let a=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(","),c=["[data-autofocus]"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(",");var l=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(l||{}),u=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(u||{}),d=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(d||{});function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(a)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var p=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(p||{});function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var n;return e!==(null==(n=(0,o.TW)(e))?void 0:n.body)&&(0,s.Y)(t,{0:()=>e.matches(a),1(){let t=e;for(;null!==t;){if(t.matches(a))return!0;t=t.parentElement}return!1}})}function g(e){(0,r.e)().nextFrame(()=>{let t=(0,o.bq)(e);t&&i.Lk(t)&&!f(t,0)&&y(e)})}var m=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(m||{});function y(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let v=["textarea","input"].join(",");function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let s=r.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function b(e,t){return A(h(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null===e?document.body:(0,o.zm)(e)),t,{relativeTo:e})}function A(e,t){let{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Array.isArray(e)?e.length>0?(0,o.zm)(e[0]):document:(0,o.zm)(e),a=Array.isArray(e)?n?w(e):e:64&t?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(c)).sort((e,t)=>
2Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e):h(e);i.length>0&&a.length>1&&(a=a.filter(e=>!i.some(t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))),r=null!=r?r:null==s?void 0:s.activeElement;let l,u=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,a.indexOf(r))-1;if(4&t)return Math.max(0,a.indexOf(r))+1;if(8&t)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),p=32&t?{preventScroll:!0}:{},f=0,g=a.length;do{if(f>=g||f+g<=0)return 0;let e=d+f;if(16&t)e=(e+g)%g;else{if(e<0)return 3;if(e>=g)return 1}l=a[e],null==l||l.focus(p),f+=u}while(l!==(0,o.bq)(l));return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,v))&&n}(l)&&l.select(),2}},51380:(e,t,n)=>{"use strict";n.d(t,{I:()=>A,P:()=>u,a:()=>c,b:()=>p,c:()=>o,d:()=>b,e:()=>a,f:()=>d,g:()=>f,h:()=>l,i:()=>h,j:()=>y,k:()=>w,l:()=>g,m:()=>m,n:()=>v,u:()=>_});var r,i=n(66398),s=n(57722);class o extends Error{toString(){return"".concat(this.type).concat(this.privyErrorCode?"-".concat(this.privyErrorCode):"",": ").concat(this.message).concat(this.cause?" [cause: ".concat(this.cause,"]"):"")}constructor(e,t,n){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=n}}class a extends o{constructor(e,t,n,r,i,s){super(n,r,i),this.type=e,this.status=t,this.data=s}}class c extends o{constructor(e,t,n){super(e,t,n),this.type="client_error"}}class l extends c{constructor(){super("Request timed out",void 0,"client_request_timeout")}}class u extends o{constructor(e,t,n){super(e,t,n),this.type="connector_error"}}const d=e=>{if(e instanceof o)return e;if(!(e instanceof i.F))return h(e);if(!e.response)return new a("api_error",null,e.message,e);let{type:t,message:n,error:r,code:s}=e.data;return new a(t||"ApiError",e.response.status,n||r,e,s,e.data)},h=e=>e instanceof o?e:e instanceof Error?new c(e.message,e):new c("Internal error: ".concat(e));var p=((r={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",r.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",r.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",r.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",r.INVALID_DATA="invalid_data",r.INVALID_CAPTCHA="invalid_captcha",r.LINKED_TO_ANOTHER_USER="linked_to_another_user",r.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",r.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",r.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",r.USER_EXITED_UPDATE_FLOW="exited_update_flow",r.ALLOWLIST_REJECTED="allowlist_rejected",r.OAUTH_USER_DENIED="oauth_user_denied",r.OAUTH_UNEXPECTED="oauth_unexpected",r.UNKNOWN_AUTH_ERROR="unknown_auth_error",r.USER_EXITED_AUTH_FLOW="exited_auth_flow",r.USER_EXITED_LINK_FLOW="exited_link_flow",r.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",r.MUST_BE_AUTHENTICATED="must_be_authenticated",r.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",r.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",r.CLIENT_REQUEST_TIMEOUT="client_request_timeout",r.INVALID_CREDENTIALS="invalid_credentials",r.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",r.UNKNOWN_MFA_ERROR="unknown_mfa_error",r.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",r.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",r.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",r.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",r.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",r.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",r.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",r.TRANSACTION_FAILURE="transaction_failure",r.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",r.NOT_SUPPORTED="not_supported",r.CAPTCHA_TIMEOUT="captcha_timeout",r.INVALID_MESSAGE="invalid_message",r.UNABLE_TO_SIGN="unable_to_sign",r.CAPTCHA_FAILURE="captcha_failure",r.CAPTCHA_DISABLED="captcha_disabled",r.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",r.TOO_MANY_REQUESTS="too_many_requests",r.USER_LIMIT_REACHED="max_accounts_reached",r.DISALLOWED_LOGIN_METHOD="disallowed_login_method",r.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",r.PASSKEY_NOT_ALLOWED="passkey_not_allowed",r.USER_DOES_NOT_EXIST="user_does_not_exist",r.INSUFFICIENT_BALANCE="insufficient_balance",r.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",r.BUFFER_NOT_DEFINED="buffer_not_defined",r.UNSUPPORTED_WALLET_TYPE="unsupported_wallet_type",r.UNKNOWN_FUNDING_ERROR="unknown_funding_error",r);class f extends c{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}}class g extends c{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Embedded wallet error",arguments.length>1?arguments[1]:void 0,"unknown_embedded_wallet_error")}}class m extends c{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"User must be authenticated",void 0,"must_be_authenticated")}}class y extends c{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}}const v=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},w=e=>()=>{throw Error(e.trim())},b=()=>{},A=(0,s.createContext)({setAuthenticated:v,setUser:v,setIsNewUser:v,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:v,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",onCustomAuthAuthenticated:v,hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:v,initializeWalletProxy:v,getAuthMeta:v,getAuthFlow:v,closePrivyModal:v,openPrivyModal:v,connectWallet:v,initLoginWithWallet:v,loginWithWallet:v,initLoginWithFarcaster:v,loginWithFarcaster:v,loginWithCode:v,initLoginWithEmail:v,initLoginWithSms:v,initUpdateEmail:v,initUpdatePhone:v,resendEmailCode:v,resendSmsCode:v,initLoginWithHeadlessOAuth:v,loginWithHeadlessOAuth:v,crossAppAuthFlow:v,initLoginWithOAuth:v,loginWithOAuth:v,passkeyAuthState:{status:"initial"},setPasskeyAuthState:v,initSignupWithPasskey:v,signupWithPasskey:v,initLoginWithPasskey:v,loginWithPasskey:v,initLinkWithPasskey:v,linkWithPasskey:v,refreshSessionAndUser:v,walletProxy:null,createAnalyticsEvent:v,acceptTerms:v,getUsdTokenPrice:v,getUsdPriceForSol:v,getSplTokenMetadata:v,recoverEmbeddedWallet:v,updateWallets:v,fundWallet:v,openModal:v,setReadyToTrue:v,requestFarcasterSignerStatus:v,initLoginWithTelegram:v,loginWithTelegram:v,generateSiweMessage:v,generateSiweMessageForSmartWallet:v,loginWithSiwe:v,linkWithSiwe:v,linkSmartWallet:v,delegateWallet:v,revokeDelegatedWallets:v,connectCoinbaseSmartWallet:v,connectBaseAccount:v,initiateAccountTransfer:v,emailOtpState:{status:"initial"},setEmailOtpState:v,smsOtpState:{status:"initial"},setSmsOtpState:v,siweState:{status:"initial"},setSiweState:v,oAuthState:{status:"initial"},setOAuthState:v,telegramAuthState:{status:"initial"},setTelegramAuthState:v,isHeadlessOAuthLoading:!1,isHeadlessSigning:v,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:v}),_=()=>(0,s.useContext)(A)},51475:(e,t,n)=>{"use strict";n.d(t,{i:()=>a});var r=n(7488),i=n(61307);
2class s extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class o extends s{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}Symbol.asyncIterator;function a(e){if("string"!==typeof e)throw new o("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:n}=e.split(".");if(5===n)throw new o("Only JWTs using Compact JWS serialization can be decoded");if(3!==n)throw new o("Invalid JWT");if(!t)throw new o("JWTs must contain a payload");let s,a;try{s=(0,r.D)(t)}catch(c){throw new o("Failed to base64url decode the payload")}try{a=JSON.parse(i.D0.decode(s))}catch(l){throw new o("Failed to parse the decoded payload as JSON")}if(!function(e){if("object"!==typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(a))throw new o("Invalid JWT Claims Set");return a}},51659:(e,t,n)=>{"use strict";n.d(t,{C:()=>o});var r=n(24107);const i="2.41.2";let s={getDocsUrl:e=>{let{docsBaseUrl:t,docsPath:n="",docsSlug:r}=e;return n?"".concat(null!==t&&void 0!==t?t:"https://viem.sh").concat(n).concat(r?"#".concat(r):""):void 0},version:"viem@".concat(i)};class o extends Error{constructor(e){var t,n,a;let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const l=c.cause instanceof o?c.cause.details:null!==(u=c.cause)&&void 0!==u&&u.message?c.cause.message:c.details;var u;const d=c.cause instanceof o&&c.cause.docsPath||c.docsPath,h=null===(t=(n=s).getDocsUrl)||void 0===t?void 0:t.call(n,(0,r.A)((0,r.A)({},c),{},{docsPath:d}));super([e||"An error occurred.","",...c.metaMessages?[...c.metaMessages,""]:[],...h?["Docs: ".concat(h)]:[],...l?["Details: ".concat(l)]:[],...s.version?["Version: ".concat(s.version)]:[]].join("\n"),c.cause?{cause:c.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=l,this.docsPath=d,this.metaMessages=c.metaMessages,this.name=null!==(a=c.name)&&void 0!==a?a:this.name,this.shortMessage=e,this.version=i}walk(e){return a(this,e)}}function a(e,t){return null!==t&&void 0!==t&&t(e)?e:e&&"object"===typeof e&&"cause"in e&&void 0!==e.cause?a(e.cause,t):t?null:e}},52177:(e,t,n)=>{"use strict";n.d(t,{Ee:()=>k,ZL:()=>S,k2:()=>x});var r=n(24107),i=n(15882),s=n(57722),o=n(86483),a=n(43157),c=n(72582),l=n(73160),u=n(47677),d=n(6642),h=n(52830),p=n(39898),f=n(31445);const g=["ownerDocument"],m=["enabled","ownerDocument"],y=["target"];let v=s.Fragment,w=(0,f.FX)(function(e,t){let{ownerDocument:n=null}=e,r=(0,i.A)(e,g),c=(0,s.useRef)(null),m=(0,d.P)((0,d.a)(e=>{c.current=e}),t),y=(0,u.g)(c.current),w=function(e){let t=(0,h.S)(),n=(0,s.useContext)(A),[r,i]=(0,s.useState)(()=>{var r;if(!t&&null!==n)return null!=(r=n.current)?r:null;if(p._.isServer)return null;let i=null==e?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(null===e)return null;let s=e.createElement("div");return s.setAttribute("id","headlessui-portal-root"),e.body.appendChild(s)});return(0,s.useEffect)(()=>{null!==r&&(null!=e&&e.body.contains(r)||null==e||e.body.appendChild(r))},[r,e]),(0,s.useEffect)(()=>{t||null!==n&&i(n.current)},[n,i,t]),r}(null!=n?n:y),b=(0,s.useContext)(_),x=(0,a.L)(),E=(0,f.Ci)();return(0,l.X)(()=>{var e;w&&w.childNodes.length<=0&&(null==(e=w.parentElement)||e.removeChild(w))}),w?(0,o.createPortal)(s.createElement("div",{"data-headlessui-portal":"",ref:e=>{x.dispose(),b&&e&&x.add(b.register(e))}},E({ourProps:{ref:m},theirProps:r,slot:{},defaultTag:v,name:"Portal"})),w):null});let b=s.Fragment,A=(0,s.createContext)(null);let _=(0,s.createContext)(null);function x(){let e=(0,s.useContext)(_),t=(0,s.useRef)([]),n=(0,c._)(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=(0,c._)(n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,s.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,s.useMemo)(()=>function(e){let{children:t}=e;return s.createElement(_.Provider,{value:i},t)},[i])]}let E=(0,f.FX)(function(e,t){let n=(0,d.P)(t),{enabled:o=!0,ownerDocument:a}=e,c=(0,i.A)(e,m),l=(0,f.Ci)();return o?s.createElement(w,(0,r.A)((0,r.A)({},c),{},{ownerDocument:a,ref:n})):l({ourProps:{ref:n},theirProps:c,slot:{},defaultTag:v,name:"Portal"})}),k=(0,f.FX)(function(e,t){let{target:n}=e,r=(0,i.A)(e,y),o={ref:(0,d.P)(t)},a=(0,f.Ci)();return s.createElement(A.Provider,{value:n},a({ourProps:o,theirProps:r,defaultTag:b,name:"Popover.Group"}))}),S=Object.assign(E,{Group:k})},52431:(e,t,n)=>{"use strict";n.d(t,{a:()=>m});var r=n(24107),i=n(15882),s=n(25741),o=n(94718),a=n(81946),c=n(99705),l=n(47e3),u=n(56523),d=n(44288),h=n(45226),p=n(11383),f=n(97562);const g=["account","accessList","authorizationList","chain","blobVersionedHashes","blobs","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","
2nonce","nonceManager","to","type","value"];async function m(e,t){var n;const{account:m=e.account,accessList:y,authorizationList:v,chain:w=e.chain,blobVersionedHashes:b,blobs:A,data:_,gas:x,gasPrice:E,maxFeePerBlobGas:k,maxFeePerGas:S,maxPriorityFeePerGas:I,nonce:T,nonceManager:C,to:P,type:O,value:N}=t,R=(0,i.A)(t,g),M=await(async()=>{if(!m)return T;if(!C)return T;if("undefined"!==typeof T)return T;const t=(0,s.J)(m),n=w?w.id:await(0,d.T)(e,f.T,"getChainId")({});return await C.consume({address:t.address,chainId:n,client:e})})();(0,h.c)(t);const U=null===w||void 0===w||null===(n=w.formatters)||void 0===n||null===(n=n.transactionRequest)||void 0===n?void 0:n.format,L=(U||u.Bv)((0,r.A)((0,r.A)({},(0,c.o)(R,{format:U})),{},{account:m?(0,s.J)(m):void 0,accessList:y,authorizationList:v,blobs:A,blobVersionedHashes:b,data:_,gas:x,gasPrice:E,maxFeePerBlobGas:k,maxFeePerGas:S,maxPriorityFeePerGas:I,nonce:M,to:P,type:O,value:N}),"fillTransaction");try{var B,D,j,F,z,W,q,H,V;const n=await e.request({method:"eth_fillTransaction",params:[L]}),i=((null===w||void 0===w||null===(B=w.formatters)||void 0===B||null===(B=B.transaction)||void 0===B?void 0:B.format)||l.uP)(n.tx);delete i.blockHash,delete i.blockNumber,delete i.r,delete i.s,delete i.transactionIndex,delete i.v,delete i.yParity,i.data=i.input,i.gas&&(i.gas=null!==(D=t.gas)&&void 0!==D?D:i.gas),i.gasPrice&&(i.gasPrice=null!==(j=t.gasPrice)&&void 0!==j?j:i.gasPrice),i.maxFeePerBlobGas&&(i.maxFeePerBlobGas=null!==(F=t.maxFeePerBlobGas)&&void 0!==F?F:i.maxFeePerBlobGas),i.maxFeePerGas&&(i.maxFeePerGas=null!==(z=t.maxFeePerGas)&&void 0!==z?z:i.maxFeePerGas),i.maxPriorityFeePerGas&&(i.maxPriorityFeePerGas=null!==(W=t.maxPriorityFeePerGas)&&void 0!==W?W:i.maxPriorityFeePerGas),i.nonce&&(i.nonce=null!==(q=t.nonce)&&void 0!==q?q:i.nonce);const s=await(async(n,r,i)=>{if("function"===typeof(null===w||void 0===w||null===(n=w.fees)||void 0===n?void 0:n.baseFeeMultiplier)){const n=await(0,d.T)(e,p.g,"getBlock")({});return w.fees.baseFeeMultiplier({block:n,client:e,request:t})}return null!==(r=null===w||void 0===w||null===(i=w.fees)||void 0===i?void 0:i.baseFeeMultiplier)&&void 0!==r?r:1.2})();if(s<1)throw new o.sM;const a=10**(null!==(H=null===(V=s.toString().split(".")[1])||void 0===V?void 0:V.length)&&void 0!==H?H:0),c=e=>e*BigInt(Math.ceil(s*a))/BigInt(a);return i.maxFeePerGas&&!t.maxFeePerGas&&(i.maxFeePerGas=c(i.maxFeePerGas)),i.gasPrice&&!t.gasPrice&&(i.gasPrice=c(i.gasPrice)),{raw:n.raw,transaction:(0,r.A)({from:L.from},i)}}catch(G){throw(0,a.p)(G,(0,r.A)((0,r.A)({},t),{},{chain:e.chain}))}}},52610:(e,t,n)=>{"use strict";n.d(t,{DU:()=>Zt,AH:()=>Ht,i7:()=>Qt,I4:()=>Kt});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.create;function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var s=n(57722),o=n(96429),a=n.n(o),c="-ms-",l="-moz-",u="-webkit-",d="comm",h="rule",p="decl",f="@keyframes",g=Math.abs,m=String.fromCharCode,y=Object.assign;function v(e){return e.trim()}function w(e,t){return(e=t.exec(e))?e[0]:e}function b(e,t,n){return e.replace(t,n)}function A(e,t,n){return e.indexOf(t,n)}function _(e,t){return 0|e.charCodeAt(t)}function x(e,t,n){return e.slice(t,n)}function E(e){return e.length}function k(e){return e.length}function S(e,t){return t.push(e),e}function I(e,t){return e.filter(function(e){return!w(e,t)})}var T=1,C=1,P=0,O=0,N=0,R="";function M(e,t,n,r,i,s,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:s,line:T,column:C,length:o,return:"",siblings:a}}function U(e,t){return y(M("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function L(e){for(;e.root;)e=U(e.root,{children:[e]});S(e,e.siblings)}function B(){return N=O>0?_(R,--O):0,C--,10===N&&(C=1,T--),N}function D(){return N=O<P?_(R,O++):0,C++,10===N&&(C=1,T++),N}
vendor: 4,466 bytes, line 2
2function j(){return _(R,O)}function F(){return O}function z(e,t){return x(R,e,t)}function W(e){switch(e){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 q(e){return T=C=1,P=E(R=e),O=0,[]}function H(e){return R="",e}function V(e){return v(z(O-1,J(91===e?e+2:40===e?e+1:e)))}function G(e){for(;(N=j())&&N<33;)D();return W(e)>2||W(N)>3?"":" "}function K(e,t){for(;--t&&D()&&!(N<48||N>102||N>57&&N<65||N>70&&N<97););return z(e,F()+(t<6&&32==j()&&32==D()))}function J(e){for(;D();)switch(N){case e:return O;case 34:case 39:34!==e&&39!==e&&J(N);break;case 40:41===e&&J(e);break;case 92:D()}return O}function Z(e,t){for(;D()&&e+N!==57&&(e+N!==84||47!==j()););return"/*"+z(t,O-1)+"*"+m(47===e?e:D())}function Q(e){for(;!W(j());)D();return z(e,O)}function Y(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function X(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case p:return e.return=e.return||e.value;case d:return"";case f:return e.return=e.value+"{"+Y(e.children,r)+"}";case h:if(!E(e.value=e.props.join(",")))return""}return E(n=Y(e.children,r))?e.return=e.value+"{"+n+"}":""}function $(e,t,n){switch(function(e,t){return 45^_(e,0)?(((t<<2^_(e,0))<<2^_(e,1))<<2^_(e,2))<<2^_(e,3):0}(e,t)){case 5103:return u+"print-"+e+e;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 u+e+e;case 4789:return l+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return u+e+l+e+c+e+e;case 5936:switch(_(e,t+11)){case 114:return u+e+c+b(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return u+e+c+b(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return u+e+c+b(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return u+e+c+e+e;case 6165:return u+e+c+"flex-"+e+e;case 5187:return u+e+b(e,/(\w+).+(:[^]+)/,u+"box-$1$2"+c+"flex-$1$2")+e;case 5443:return u+e+c+"flex-item-"+b(e,/flex-|-self/g,"")+(w(e,/flex-|baseline/)?"":c+"grid-row-"+b(e,/flex-|-self/g,""))+e;case 4675:return u+e+c+"flex-line-pack"+b(e,/align-content|flex-|-self/g,"")+e;case 5548:return u+e+c+b(e,"shrink","negative")+e;case 5292:return u+e+c+b(e,"basis","preferred-size")+e;case 6060:return u+"box-"+b(e,"-grow","")+u+e+c+b(e,"grow","positive")+e;case 4554:return u+b(e,/([^-])(transform)/g,"$1"+u+"$2")+e;case 6187:return b(b(b(e,/(zoom-|grab)/,u+"$1"),/(image-set)/,u+"$1"),e,"")+e;case 5495:case 3959:return b(e,/(image-set\([^]*)/,u+"$1$`$1");case 4968:return b(b(e,/(.+:)(flex-)?(.*)/,u+"box-pack:$3"+c+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+u+e+e;case 4200:if(!w(e,/flex-|baseline/))return c+"grid-column-align"+x(e,t)+e;break;case 2592:case 3360:return c+b(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,w(e.props,/grid-\w+-end/)})?~A(e+(n=n[t].value),"span",0)?e:c+b(e,"-start","")+e+c+"grid-row-span:"+(~A(n,"span",0)?w(n,/\d+/):+w(n,/\d+/)-+w(e,/\d+/))+";":c+b(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return w(e.props,/grid-\w+-start/)})?e:c+b(b(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return b(e,/(.+)-inline(.+)/,u+"$1$2")+e;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(E(e)-1-t>6)switch(_(e,t+1)){case 109:if(45!==_(e,t+4))break;case 102:return b(e,/(.+:)(.+)-([^]+)/,"$1"+u+"$2-$3$1"+l+(108==_(e,t+3)?"$3":"$2-$3"))+e;case 115:return~A(e,"stretch",0)?$(b(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return b(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,i,s,o,a){return c+n+":"+r+a+(i?c+n+"-span:"+(s?o:+o-+r)+a:"")+e});case 4949:if(121===_(e,t+6))return b(e,":",":"+u)+e;break;case 6444:switch(_(e,45===_(e,14)?18:11)){case 120:return b(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+u+(45===_(e,14)?"inline-":"")+"box$3$1"+u+"$2$3$1"+c+"$2box$3")+e;case 100:return b(e,":",":"+c)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return b(e,"scroll-","scroll-snap-")+e}return e}function ee(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case p:return void(e.return=$(e.value,e.length,n));case f:return Y([U(e,{value:b(e.value,"@","@"+u)}
vendor: 10,947 bytes, line 2
2)],r);case h:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,function(t){switch(w(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":L(U(e,{props:[b(t,/:(read-\w+)/,":-moz-$1")]})),L(U(e,{props:[t]})),y(e,{props:I(n,r)});break;case"::placeholder":L(U(e,{props:[b(t,/:(plac\w+)/,":"+u+"input-$1")]})),L(U(e,{props:[b(t,/:(plac\w+)/,":-moz-$1")]})),L(U(e,{props:[b(t,/:(plac\w+)/,c+"input-$1")]})),L(U(e,{props:[t]})),y(e,{props:I(n,r)})}return""})}}function te(e){return H(ne("",null,null,null,[""],e=q(e),0,[0],e))}function ne(e,t,n,r,i,s,o,a,c){for(var l=0,u=0,d=o,h=0,p=0,f=0,y=1,v=1,w=1,x=0,k="",I=i,T=s,C=r,P=k;v;)switch(f=x,x=D()){case 40:if(108!=f&&58==_(P,d-1)){-1!=A(P+=b(V(x),"&","&\f"),"&\f",g(l?a[l-1]:0))&&(w=-1);break}case 34:case 39:case 91:P+=V(x);break;case 9:case 10:case 13:case 32:P+=G(f);break;case 92:P+=K(F()-1,7);continue;case 47:switch(j()){case 42:case 47:S(ie(Z(D(),F()),t,n,c),c);break;default:P+="/"}break;case 123*y:a[l++]=E(P)*w;case 125*y:case 59:case 0:switch(x){case 0:case 125:v=0;case 59+u:-1==w&&(P=b(P,/\f/g,"")),p>0&&E(P)-d&&S(p>32?se(P+";",r,n,d-1,c):se(b(P," ","")+";",r,n,d-2,c),c);break;case 59:P+=";";default:if(S(C=re(P,t,n,l,u,i,a,k,I=[],T=[],d,s),s),123===x)if(0===u)ne(P,t,C,C,I,s,d,a,T);else switch(99===h&&110===_(P,3)?100:h){case 100:case 108:case 109:case 115:ne(e,C,C,r&&S(re(e,C,C,0,0,i,a,k,i,I=[],d,T),T),i,T,d,a,r?I:T);break;default:ne(P,C,C,C,[""],T,0,a,T)}}l=u=p=0,y=w=1,k=P="",d=o;break;case 58:d=1+E(P),p=f;default:if(y<1)if(123==x)--y;else if(125==x&&0==y++&&125==B())continue;switch(P+=m(x),x*y){case 38:w=u>0?1:(P+="\f",-1);break;case 44:a[l++]=(E(P)-1)*w,w=1;break;case 64:45===j()&&(P+=V(D())),h=j(),u=d=E(k=P+=Q(F())),x++;break;case 45:45===f&&2==E(P)&&(y=0)}}return s}function re(e,t,n,r,i,s,o,a,c,l,u,d){for(var p=i-1,f=0===i?s:[""],m=k(f),y=0,w=0,A=0;y<r;++y)for(var _=0,E=x(e,p+1,p=g(w=o[y])),S=e;_<m;++_)(S=v(w>0?f[_]+" "+E:b(E,/&\f/g,f[_])))&&(c[A++]=S);return M(e,t,n,0===i?h:a,c,l,u,d)}function ie(e,t,n,r){return M(e,t,n,d,m(N),x(e,2,-2),0,r)}function se(e,t,n,r,i){return M(e,t,n,p,x(e,0,r),x(e,r+1,-1),r,i)}var oe={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},ae="undefined"!=typeof process&&void 0!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_ATTR||{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_ATTR)||"data-styled",ce="active",le="data-styled-version",ue="6.1.19",de="/*!sc*/\n",he="undefined"!=typeof window&&"undefined"!=typeof document,pe=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY?"false"!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}&&void 0!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&""!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&("false"!=={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SC_DISABLE_SPEEDY)),fe={},ge=(new Set,Object.freeze([])),me=Object.freeze({});function ye(e,t,n){return void 0===n&&(n=me),e.theme!==n.theme&&e.theme||t||n.theme}var ve=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"]),we=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,be=/(^-|-$)/g;function Ae(e){return e.replace(we,"-").replace(be,"")}var _e=/(a)(d)/gi,xe=52,Ee=function(e){return String.fromCharCode(e+(e>25?39:97))};function ke(e){var t,n="";for(t=Math.abs(e);t>xe;t=t/xe|0)n=Ee(t%xe)+n;return(Ee(t%xe)+n).replace(_e,"$1-$2")}var Se,Ie=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Te=function(e){return Ie(5381,e)};function Ce(e){return ke(Te(e)>>>0)}function Pe(e){return e.displayName||e.name||"Component"}function Oe(e){return"string"==typeof e&&!0}var Ne="function"==typeof Symbol&&Symbol.for,Re=Ne?Symbol.for("react.memo"):60115,Me=Ne?Symbol.for("react.forward_ref"):60112,Ue={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Le={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Be={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},De=((Se={})[Me]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Se[Re]=Be,Se);function je(e){return("type"in(t=e)&&t.type.$$typeof)===Re?Be:"$$typeof"in e?De[e.$$typeof]:Ue;var t}var Fe=Object.defineProperty,ze=Object.getOwnPropertyNames,We=Object.getOwnPropertySymbols,qe=Object.getOwnPropertyDescriptor,He=Object.getPrototypeOf,Ve=Object.prototype;function Ge(e,t,n){if("string"!=typeof t){if(Ve){var r=He(t);r&&r!==Ve&&Ge(e,r,n)}var i=ze(t);We&&(i=i.concat(We(t)));for(var s=je(e),o=je(t),a=0;a<i.length;++a){var c=i[a];if(!(c in Le||n&&n[c]||o&&c in o||s&&c in s)){var l=qe(t,c);try{Fe(e,c,l)}catch(e){}}}}return e}function Ke(e){return"function"==typeof e}function Je(e){return"object"==typeof e&&"styledComponentId"in e}function Ze(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function Qe(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}function Ye(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function Xe(e,t,n){if(void 0===n&&(n=!1),!n&&!Ye(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Xe(e[r],t[r]);else if(Ye(t))for(var r in t)e[r]=Xe(e[r],t[r]);return e}function $e(e,t){Object.defineProperty(e,"toString",{value:t})}function et(e){for(var t=[],n=1;n<arguments.length;n++)t[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(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var tt=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)if((i<<=1)<0)throw et(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var s=r;s<i;s++)this.groupSizes[s]=0}for(var o=this.indexOfGroup(e+1),a=(s=0,t.length);s<a;s++)this.tag.insertRule(o,t[s])&&(this.groupSizes[e]++,o++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var i=n;i<r;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,s=r;s<i;s++)t+="".concat(this.tag.getRule(s)).concat(de);return t},e}(),nt=new Map,rt=new Map,it=1,st=function(e){if(nt.has(e))return nt.get(e);for(;rt.has(it);)it++;var t=it++;return nt.set(e,t),rt.set(t,e),t},ot=function(e,t){it=t+1,nt.set(e,t),rt.set(t,e)},at="style[".concat(ae,"][").concat(le,'="').concat(ue,'"]'),ct=new RegExp("^".concat(ae,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),lt=function(e,t,n){for(var r,i=n.split(","),s=0,o=i.length;s<o;s++)(r=i[s])&&e.registerName(t,r)},ut=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(de),i=[],s=0,o=r.length;s<o;s++){var a=r[s].trim();if(a){var c=a.match(ct);if(c){var l=0|parseInt(c[1],10),u=c[2];0!==l&&(ot(u,l),lt(e,u,c[3]),e.getTag().insertRules(l,i)),i.length=0}else i.push(a)}}},dt=function(e){for(var t=document.querySelectorAll(at),n=0,r=t.length;n<r;n++){var i=t[n];i&&i.getAttribute(ae)!==ce&&(ut(e,i),i.parentNode&&i.parentNode.removeChild(i))}};function ht(){return n.nc}var pt=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(ae,"]")));return t[t.length-1]}(n),s=void 0!==i?i.nextSibling:null;r.setAttribute(ae,ce),r.setAttribute(le,ue);var o=ht();
vendor: 4,650 bytes, line 2
2return o&&r.setAttribute("nonce",o),n.insertBefore(r,s),r},ft=function(){function e(e){this.element=pt(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var i=t[n];if(i.ownerNode===e)return i}throw et(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),gt=function(){function e(e){this.element=pt(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),mt=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),yt=he,vt={isServer:!he,useCSSOMInjection:!pe},wt=function(){function e(e,t,n){void 0===e&&(e=me),void 0===t&&(t={});var i=this;this.options=r(r({},vt),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&he&&yt&&(yt=!1,dt(this)),$e(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",i=function(n){var i=function(e){return rt.get(e)}(n);if(void 0===i)return"continue";var s=e.names.get(i),o=t.getGroup(n);if(void 0===s||!s.size||0===o.length)return"continue";var a="".concat(ae,".g").concat(n,'[id="').concat(i,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(o).concat(a,'{content:"').concat(c,'"}').concat(de)},s=0;s<n;s++)i(s);return r}(i)})}return e.registerId=function(e){return st(e)},e.prototype.rehydrate=function(){!this.server&&he&&dt(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(r(r({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new mt(n):t?new ft(n):new gt(n)}(this.options),new tt(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(st(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(st(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(st(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),bt=/&/g,At=/^\s*\/\/.*$/gm;function _t(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=_t(e.children,t)),e})}function xt(e){var t,n,r,i=void 0===e?me:e,s=i.options,o=void 0===s?me:s,a=i.plugins,c=void 0===a?ge:a,l=function(e,r,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(t):e},u=c.slice();u.push(function(e){e.type===h&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(bt,n).replace(r,l))}),o.prefix&&u.push(ee),u.push(X);var d=function(e,i,s,a){void 0===i&&(i=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=i,r=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(At,""),l=te(s||i?"".concat(s," ").concat(i," { ").concat(c," }"):c);o.namespace&&(l=_t(l,o.namespace));var d,h=[];return Y(l,function(e){var t=k(e);return function(n,r,i,s){for(var o="",a=0;a<t;a++)o+=e[a](n,r,i,s)||"";return o}}(u.concat((d=function(e){return h.push(e)},function(e){e.root||(e=e.return)&&d(e)})))),h};return d.hash=c.length?c.reduce(function(e,t){return t.name||et(15),Ie(e,t.name)},5381).toString():"",d}var Et=new wt,kt=xt(),St=s.createContext({shouldForwardProp:void 0,styleSheet:Et,stylis:kt}),It=(St.Consumer,s.createContext(void 0));function Tt(){return(0,s.useContext)(St)}
vendor: 3,882 bytes, line 2
2function Ct(e){var t=(0,s.useState)(e.stylisPlugins),n=t[0],r=t[1],i=Tt().styleSheet,o=(0,s.useMemo)(function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.sheet,e.target,i]),c=(0,s.useMemo)(function(){return xt({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})},[e.enableVendorPrefixes,e.namespace,n]);(0,s.useEffect)(function(){a()(n,e.stylisPlugins)||r(e.stylisPlugins)},[e.stylisPlugins]);var l=(0,s.useMemo)(function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:o,stylis:c}},[e.shouldForwardProp,o,c]);return s.createElement(St.Provider,{value:l},s.createElement(It.Provider,{value:c},e.children))}var Pt=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=kt);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,$e(this,function(){throw et(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=kt),this.name+e.hash},e}(),Ot=function(e){return e>="A"&&e<="Z"};function Nt(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Ot(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Rt=function(e){return null==e||!1===e||""===e},Mt=function(e){var t,n,r=[];for(var s in e){var o=e[s];e.hasOwnProperty(s)&&!Rt(o)&&(Array.isArray(o)&&o.isCss||Ke(o)?r.push("".concat(Nt(s),":"),o,";"):Ye(o)?r.push.apply(r,i(i(["".concat(s," {")],Mt(o),!1),["}"],!1)):r.push("".concat(Nt(s),": ").concat((t=s,null==(n=o)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in oe||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Ut(e,t,n,r){return Rt(e)?[]:Je(e)?[".".concat(e.styledComponentId)]:Ke(e)?!Ke(i=e)||i.prototype&&i.prototype.isReactComponent||!t?[e]:Ut(e(t),t,n,r):e instanceof Pt?n?(e.inject(n,r),[e.getName(r)]):[e]:Ye(e)?Mt(e):Array.isArray(e)?Array.prototype.concat.apply(ge,e.map(function(e){return Ut(e,t,n,r)})):[e.toString()];var i}function Lt(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Ke(n)&&!Je(n))return!1}return!0}var Bt=Te(ue),Dt=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Lt(e),this.componentId=t,this.baseHash=Ie(Bt,t),this.baseStyle=n,wt.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=Ze(r,this.staticRulesId);else{var i=Qe(Ut(this.rules,e,t,n)),s=ke(Ie(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,s)){var o=n(i,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,o)}r=Ze(r,s),this.staticRulesId=s}else{for(var a=Ie(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u;else if(u){var d=Qe(Ut(u,e,t,n));a=Ie(a,d+l),c+=d}}if(c){var h=ke(a>>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(c,".".concat(h),void 0,this.componentId)),r=Ze(r,h)}}return r},e}(),jt=s.createContext(void 0);jt.Consumer;var Ft={};new Set;function zt(e,t,n){var i=Je(e),o=e,a=!Oe(e),c=t.attrs,l=void 0===c?ge:c,u=t.componentId,d=void 0===u?function(e,t){var n="string"!=typeof e?"sc":Ae(e);Ft[n]=(Ft[n]||0)+1;var r="".concat(n,"-").concat(Ce(ue+n+Ft[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):u,h=t.displayName,p=void 0===h?function(e){return Oe(e)?"styled.".concat(e):"Styled(".concat(Pe(e),")")}(e):h,f=t.displayName&&t.componentId?"".concat(Ae(t.displayName),"-").concat(t.componentId):t.componentId||d,g=i&&o.attrs?o.attrs.concat(l).filter(
vendor: 4,096 bytes, line 2
2Boolean):l,m=t.shouldForwardProp;if(i&&o.shouldForwardProp){var y=o.shouldForwardProp;if(t.shouldForwardProp){var v=t.shouldForwardProp;m=function(e,t){return y(e,t)&&v(e,t)}}else m=y}var w=new Dt(n,f,i?o.componentStyle:void 0);function b(e,t){return function(e,t,n){var i=e.attrs,o=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,l=e.styledComponentId,u=e.target,d=s.useContext(jt),h=Tt(),p=e.shouldForwardProp||h.shouldForwardProp,f=ye(t,d,a)||me,g=function(e,t,n){for(var i,s=r(r({},t),{className:void 0,theme:n}),o=0;o<e.length;o+=1){var a=Ke(i=e[o])?i(s):i;for(var c in a)s[c]="className"===c?Ze(s[c],a[c]):"style"===c?r(r({},s[c]),a[c]):a[c]}return t.className&&(s.className=Ze(s.className,t.className)),s}(i,t,f),m=g.as||u,y={};for(var v in g)void 0===g[v]||"$"===v[0]||"as"===v||"theme"===v&&g.theme===f||("forwardedAs"===v?y.as=g.forwardedAs:p&&!p(v,m)||(y[v]=g[v]));var w=function(e,t){var n=Tt();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(o,g),b=Ze(c,l);return w&&(b+=" "+w),g.className&&(b+=" "+g.className),y[Oe(m)&&!ve.has(m)?"class":"className"]=b,n&&(y.ref=n),(0,s.createElement)(m,y)}(A,e,t)}b.displayName=p;var A=s.forwardRef(b);return A.attrs=g,A.componentStyle=w,A.displayName=p,A.shouldForwardProp=m,A.foldedComponentIds=i?Ze(o.foldedComponentIds,o.styledComponentId):"",A.styledComponentId=f,A.target=i?o.target:e,Object.defineProperty(A,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++)Xe(e,i[r],!0);return e}({},o.defaultProps,e):e}}),$e(A,function(){return".".concat(A.styledComponentId)}),a&&Ge(A,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),A}function Wt(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var qt=function(e){return Object.assign(e,{isCss:!0})};function Ht(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Ke(e)||Ye(e))return qt(Ut(Wt(ge,i([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Ut(r):qt(Ut(Wt(r,t)))}function Vt(e,t,n){if(void 0===n&&(n=me),!t)throw et(1,t);var s=function(r){for(var s=[],o=1;o<arguments.length;o++)s[o-1]=arguments[o];return e(t,n,Ht.apply(void 0,i([r],s,!1)))};return s.attrs=function(i){return Vt(e,t,r(r({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},s.withConfig=function(i){return Vt(e,t,r(r({},n),i))},s}var Gt=function(e){return Vt(zt,e)},Kt=Gt;ve.forEach(function(e){Kt[e]=Gt(e)});var Jt=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Lt(e),wt.registerId(this.componentId+1)}return e.prototype.createStyles=function(e,t,n,r){var i=r(Qe(Ut(this.rules,t,n,r)),""),s=this.componentId+e;n.insertRules(s,s,i)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,r){e>2&&wt.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function Zt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=Ht.apply(void 0,i([e],t,!1)),a="sc-global-".concat(Ce(JSON.stringify(o))),c=new Jt(o,a),l=function(e){var t=Tt(),n=s.useContext(jt),r=s.useRef(t.styleSheet.allocateGSInstance(a)).current;return t.styleSheet.server&&u(r,e,t.styleSheet,n,t.stylis),s.useLayoutEffect(function(){if(!t.styleSheet.server)return u(r,e,t.styleSheet,n,t.stylis),function(){return c.removeStyles(r,t.styleSheet)}},[r,e,t.styleSheet,n,t.stylis]),null};function u(e,t,n,i,s){if(c.isStatic)c.renderStyles(e,fe,n,s);else{var o=r(r({},t),{theme:ye(t,i,l.defaultProps)});c.renderStyles(e,o,n,s)}}return s.memo(l)}function Qt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Qe(Ht.apply(void 0,i([e],t,!1))),s=Ce(r);return new Pt(s,r)}(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=ht(),r=Qe([n&&'nonce="'.concat(n,'"'),"".concat(ae,'="true"'),"".concat(le,'="').concat(ue,'"')].filter(
2Boolean)," ");return"<style ".concat(r,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw et(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw et(2);var n=e.instance.toString();if(!n)return[];var i=((t={})[ae]="",t[le]=ue,t.dangerouslySetInnerHTML={__html:n},t),o=ht();return o&&(i.nonce=o),[s.createElement("style",r({},i,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new wt({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw et(2);return s.createElement(Ct,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw et(3)}})(),"__sc-".concat(ae,"__")},52763:(e,t,n)=>{"use strict";n.d(t,{EH:()=>s,YE:()=>a,jF:()=>o,qD:()=>c,rj:()=>i});var r=n(51659);class i extends r.C{constructor(e){let{blockNumber:t,chain:n,contract:r}=e;super('Chain "'.concat(n.name,'" does not support contract "').concat(r.name,'".'),{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?['- The contract "'.concat(r.name,'" was not deployed until block ').concat(r.blockCreated," (current block ").concat(t,").")]:['- The chain does not have the contract "'.concat(r.name,'" configured.')]],name:"ChainDoesNotSupportContract"})}}class s extends r.C{constructor(e){let{chain:t,currentChainId:n}=e;super("The current chain of the wallet (id: ".concat(n,") does not match the target chain for the transaction (id: ").concat(t.id," \u2013 ").concat(t.name,")."),{metaMessages:["Current Chain ID: ".concat(n),"Expected Chain ID: ".concat(t.id," \u2013 ").concat(t.name)],name:"ChainMismatchError"})}}class o extends r.C{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join("\n"),{name:"ChainNotFoundError"})}}class a extends r.C{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class c extends r.C{constructor(e){let{chainId:t}=e;super("number"===typeof t?'Chain ID "'.concat(t,'" is invalid.'):"Chain ID is invali
2d.",{name:"InvalidChainIdError"})}}},52830:(e,t,n)=>{"use strict";n.d(t,{S:()=>s,a:()=>o});var r=n(57722);let i=(0,r.createContext)(!1);function s(){return(0,r.useContext)(i)}function o(e){return r.createElement(i.Provider,{value:e.force},e.children)}},52897:(e,t,n)=>{"use strict";n.d(t,{K:()=>p});var r=n(57722);var i=n(73660),s=n(42922);function o(){let e;return{before(t){let{doc:n}=t;var r;let i=n.documentElement,s=null!=(r=n.defaultView)?r:window;e=Math.max(0,s.innerWidth-i.clientWidth)},after(t){let{doc:n,d:r}=t,i=n.documentElement,s=Math.max(0,i.clientWidth-i.offsetWidth),o=Math.max(0,e-s);r.style(i,"paddingRight","".concat(o,"px"))}}}var a=n(56973),c=n(54966);function l(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let u=function(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];let a=t[e].call(n,...s);a&&(n=a,r.forEach(e=>e()))}}}(()=>new Map,{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:(0,s.e)(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=l(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=l(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta:()=>e.computedMeta},n=[(0,c.un)()?{before(e){let{doc:t,d:n,meta:r}=e;function i(e){for(let t of r().containers)for(let n of t())if(n.contains(e))return!0;return!1}n.microTask(()=>{var e;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let e=(0,s.e)();e.style(t.documentElement,"scrollBehavior","auto"),n.add(()=>n.microTask(()=>e.dispose()))}let r=null!=(e=window.scrollY)?e:window.pageYOffset,o=null;n.addEventListener(t,"click",e=>{if(a.Lk(e.target))try{let n=e.target.closest("a");if(!n)return;let{hash:r}=new URL(n.href),s=t.querySelector(r);a.Lk(s)&&!i(s)&&(o=s)}catch(n){}},!0),n.group(e=>{n.addEventListener(t,"touchstart",t=>{if(e.dispose(),a.Lk(t.target)&&a.pv(t.target))if(i(t.target)){let n=t.target;for(;n.parentElement&&i(n.parentElement);)n=n.parentElement;e.style(n,"overscrollBehavior","contain")}else e.style(t.target,"touchAction","none")})}),n.addEventListener(t,"touchmove",e=>{if(a.Lk(e.target)){if(a.A3(e.target))return;if(i(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),n.add(()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;r!==t&&window.scrollTo(0,r),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{},o(),{before(e){let{doc:t,d:n}=e;n.style(t.documentElement,"overflow","hidden")}}];n.forEach(e=>{let{before:n}=e;return null==n?void 0:n(t)}),n.forEach(e=>{let{after:n}=e;return null==n?void 0:n(t)})},SCROLL_ALLOW(e){let{d:t}=e;t.dispose()},TEARDOWN(e){let{doc:t}=e;this.delete(t)}});function d(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>({containers:[]}),s=function(e){return(0,r.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}(u),o=t?s.get(t):void 0,a=!!o&&o.count>0;return(0,i.s)(()=>{if(t&&e)return u.dispatch("PUSH",t,n),()=>u.dispatch("POP",t,n)},[e,t]),a}u.subscribe(()=>{let e=u.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&u.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&u.dispatch("TEARDOWN",n)}});var h=n(43470);function p(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[document.body];d((0,h.S)(e,"scroll-lock"),t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}})}},54088:(e,t,n)=>{"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.from(new Set(t.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}n.d(t,{x:()=>r})},54113:(e,t)=>{"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},54798:e=>{"use strict";e.exports=function e(t){if("number"===typeof t&&isNaN(t))throw new Error("NaN is not allowed");if("number"===typeof t&&!isFinite(t))throw new Error("Infinity is not allowed");if(null===t||"object"!==typeof t)return JSON.stringify(t);if(t.toJSON instanceof Function)return e(t.toJSON());if(Array.isArray(t)){const n=t.reduce((t,n,r)=>{const i=0===r?"":",",s=void 0===n||"symbol"===typeof n?null:n;return"".concat(t).concat(i).concat(e(s))},"");return"[".concat(n,"]")}const n=Object.keys(t).sort().reduce((n,r)=>{if(void 0===t[r]||"symbol"===typeof t[r])return n;const i=0===n.length?"":",";return"".concat(n).concat(i).concat(e(r),":").concat(e(t[r]))},"");return"{".concat(n,"}")}},54966:(e,t,n)=>{"use strict";function r(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function i(){return r()||/Android/gi.test(window.navigator.userAgent)}n.d(t,{Fr:()=>i,un:()=>r})},54989:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},55128:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});const r=256;let i,s=r;function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:11;if(!i||s+e>2*r){i="",s=0;for(let e=0;e<r;e++)i+=(256+256*Math.random()|0).toString(16).substring(1)}return i.substring(s,s+++e)}},55788:function(e){e.exports=function(){"use strict";function e(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function n(t,n){return t.get(e(t,n))}function r(e,n,r){t(e,n),n.set(e,r)}function i(t,n,r){return t.set(e(t,n),r),r}const s=100,o={},a=()=>{o.previousActiveElement instanceof HTMLElement?(o.previousActiveElement.focus(),o.previousActiveElement=null):document.body&&document.body.focus()},c=e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,r=window.scrollY;o.restoreFocusTimeout=setTimeout(()=>{a(),t()},s),window.scrollTo(n,r)}),l="swal2-",u=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"].reduce((e,t)=>
2(e[t]=l+t,e),{}),d=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=l+t,e),{}),h="SweetAlert2:",p=e=>e.charAt(0).toUpperCase()+e.slice(1),f=e=>{console.warn("".concat(h," ").concat("object"===typeof e?e.join(" "):e))},g=e=>{console.error("".concat(h," ").concat(e))},m=[],y=e=>{m.includes(e)||(m.push(e),f(e))},v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;y('"'.concat(e,'" is deprecated and will be removed in the next major release.').concat(t?' Use "'.concat(t,'" instead.'):""))},w=e=>"function"===typeof e?e():e,b=e=>e&&"function"===typeof e.toPromise,A=e=>b(e)?e.toPromise():Promise.resolve(e),_=e=>e&&Promise.resolve(e)===e,x=()=>document.body.querySelector(".".concat(u.container)),E=e=>{const t=x();return t?t.querySelector(e):null},k=e=>E(".".concat(e)),S=()=>k(u.popup),I=()=>k(u.icon),T=()=>k(u["icon-content"]),C=()=>k(u.title),P=()=>k(u["html-container"]),O=()=>k(u.image),N=()=>k(u["progress-steps"]),R=()=>k(u["validation-message"]),M=()=>E(".".concat(u.actions," .").concat(u.confirm)),U=()=>E(".".concat(u.actions," .").concat(u.cancel)),L=()=>E(".".concat(u.actions," .").concat(u.deny)),B=()=>k(u["input-label"]),D=()=>E(".".concat(u.loader)),j=()=>k(u.actions),F=()=>k(u.footer),z=()=>k(u["timer-progress-bar"]),W=()=>k(u.close),q='\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n',H=()=>{const e=S();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),r=parseInt(t.getAttribute("tabindex")||"0");return n>r?1:n<r?-1:0}),r=e.querySelectorAll(q),i=Array.from(r).filter(e=>"-1"!==e.getAttribute("tabindex"));return[...new Set(n.concat(i))].filter(e=>ue(e))},V=()=>Z(document.body,u.shown)&&!Z(document.body,u["toast-shown"])&&!Z(document.body,u["no-backdrop"]),G=()=>{const e=S();return!!e&&Z(e,u.toast)},K=()=>{const e=S();return!!e&&e.hasAttribute("data-loading")},J=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),r=n.querySelector("head");r&&Array.from(r.childNodes).forEach(t=>{e.appendChild(t)});const i=n.querySelector("body");i&&Array.from(i.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},Z=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let r=0;r<n.length;r++)if(!e.classList.contains(n[r]))return!1;return!0},Q=(e,t)=>{Array.from(e.classList).forEach(n=>{Object.values(u).includes(n)||Object.values(d).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)})}
2,Y=(e,t,n)=>{if(Q(e,t),!t.customClass)return;const r=t.customClass[n];r&&("string"===typeof r||r.forEach?te(e,r):f("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof r,'"')))},X=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(u.popup," > .").concat(u[t]));case"checkbox":return e.querySelector(".".concat(u.popup," > .").concat(u.checkbox," input"));case"radio":return e.querySelector(".".concat(u.popup," > .").concat(u.radio," input:checked"))||e.querySelector(".".concat(u.popup," > .").concat(u.radio," input:first-child"));case"range":return e.querySelector(".".concat(u.popup," > .").concat(u.range," input"));default:return e.querySelector(".".concat(u.popup," > .").concat(u.input))}},$=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},ee=(e,t,n)=>{e&&t&&("string"===typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(t=>{Array.isArray(e)?e.forEach(e=>{n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)}))},te=(e,t)=>{ee(e,t,!0)},ne=(e,t)=>{ee(e,t,!1)},re=(e,t)=>{const n=Array.from(e.children);for(let r=0;r<n.length;r++){const e=n[r];if(e instanceof HTMLElement&&Z(e,t))return e}},ie=(e,t,n)=>{n==="".concat(parseInt("".concat(n)))&&(n=parseInt(n)),n||0===parseInt("".concat(n))?e.style.setProperty(t,"number"===typeof n?"".concat(n,"px"):n):e.style.removeProperty(t)},se=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},oe=e=>{e&&(e.style.display="none")},ae=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver(()=>{le(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},ce=(e,t,n,r)=>{const i=e.querySelector(t);i&&i.style.setProperty(n,r)},le=function(e,t){t?se(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):oe(e)},ue=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),de=()=>!ue(M())&&!ue(L())&&!ue(U()),he=e=>!!(e.scrollHeight>e.clientHeight),pe=(e,t)=>{let n=e;for(;n&&n!==t;){if(he(n))return!0;n=n.parentElement}return!1},fe=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),r=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||r>0},ge=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=z();n&&ue(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))},me=()=>{const e=z();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width="".concat(n,"%")},ye=()=>"undefined"===typeof window||"undefined"===typeof document,ve='\n <div aria-labelledby="'.concat(u.title,'" aria-describedby="').concat(u["html-container"],'" class="').concat(u.popup,'" tabindex="-1">\n <button type="button" class="').concat(u.close,'"></button>\n <ul class="').concat(u["progress-steps"],'"></ul>\n <div class="').concat(u.icon,'"></div>\n <img class="').concat(u.image,'" />\n <h2 class="').concat(u.title,'" id="').concat(u.title,'"></h2>\n <div class="').concat(u["html-container"],'" id="').concat(u["html-container"],'"></div>\n <input class="').concat(u.input,'" id="').concat(u.input,'" />\n <input type="file" class="').concat(u.file,'" />\n <div class="').concat(u.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(u.select,'" id="').concat(u.select,'"></select>\n <div class="').concat(u.radio,'"></div>\n <label class="').concat(u.checkbox,'">\n <input type="checkbox" id="').concat(u.checkbox,'" />\n <span class="').concat(u.label,'"></span>\n </label>\n <textarea class="').concat(u.textarea,'" id="').concat(u.textarea,'"></textarea>\n <div class="').concat(u["validation-message"],'" id="').concat(u["validation-message"],'"></div>\n <div class="').concat(u.actions,'">\n <div class="').concat(u.loader,'"></div>\n <button type="button" class="').concat(u.confirm,'"></button>\n <button type="button" class="').concat(u.deny,'"></button>\n <button type="button" class="').concat(u.cancel,'"></button>\n </div>\n <div class="').concat(u.footer,'"></div>\n <div class="').concat(u["timer-progress-bar-container"],'">\n <div class="').concat(u["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),we=()=>{const e=x();return!!e&&(e.remove(),ne([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0)},be=()=>{o.currentInstance.resetValidationMessage()},Ae=()=>{const e=S(),t=re(e,u.input),n=re(e,u.file),r=e.querySelector(".".concat(u.range," input")),i=e.querySelector(".".concat(u.range," output")),s=re(e,u.select),o=e.querySelector(".".concat(u.checkbox," input")),a=re(e,u.textarea);t.oninput=be,n.onchange=be,s.onchange=be,o.onchange=be,a.oninput=be,r.oninput=()=>{be(),i.value=r.value},r.onchange=()=>{be(),i.value=r.value}},_e=e=>"string"===typeof e?document.querySelector(e):e,xe=e=>{const t=S();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},Ee=e=>{"rtl"===window.getComputedStyle(e).direction&&te(x(),u.rtl)},ke=e=>{const t=we();if(ye())return void g("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=u.container,t&&te(n,u["no-transition"]),J(n,ve),n.dataset.swal2Theme=e.theme;const r=_e(e.target);r.appendChild(n),e.topLayer&&(n.setAttribute("popover",""),n.showPopover()),xe(e),Ee(r),Ae()},Se=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"===typeof e?Ie(e,t):e&&J(t,e)},Ie=(e,t)=>{e.jquery?Te(t,e):J(t,e.toString())},Te=(e,t)=>
2{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Ce=(e,t)=>{const n=j(),r=D();n&&r&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?se(n):oe(n),Y(n,t,"actions"),Pe(n,r,t),J(r,t.loaderHtml||""),Y(r,t,"loader"))};function Pe(e,t,n){const r=M(),i=L(),s=U();r&&i&&s&&(Re(r,"confirm",n),Re(i,"deny",n),Re(s,"cancel",n),Oe(r,i,s,n),n.reverseButtons&&(n.toast?(e.insertBefore(s,r),e.insertBefore(i,r)):(e.insertBefore(s,t),e.insertBefore(i,t),e.insertBefore(r,t))))}function Oe(e,t,n,r){r.buttonsStyling?(te([e,t,n],u.styled),r.confirmButtonColor&&e.style.setProperty("--swal2-confirm-button-background-color",r.confirmButtonColor),r.denyButtonColor&&t.style.setProperty("--swal2-deny-button-background-color",r.denyButtonColor),r.cancelButtonColor&&n.style.setProperty("--swal2-cancel-button-background-color",r.cancelButtonColor),Ne(e),Ne(t),Ne(n)):ne([e,t,n],u.styled)}function Ne(e){const t=window.getComputedStyle(e);if(t.getPropertyValue("--swal2-action-button-focus-box-shadow"))return;const n=t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,"rgba($1, $2, $3, 0.5)");e.style.setProperty("--swal2-action-button-focus-box-shadow",t.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/," ".concat(n)))}function Re(e,t,n){const r=p(t);le(e,n["show".concat(r,"Button")],"inline-block"),J(e,n["".concat(t,"ButtonText")]||""),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]||""),e.className=u[t],Y(e,n,"".concat(t,"Button"))}const Me=(e,t)=>{const n=W();n&&(J(n,t.closeButtonHtml||""),Y(n,t,"closeButton"),le(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))},Ue=(e,t)=>{const n=x();n&&(Le(n,t.backdrop),Be(n,t.position),De(n,t.grow),Y(n,t,"container"))};function Le(e,t){"string"===typeof t?e.style.background=t:t||te([document.documentElement,document.body],u["no-backdrop"])}function Be(e,t){t&&(t in u?te(e,u[t]):(f('The "position" parameter is not valid, defaulting to "center"'),te(e,u.center)))}function De(e,t){t&&te(e,u["grow-".concat(t)])}var je={innerParams:new WeakMap,domCache:new WeakMap};const Fe=["input","file","range","select","radio","checkbox","textarea"],ze=(e,t)=>{const n=S();if(!n)return;const r=je.innerParams.get(e),i=!r||t.input!==r.input;Fe.forEach(e=>{const r=re(n,u[e]);r&&(He(e,t.inputAttributes),r.className=u[e],i&&oe(r))}),t.input&&(i&&We(t),Ve(t))},We=e=>{if(!e.input)return;if(!Qe[e.input])return void g("Unexpected type of input! Expected ".concat(Object.keys(Qe).join(" | "),', got "').concat(e.input,'"'));const t=Je(e.input);if(!t)return;const n=Qe[e.input](t,e);se(t),e.inputAutoFocus&&setTimeout(()=>{$(n)})},qe=e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["id","type","value","style"].includes(n)||e.removeAttribute(n)}},He=(e,t)=>{const n=S();if(!n)return;const r=X(n,e);if(r){qe(r);for(const e in t)r.setAttribute(e,t[e])}},Ve=e=>{if(!e.input)return;const t=Je(e.input);t&&Y(t,e,"input")},Ge=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},Ke=(e,t,n)=>{if(n.inputLabel){const r=document.createElement("label"),i=u["input-label"];r.setAttribute("for",e.id),r.className=i,"object"===typeof n.customClass&&te(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",r)}},Je=e=>{const t=S();if(t)return re(t,u[e]||u.input)},Ze=(e,t)=>{["string","number"].includes(typeof t)?e.value="".concat(t):_(t)||f('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t,'"'))},Qe={};Qe.text=Qe.email=Qe.password=Qe.number=Qe.tel=Qe.url=Qe.search=Qe.date=Qe["datetime-local"]=Qe.time=Qe.week=Qe.month=(e,t)=>(Ze(e,t.inputValue),Ke(e,e,t),Ge(e,t),e.type=t.input,e),Qe.file=(e,t)=>(Ke(e,e,t),Ge(e,t),e),Qe.range=(e,t)=>{const n=e.querySelector("input"),r=e.querySelector("output");return Ze(n,t.inputValue),n.type=t.input,Ze(r,t.inputValue),Ke(n,e,t),e},Qe.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");J(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.a
2ppendChild(n)}return Ke(e,e,t),e},Qe.radio=e=>(e.textContent="",e),Qe.checkbox=(e,t)=>{const n=X(S(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const r=e.querySelector("span");return J(r,t.inputPlaceholder||t.inputLabel),n},Qe.textarea=(e,t)=>{Ze(e,t.inputValue),Ge(e,t),Ke(e,e,t);const n=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const r=parseInt(window.getComputedStyle(S()).width);new MutationObserver(()=>{if(!document.body.contains(e))return;const i=e.offsetWidth+n(e);i>r?S().style.width="".concat(i,"px"):ie(S(),"width",t.width)}).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const Ye=(e,t)=>{const n=P();n&&(ae(n),Y(n,t,"htmlContainer"),t.html?(Se(t.html,n),se(n,"block")):t.text?(n.textContent=t.text,se(n,"block")):oe(n),ze(e,t))},Xe=(e,t)=>{const n=F();n&&(ae(n),le(n,Boolean(t.footer),"block"),t.footer&&Se(t.footer,n),Y(n,t,"footer"))},$e=(e,t)=>{const n=je.innerParams.get(e),r=I();if(r){if(n&&t.icon===n.icon)return it(r,t),void et(r,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(d).indexOf(t.icon))return g('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),void oe(r);se(r),it(r,t),et(r,t),te(r,t.showClass&&t.showClass.icon),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",tt)}else oe(r)}},et=(e,t)=>{for(const[n,r]of Object.entries(d))t.icon!==n&&ne(e,r);te(e,t.icon&&d[t.icon]),st(e,t),tt(),Y(e,t,"icon")},tt=()=>{const e=S();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let r=0;r<n.length;r++)n[r].style.backgroundColor=t},nt=e=>"\n ".concat(e.animation?'<div class="swal2-success-circular-line-left"></div>':"",'\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div>\n ').concat(e.animation?'<div class="swal2-success-fix"></div>':"","\n ").concat(e.animation?'<div class="swal2-success-circular-line-right"></div>':"","\n"),rt='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n',it=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,r="";t.iconHtml?r=ot(t.iconHtml):"success"===t.icon?(r=nt(t),n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?r=rt:t.icon&&(r=ot({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==r.trim()&&J(e,r)},st=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])ce(e,n,"background-color",t.iconColor);ce(e,".swal2-success-ring","border-color",t.iconColor)}},ot=e=>'<div class="'.concat(u["icon-content"],'">').concat(e,"</div>"),at=(e,t)=>
2{const n=O();n&&(t.imageUrl?(se(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),ie(n,"width",t.imageWidth),ie(n,"height",t.imageHeight),n.className=u.image,Y(n,t,"image")):oe(n))};let ct=!1,lt=0,ut=0,dt=0,ht=0;const pt=e=>{e.addEventListener("mousedown",gt),document.body.addEventListener("mousemove",mt),e.addEventListener("mouseup",yt),e.addEventListener("touchstart",gt),document.body.addEventListener("touchmove",mt),e.addEventListener("touchend",yt)},ft=e=>{e.removeEventListener("mousedown",gt),document.body.removeEventListener("mousemove",mt),e.removeEventListener("mouseup",yt),e.removeEventListener("touchstart",gt),document.body.removeEventListener("touchmove",mt),e.removeEventListener("touchend",yt)},gt=e=>{const t=S();if(e.target===t||I().contains(e.target)){ct=!0;const n=vt(e);lt=n.clientX,ut=n.clientY,dt=parseInt(t.style.insetInlineStart)||0,ht=parseInt(t.style.insetBlockStart)||0,te(t,"swal2-dragging")}},mt=e=>{const t=S();if(ct){let{clientX:n,clientY:r}=vt(e);t.style.insetInlineStart="".concat(dt+(n-lt),"px"),t.style.insetBlockStart="".concat(ht+(r-ut),"px")}},yt=()=>{const e=S();ct=!1,ne(e,"swal2-dragging")},vt=e=>{let t=0,n=0;return e.type.startsWith("mouse")?(t=e.clientX,n=e.clientY):e.type.startsWith("touch")&&(t=e.touches[0].clientX,n=e.touches[0].clientY),{clientX:t,clientY:n}},wt=(e,t)=>{const n=x(),r=S();if(n&&r){if(t.toast){ie(n,"width",t.width),r.style.width="100%";const e=D();e&&r.insertBefore(e,I())}else ie(r,"width",t.width);ie(r,"padding",t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),oe(R()),bt(r,t),t.draggable&&!t.toast?(te(r,u.draggable),pt(r)):(ne(r,u.draggable),ft(r))}},bt=(e,t)=>{const n=t.showClass||{};e.className="".concat(u.popup," ").concat(ue(e)?n.popup:""),t.toast?(te([document.documentElement,document.body],u["toast-shown"]),te(e,u.toast)):te(e,u.modal),Y(e,t,"popup"),"string"===typeof t.customClass&&te(e,t.customClass),t.icon&&te(e,u["icon-".concat(t.icon)])},At=(e,t)=>{const n=N();if(!n)return;const{progressSteps:r,currentProgressStep:i}=t;r&&0!==r.length&&void 0!==i?(se(n),n.textContent="",i>=r.length&&f("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),r.forEach((e,s)=>{const o=_t(e);if(n.appendChild(o),s===i&&te(o,u["active-progress-step"]),s!==r.length-1){const e=xt(t);n.appendChild(e)}})):oe(n)},_t=e=>{const t=document.createElement("li");return te(t,u["progress-step"]),J(t,e),t},xt=e=>{const t=document.createElement("li");return te(t,u["progress-step-line"]),e.progressStepsDistance&&ie(t,"width",e.progressStepsDistance),t},Et=(e,t)=>{const n=C();
2n&&(ae(n),le(n,Boolean(t.title||t.titleText),"block"),t.title&&Se(t.title,n),t.titleText&&(n.innerText=t.titleText),Y(n,t,"title"))},kt=(e,t)=>{wt(e,t),Ue(e,t),At(e,t),$e(e,t),at(e,t),Et(e,t),Me(e,t),Ye(e,t),Ce(e,t),Xe(e,t);const n=S();"function"===typeof t.didRender&&n&&t.didRender(n),o.eventEmitter.emit("didRender",n)},St=()=>ue(S()),It=()=>{var e;return null===(e=M())||void 0===e?void 0:e.click()},Tt=()=>{var e;return null===(e=L())||void 0===e?void 0:e.click()},Ct=()=>{var e;return null===(e=U())||void 0===e?void 0:e.click()},Pt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Ot=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Nt=(e,t,n)=>{Ot(e),t.toast||(e.keydownHandler=e=>Lt(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:S(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},Rt=(e,t)=>{var n;const r=H();if(r.length)return-2===(e+=t)&&(e=r.length-1),e===r.length?e=0:-1===e&&(e=r.length-1),void r[e].focus();null===(n=S())||void 0===n||n.focus()},Mt=["ArrowRight","ArrowDown"],Ut=["ArrowLeft","ArrowUp"],Lt=(e,t,n
2)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Bt(t,e):"Tab"===t.key?Dt(t):[...Mt,...Ut].includes(t.key)?jt(t.key):"Escape"===t.key&&Ft(t,e,n)))},Bt=(e,t)=>{if(!w(t.allowEnterKey))return;const n=X(S(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;It(),e.preventDefault()}},Dt=e=>{const t=e.target,n=H();let r=-1;for(let i=0;i<n.length;i++)if(t===n[i]){r=i;break}e.shiftKey?Rt(r,-1):Rt(r,1),e.stopPropagation(),e.preventDefault()},jt=e=>{const t=j(),n=M(),r=L(),i=U();if(!t||!n||!r||!i)return;const s=[n,r,i];if(document.activeElement instanceof HTMLElement&&!s.includes(document.activeElement))return;const o=Mt.includes(e)?"nextElementSibling":"previousElementSibling";let a=document.activeElement;if(a){for(let e=0;e<t.children.length;e++){if(a=a[o],!a)return;if(a instanceof HTMLButtonElement&&ue(a))break}a instanceof HTMLButtonElement&&a.focus()}},Ft=(e,t,n)=>{e.preventDefault(),w(t.allowEscapeKey)&&n(Pt.esc)};var zt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Wt=()=>{const e=x();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))})},qt=()=>{Array.from(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},Ht="undefined"!==typeof window&&!!window.GestureEvent,Vt=()=>{if(Ht&&!Z(document.body,u.iosfix)){const e=document.body.scrollTop;document.body.style.top="".concat(-1*e,"px"),te(document.body,u.iosfix),Gt()}},Gt=()=>{const e=x();if(!e)return;let t;e.ontouchstart=e=>{t=Kt(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},Kt=e=>{const t=e.target,n=x(),r=P();return!(!n||!r)&&!Jt(e)&&!Zt(e)&&(t===n||!(he(n)||!(t instanceof HTMLElement)||pe(t,r)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||he(r)&&r.contains(t)))},Jt=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Zt=e=>e.touches&&e.touches.length>1,Qt=()=>{if(Z(document.body,u.iosfix)){const e=parseInt(document.body.style.top,10);ne(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},Yt=()=>{const e=document.createElement("div");e.className=u["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t};let Xt=null;const $t=e=>{null===Xt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Xt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Xt+Yt(),"px"))},en=()=>{null!==Xt&&(document.body.style.paddingRight="".concat(Xt,"px"),Xt=null)};function tn(e,t,n,r){G()?dn(e,r):(c(n).then(()=>dn(e,r)),Ot(o)),Ht?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),V()&&(en(),Qt(),qt()),nn()}function nn(){ne([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function rn(e){e=cn(e);const t=zt.swalPromiseResolve.get(this),n=sn(this);this.isAwaitingPromise?e.isDismissed||(an(this),t(e)):n&&t(e)}const sn=e=>{const t=S();if(!t)return!1;const n=je.innerParams.get(e);if(!n||Z(t,n.hideClass.popup))return!1;ne(t,n.showClass.popup),te(t,n.hideClass.popup);const r=x();return ne(r,n.showClass.backdrop),te(r,n.hideClass.backdrop),ln(e,t,n),!0};function on(e){const t=zt.swalPromiseReject.get(this);an(this),t&&t(e)}const an=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,je.innerParams.get(e)||e._destroy())},cn=e=>"undefined"===typeof e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),ln=(e,t,n)=>{var r;const i=x(),s=fe(t);"function"===typeof n.willClose&&n.willClose(t),null===(r=o.eventEmitter)||void 0===r||r.emit("willClose",t),s?un(e,t,i,n.returnFocus,n.didClose):tn(e,i,n.returnFocus,n.didClose)},un=(e,t,n,r,i)=>{o.swalCloseEventFinishedCallback=tn.bind(null,e,n,r,i);const s=function(e){var n;e.target===t&&(null===(n=o.swalCloseEventFinishedCallback)||void 0===n||n.call(o),delete o.swalCloseEventFinishedCallback,t.removeEventListener("animationend",s),t.removeEventListener("transitionend",s))};t.addEventListener("animationend",s),t.addEventListener("transitionend",s)},dn=(e,t)=>{setTimeout(()=>{var n;"function"===typeof t&&t.bind(e.params)(),null===(n=o.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()})},hn=e=>{let t=S();if(t||new gi,t=S(),!t)return;const n=D();G()?oe(I()):pn(t,e),se(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focu
2s()},pn=(e,t)=>{const n=j(),r=D();n&&r&&(!t&&ue(M())&&(t=M()),se(n),t&&(oe(t),r.setAttribute("data-button-to-replace",t.className),n.insertBefore(r,t)),te([e,n],u.loading))},fn=(e,t)=>{"select"===t.input||"radio"===t.input?wn(e,t):["text","email","number","tel","textarea"].some(e=>e===t.input)&&(b(t.inputValue)||_(t.inputValue))&&(hn(M()),bn(e,t))},gn=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return mn(n);case"radio":return yn(n);case"file":return vn(n);default:return t.inputAutoTrim?n.value.trim():n.value}},mn=e=>e.checked?1:0,yn=e=>e.checked?e.value:null,vn=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,wn=(e,t)=>{const n=S();if(!n)return;const r=e=>{"select"===t.input?An(n,xn(e),t):"radio"===t.input&&_n(n,xn(e),t)};b(t.inputOptions)||_(t.inputOptions)?(hn(M()),A(t.inputOptions).then(t=>{e.hideLoading(),r(t)})):"object"===typeof t.inputOptions?r(t.inputOptions):g("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},bn=(e,t)=>{const n=e.getInput();n&&(oe(n),A(t.inputValue).then(r=>{n.value="number"===t.input?"".concat(parseFloat(r)||0):"".concat(r),se(n),n.focus(),e.hideLoading()}).catch(t=>{g("Error in inputValue promise: ".concat(t)),n.value="",se(n),n.focus(),e.hideLoading()}))};function An(e,t,n){const r=re(e,u.select);if(!r)return;const i=(e,t,r)=>{const i=document.createElement("option");i.value=r,J(i,t),i.selected=En(r,n.inputValue),e.appendChild(i)};t.forEach(e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,r.appendChild(e),n.forEach(t=>i(e,t[1],t[0]))}else i(r,n,t)}
2),r.focus()}function _n(e,t,n){const r=re(e,u.radio);if(!r)return;t.forEach(e=>{const t=e[0],i=e[1],s=document.createElement("input"),o=document.createElement("label");s.type="radio",s.name=u.radio,s.value=t,En(t,n.inputValue)&&(s.checked=!0);const a=document.createElement("span");J(a,i),a.className=u.label,o.appendChild(s),o.appendChild(a),r.appendChild(o)});const i=r.querySelectorAll("input");i.length&&i[0].focus()}const xn=e=>{const t=[];return e instanceof Map?e.forEach((e,n)=>{let r=e;"object"===typeof r&&(r=xn(r)),t.push([n,r])}):Object.keys(e).forEach(n=>{let r=e[n];"object"===typeof r&&(r=xn(r)),t.push([n,r])}),t},En=(e,t)=>!!t&&t.toString()===e.toString(),kn=e=>{const t=je.innerParams.get(e);e.disableButtons(),t.input?Tn(e,"confirm"):Rn(e,!0)},Sn=e=>{const t=je.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Tn(e,"deny"):Pn(e,!1)},In=(e,t)=>{e.disableButtons(),t(Pt.cancel)},Tn=(e,t)=>{const n=je.innerParams.get(e);if(!n.input)return void g('The "input" parameter is needed to be set when using returnInputValueOn'.concat(p(t)));const r=e.getInput(),i=gn(e,n);n.inputValidator?Cn(e,i,t):r&&!r.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||r.validationMessage)):"deny"===t?Pn(e,i):Rn(e,i)},Cn=(e,t,n)=>{const r=je.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>A(r.inputValidator(t,r.validationMessage))).then(r=>{e.enableButtons(),e.enableInput(),r?e.showValidationMessage(r):"deny"===n?Pn(e,t):Rn(e,t)})},Pn=(e,t)=>{const n=je.innerParams.get(e||void 0);n.showLoaderOnDeny&&hn(L()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>A(n.preDeny(t,n.validationMessage))).then(n=>{!1===n?(e.hideLoading(),an(e)):e.close({isDenied:!0,value:"undefined"===typeof n?t:n})}).catch(t=>Nn(e||void 0,t))):e.close({isDenied:!0,value:t})},On=(e,t)=>{e.close({isConfirmed:!0,value:t})},Nn=(e,t)=>{e.rejectPromise(t)},Rn=(e,t)=>{const n=je.innerParams.get(e||void 0);n.showLoaderOnConfirm&&hn(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>A(n.preConfirm(t,n.validationMessage))).then(n=>{ue(R())||!1===n?(e.hideLoading(),an(e)):On(e,"undefined"===typeof n?t:n)}).catch(t=>Nn(e||void 0,t))):On(e,t)};function Mn(){const e=je.innerParams.get(this);if(!e)return;const t=je.domCache.get(this);oe(t.loader),G()?e.icon&&se(I()):Un(t),ne([t.popup,t.actions],u.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Un=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?se(t[0],"inline-block"):de()&&oe(e.actions)};function Ln(){const e=je.innerParams.get(this),t=je.domCache.get(this);return t?X(t.popup,e.input):null}function Bn(e,t,n){const r=je.domCache.get(e);t.forEach(e=>{r[e].disabled=n})}function Dn(e,t){const n=S();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll('[name="'.concat(u.radio,'"]'));for(let n=0;n<e.length;n++)e[n].disabled=t}else e.disabled=t}function jn(){Bn(this,["confirmButton","denyButton","cancelButton"],!1)}function Fn(){Bn(this,["confirmButton","denyButton","cancelButton"],!0)}function zn(){Dn(this.getInput(),!1)}function Wn(){Dn(this.getInput(),!0)}function qn(e){const t=je.domCache.get(this),n=je.innerParams.get(this);J(t.validationMessage,e),t.validationMessage.className=u["validation-message"],n.customClass&&n.customClass.validationMessage&&te(t.validationMessage,n.customClass.validationMessage),se(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid","true"),r.setAttribute("aria-describedby",u["validation-message"]),$(r),te(r,u.inputerror))}function Hn(){const e=je.domCache.get(this);e.validationMessage&&oe(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),ne(t,u.inputerror))}const Vn={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:"light",showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose
vendor: 4,239 bytes, line 2
2:void 0,didDestroy:void 0,scrollbarPadding:!0,topLayer:!1},Gn=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","theme","willClose"],Kn={allowEnterKey:void 0},Jn=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Zn=e=>Object.prototype.hasOwnProperty.call(Vn,e),Qn=e=>-1!==Gn.indexOf(e),Yn=e=>Kn[e],Xn=e=>{Zn(e)||f('Unknown parameter "'.concat(e,'"'))},$n=e=>{Jn.includes(e)&&f('The parameter "'.concat(e,'" is incompatible with toasts'))},er=e=>{const t=Yn(e);t&&v(e,t)},tr=e=>{!1===e.backdrop&&e.allowOutsideClick&&f('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e.theme&&!["light","dark","auto","minimal","borderless","bootstrap-4","bootstrap-4-light","bootstrap-4-dark","bootstrap-5","bootstrap-5-light","bootstrap-5-dark","material-ui","material-ui-light","material-ui-dark","embed-iframe","bulma","bulma-light","bulma-dark"].includes(e.theme)&&f('Invalid theme "'.concat(e.theme,'"'));for(const t in e)Xn(t),e.toast&&$n(t),er(t)};function nr(e){const t=x(),n=S(),r=je.innerParams.get(this);if(!n||Z(n,r.hideClass.popup))return void f("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const i=rr(e),s=Object.assign({},r,i);tr(s),t.dataset.swal2Theme=s.theme,kt(this,s),je.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const rr=e=>{const t={};return Object.keys(e).forEach(n=>{Qn(n)?t[n]=e[n]:f("Invalid parameter to update: ".concat(n))}),t};function ir(){const e=je.domCache.get(this),t=je.innerParams.get(this);t?(e.popup&&o.swalCloseEventFinishedCallback&&(o.swalCloseEventFinishedCallback(),delete o.swalCloseEventFinishedCallback),"function"===typeof t.didDestroy&&t.didDestroy(),o.eventEmitter.emit("didDestroy"),sr(this)):or(this)}const sr=e=>{or(e),delete e.params,delete o.keydownHandler,delete o.keydownTarget,delete o.currentInstance},or=e=>{e.isAwaitingPromise?(ar(je,e),e.isAwaitingPromise=!0):(ar(zt,e),ar(je,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},ar=(e,t)=>{for(const n in e)e[n].delete(t)};var cr=Object.freeze({__proto__:null,_destroy:ir,close:rn,closeModal:rn,closePopup:rn,closeToast:rn,disableButtons:Fn,disableInput:Wn,disableLoading:Mn,enableButtons:jn,enableInput:zn,getInput:Ln,handleAwaitingPromise:an,hideLoading:Mn,rejectPromise:on,resetValidationMessage:Hn,showValidationMessage:qn,update:nr});const lr=(e,t,n)=>{e.toast?ur(e,t,n):(pr(t),fr(t),gr(e,t,n))},ur=(e,t,n)=>{t.popup.onclick=()=>{e&&(dr(e)||e.timer||e.input)||n(Pt.close)}},dr=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let hr=!1;const pr=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(hr=!0)}}},fr=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(hr=!0)}}},gr=(e,t,n)=>{t.container.onclick=r=>{hr?hr=!1:r.target===t.container&&w(e.allowOutsideClick)&&n(Pt.backdrop)}},mr=e=>"object"===typeof e&&e.jquery,yr=e=>
2e instanceof Element||mr(e),vr=e=>{const t={};return"object"!==typeof e[0]||yr(e[0])?["title","html","icon"].forEach((n,r)=>{const i=e[r];"string"===typeof i||yr(i)?t[n]=i:void 0!==i&&g("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof i))}):Object.assign(t,e[0]),t};function wr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this(...t)}function br(e){class t extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}return t}const Ar=()=>o.timeout&&o.timeout.getTimerLeft(),_r=()=>{if(o.timeout)return me(),o.timeout.stop()},xr=()=>{if(o.timeout){const e=o.timeout.start();return ge(e),e}},Er=()=>{const e=o.timeout;return e&&(e.running?_r():xr())},kr=e=>{if(o.timeout){const t=o.timeout.increase(e);return ge(t,!0),t}},Sr=()=>!(!o.timeout||!o.timeout.isRunning());let Ir=!1;const Tr={};function Cr(){Tr[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Ir||(document.body.addEventListener("click",Pr),Ir=!0)}const Pr=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in Tr){const n=t.getAttribute(e);if(n)return void Tr[e].fire({template:n})}};class Or{constructor(){this.events={}}_getHandlersByEventName(e){return"undefined"===typeof this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const r=function(){n.removeListener(e,r);for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];t.apply(n,s)};this.on(e,r)}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this._getHandlersByEventName(e).forEach(e=>{try{e.apply(this,n)}catch(g){console.error(g)}})}removeListener(e,t){const n=this._getHandlersByEventName(e),r=n.indexOf(t);r>-1&&n.splice(r,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}}o.eventEmitter=new Or;const Nr=(e,t)=>{o.eventEmitter.on(e,t)},Rr=(e,t)=>{o.eventEmitter.once(e,t)},Mr=(e,t)=>{e?t?o.eventEmitter.removeListener(e,t):o.eventEmitter.removeAllListeners(e):o.eventEmitter.reset()};var Ur=Object.freeze({__proto__:null,argsToParams:vr,bindClickHandler:Cr,clickCancel:Ct,clickConfirm:It,clickDeny:Tt,enableLoading:hn,fire:wr,getActions:j,getCancelButton:U,getCloseButton:W,getConfirmButton:M,getContainer:x,getDenyButton:L,getFocusableElements:H,getFooter:F,getHtmlContainer:P,getIcon:I,getIconContent:T,getImage:O,getInputLabel:B,getLoader:D,getPopup:S,getProgressSteps:N,getTimerLeft:Ar,getTimerProgressBar:z,getTitle:C,getValidationMessage:R,increaseTimer:kr,isDeprecatedParameter:Yn,isLoading:K,isTimerRunning:Sr,isUpdatableParameter:Qn,isValidParameter:Zn,isVisible:St,mixin:br,off:Mr,on:Nr,once:Rr,resumeTimer:xr,showLoading:hn,stopTimer:_r,toggleTimer:Er});class Lr{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Br=["swal-title","swal-html","swal-footer"],Dr=e=>{const t="string"===typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Gr(n),Object.assign(jr(n),Fr(n),zr(n),Wr(n),qr(n),Hr(n),Vr(n,Br))},jr=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach(e=>{Kr(e,["name","value"]);const n=e.getAttribute("name"),r=e.getAttribute("value");n&&r&&("boolean"===typeof Vn[n]?t[n]="false"!==r:"object"===typeof Vn[n]?t[n]=JSON.parse(r):t[n]=r)}),t},Fr=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(e=>{const n=e.getAttribute("name"),r=e.getAttribute("value");n&&r&&(t[n]=new Function("return ".concat(r))())}),t},zr=e=>{const t={};
2return Array.from(e.querySelectorAll("swal-button")).forEach(e=>{Kr(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t["".concat(n,"ButtonText")]=e.innerHTML,t["show".concat(p(n),"Button")]=!0,e.hasAttribute("color")&&(t["".concat(n,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t["".concat(n,"ButtonAriaLabel")]=e.getAttribute("aria-label")))}),t},Wr=e=>{const t={},n=e.querySelector("swal-image");return n&&(Kr(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t},qr=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Kr(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Hr=e=>{const t={},n=e.querySelector("swal-input");n&&(Kr(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const r=Array.from(e.querySelectorAll("swal-input-option"));return r.length&&(t.inputOptions={},r.forEach(e=>{Kr(e,["value"]);const n=e.getAttribute("value");if(!n)return;const r=e.innerHTML;t.inputOptions[n]=r})),t},Vr=(e,t)=>{const n={};for(const r in t){const i=t[r],s=e.querySelector(i);s&&(Kr(s,[]),n[i.replace(/^swal-/,"")]=s.innerHTML.trim())}return n},Gr=e=>{const t=Br.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(e=>{const n=e.tagName.toLowerCase();t.includes(n)||f("Unrecognized element <".concat(n,">"))})},Kr=(e,t)=>{Array.from(e.attributes).forEach(n=>{-1===t.indexOf(n.name)&&f(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])})},Jr=10,Zr=e=>{const t=x(),n=S();"function"===typeof e.willOpen&&e.willOpen(n),o.eventEmitter.emit("willOpen",n);const r=window.getComputedStyle(document.body).overflowY;$r(t,n,e),setTimeout(()=>{Yr(t,n)},Jr),V()&&(Xr(t,e.scrollbarPadding,r),Wt()),G()||o.previousActiveElement||(o.previousActiveElement=document.activeElement),"function"===typeof e.didOpen&&setTimeout(()=>e.didOpen(n)),o.eventEmitter.emit("didOpen",n)},Qr=e=>{const t=S();if(e.target!==t)return;const n=x();t.removeEventListener("animationend",Qr),t.removeEventListener("transitionend",Qr),n.style.overflowY="auto",ne(n,u["no-transition"])},Yr=(e,t)=>
2{fe(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",Qr),t.addEventListener("transitionend",Qr)):e.style.overflowY="auto"},Xr=(e,t,n)=>{Vt(),t&&"hidden"!==n&&$t(n),setTimeout(()=>{e.scrollTop=0})},$r=(e,t,n)=>{te(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),se(t,"grid"),setTimeout(()=>{te(t,n.showClass.popup),t.style.removeProperty("opacity")},Jr)):se(t,"grid"),te([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&te([document.documentElement,document.body],u["height-auto"])};var ei={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function ti(e){e.inputValidator||("email"===e.input&&(e.inputValidator=ei.email),"url"===e.input&&(e.inputValidator=ei.url))}function ni(e){(!e.target||"string"===typeof e.target&&!document.querySelector(e.target)||"string"!==typeof e.target&&!e.target.appendChild)&&(f('Target parameter is not valid, defaulting to "body"'),e.target="body")}function ri(e){ti(e),e.showLoaderOnConfirm&&!e.preConfirm&&f("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),ni(e),"string"===typeof e.title&&(e.title=e.title.split("\n").join("<br />")),ke(e)}let ii;var si=new WeakMap;class oi{constructor(){if(r(this,si,void 0),"undefined"===typeof window)return;ii=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const s=Object.freeze(this.constructor.argsToParams(t));this.params=s,this.isAwaitingPromise=!1,i(si,this,this._main(ii.params))}_main(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(tr(Object.assign({},t,e)),o.currentInstance){const e=zt.swalPromiseResolve.get(o.currentInstance),{isAwaitingPromise:t}=o.currentInstance;o.currentInstance._destroy(),t||e({isDismissed:!0}),V()&&qt()}o.currentInstance=ii;const n=ci(e,t);ri(n),Object.freeze(n),o.timeout&&(o.timeout.stop(),delete o.timeout),clearTimeout(o.restoreFocusTimeout);const r=li(ii);return kt(ii,n),je.innerParams.set(ii,n),ai(ii,r,n)}then(e){return n(si,this).then(e)}finally(e){return n(si,this).finally(e)}}const ai=(e,t,n)=>new Promise((r,i)=>{const s=t=>{e.close({isDismissed:!0,dismiss:t,isConfirmed:!1,isDenied:!1})};zt.swalPromiseResolve.set(e,r),zt.swalPromiseReject.set(e,i),t.confirmButton.onclick=()=>{kn(e)},t.denyButton.onclick=()=>{Sn(e)},t.cancelButton.onclick=()=>{In(e,s)},t.closeButton.onclick=()=>{s(Pt.close)},lr(n,t,s),Nt(o,n,s),fn(e,n),Zr(n),ui(o,n,s),di(t,n),setTimeout(()=>{t.container.scrollTop=0})}),ci=(e,t)=>{const n=Dr(e),r=Object.assign({},Vn,t,n,e);return r.showClass=Object.assign({},Vn.showClass,r.showClass),r.hideClass=Object.assign({},Vn.hideClass,r.hideClass),!1===r.animation&&(r.showClass={backdrop:"swal2-noanimation"},r.hideClass={}),r},li=e=>{const t={popup:S(),container:x(),actions:j(),confirmButton:M(),denyButton:L(),cancelButton:U(),loader:D(),closeButton:W(),validationMessage:R(),progressSteps:N()};return je.domCache.set(e,t),t},ui=(e,t,n)=>{const r=z();oe(r),t.timer&&(e.timeout=new Lr(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(se(r),Y(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ge(t.timer)})))},di=(e,t)=>{if(!t.toast)return w(t.allowEnterKey)?void(hi(e)||pi(e,t)||Rt(-1,1)):(v("allowEnterKey"),void fi())},hi=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const n of t)if(n instanceof HTMLElement&&ue(n))return n.focus(),!0;return!1},pi=(e,t)=>t.focusDeny&&ue(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ue(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ue(e.confirmButton))&&(e.confirmButton.focus(),!0),fi=()=>{document.activeElement instanceof HTMLElement&&"function"===typeof document.activeElement.blur&&document.activeElement.blur()};oi.prototype.disableButtons=Fn,oi.prototype.enableButtons=jn,oi.prototype.getInput=Ln,oi.prototype.disableInput=Wn,oi.prototype.enableInput=zn,oi.prototype.hideLoading=Mn,oi.prototype.disableLoading=Mn,oi.prototype.showValidationMessage=qn,oi.prototype.resetValidationMessage=Hn,oi.prototype.close=rn,oi.prototype.closePopup=rn,oi.prototype.closeModal=rn,oi.prototype.closeToast=rn,oi.prototype.rejectPromise=on,oi.prototype.update=nr,oi.prototype._destroy=ir,Object.assign(oi,Ur),Object.keys(cr).forEach(e
2=>{oi[e]=function(){return ii&&ii[e]?ii[e](...arguments):null}}),oi.DismissReason=Pt,oi.version="11.26.3";const gi=oi;return gi.default=gi,gi}(),"undefined"!==typeof this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,
vendor: 12,087 bytes, line 2
2':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);
vendor: 5,100 bytes, line 2
2box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;
vendor: 13,481 bytes, line 2
2box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}')
2},56388:(e,t,n)=>{"use strict";n.d(t,{Fl:()=>s,NV:()=>o,ii:()=>i});var r=n(51659);class i extends r.C{constructor(e){let{offset:t,position:n,size:r}=e;super("Slice ".concat("start"===n?"starting":"ending",' at offset "').concat(t,'" is out-of-bounds (size: ').concat(r,")."),{name:"SliceOffsetOutOfBoundsError"})}}class s extends r.C{constructor(e){let{size:t,targetSize:n,type:r}=e;super("".concat(r.charAt(0).toUpperCase()).concat(r.slice(1).toLowerCase()," size (").concat(t,") exceeds padding size (").concat(n,")."),{name:"SizeExceedsPaddingSizeError"})}}class o extends r.C{constructor(e){let{size:t,targetSize:n,type:r}=e;super("".concat(r.charAt(0).toUpperCase()).concat(r.slice(1).toLowerCase()," is expected to be ").concat(n," ").concat(r," long, but is ").concat(t," ").concat(r," long."),{name:"InvalidBytesLengthError"})}}},56523:(e,t,n)=>{"use strict";n.d(t,{Bv:()=>a,bm:()=>c});var r=n(24107),i=n(652),s=n(38910);const o={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function a(e,t){const n={};return"undefined"!==typeof e.authorizationList&&(n.authorizationList=e.authorizationList.map(e=>(0,r.A)((0,r.A)({address:e.address,r:e.r?(0,i.cK)(BigInt(e.r)):e.r,s:e.s?(0,i.cK)(BigInt(e.s)):e.s,chainId:(0,i.cK)(e.chainId),nonce:(0,i.cK)(e.nonce)},"undefined"!==typeof e.yParity?{yParity:(0,i.cK)(e.yParity)}:{}),"undefined"!==typeof e.v&&"undefined"===typeof e.yParity?{v:(0,i.cK)(e.v)}:{}))),"undefined"!==typeof e.accessList&&(n.accessList=e.accessList),"undefined"!==typeof e.blobVersionedHashes&&(n.blobVersionedHashes=e.blobVersionedHashes),"undefined"!==typeof e.blobs&&("string"!==typeof e.blobs[0]?n.blobs=e.blobs.map(e=>(0,i.My)(e)):n.blobs=e.blobs),"undefined"!==typeof e.data&&(n.data=e.data),e.account&&(n.from=e.account.address),"undefined"!==typeof e.from&&(n.from=e.from),"undefined"!==typeof e.gas&&(n.gas=(0,i.cK)(e.gas)),"undefined"!==typeof e.gasPrice&&(n.gasPrice=(0,i.cK)(e.gasPrice)),"undefined"!==typeof e.maxFeePerBlobGas&&(n.maxFeePerBlobGas=(0,i.cK)(e.maxFeePerBlobGas)),"undefined"!==typeof e.maxFeePerGas&&(n.maxFeePerGas=(0,i.cK)(e.maxFeePerGas)),"undefined"!==typeof e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=(0,i.cK)(e.maxPriorityFeePerGas)),"undefined"!==typeof e.nonce&&(n.nonce=(0,i.cK)(e.nonce)),"undefined"!==typeof e.to&&(n.to=e.to),"undefined"!==typeof e.type&&(n.type=o[e.type]),"undefined"!==typeof e.value&&(n.value=(0,i.cK)(e.value)),n}const c=(0,s.q)("transactionRequest",a)},56769:(e,t,n)=>{"use strict";n.d(t,{Q:()=>i});var r=n(652);async function i(e,t){let{address:n,blockNumber:i,blockTag:s="latest"}=t;const o=void 0!==i?(0,r.cK)(i):void 0,a=await e.request({method:"eth_getCode",params:[n,o||s]},{dedupe:Boolean(o)});if("0x"!==a)return a}},56915:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol
2:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0}},56973:(e,t,n)=>{"use strict";function r(e){return"object"==typeof e&&null!==e&&"nodeType"in e}function i(e){return r(e)&&"tagName"in e}function s(e){return i(e)&&"accessKey"in e}function o(e){return i(e)&&"tabIndex"in e}function a(e){return i(e)&&"style"in e}function c(e){return s(e)&&"IFRAME"===e.nodeName}function l(e){return s(e)&&"INPUT"===e.nodeName}function u(e){return s(e)&&"LABEL"===e.nodeName}function d(e){return s(e)&&"FIELDSET"===e.nodeName}function h(e){return s(e)&&"LEGEND"===e.nodeName}function p(e){return!!i(e)&&e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]')}n.d(t,{A3:()=>l,Er:()=>d,Gu:()=>c,H5:()=>p,Jb:()=>h,Lk:()=>o,Ll:()=>r,kS:()=>u,pv:()=>a,sb:()=>s,vq:()=>i})},57066:(e,t,n)=>{const r=n(67735);function i(e,t,n){const r=e[t]+e[n];let i=e[t+1]+e[n+1];r>=4294967296&&i++,e[t]=r,e[t+1]=i}function s(e,t,n,r){let i=e[t]+n;n<0&&(i+=4294967296);let s=e[t+1]+r;i>=4294967296&&s++,e[t]=i,e[t+1]=s}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,n,r,o,a){const c=d[o],l=d[o+1],h=d[a],p=d[a+1];i(u,e,t),s(u,e,c,l);let f=u[r]^u[e],g=u[r+1]^u[e+1];u[r]=g,u[r+1]=f,i(u,n,r),f=u[t]^u[n],g=u[t+1]^u[n+1],u[t]=f>>>24^g<<8,u[t+1]=g>>>24^f<<8,i(u,e,t),s(u,e,h,p),f=u[r]^u[e],g=u[r+1]^u[e+1],u[r]=f>>>16^g<<16,u[r+1]=g>>>16^f<<16,i(u,n,r),f=u[t]^u[n],g=u[t+1]^u[n+1],u[t]=g>>>31^f<<1,u[t+1]=f>>>31^g<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),l=new Uint8Array([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].map(function(e){return 2*e})),u=new Uint32Array(32),d=new Uint32Array(32);function h(e,t){let n=0;for(n=0;n<16;n++)u[n]=e.h[n],u[n+16]=c[n];for(u[24]=u[24]^e.t,u[25]=u[25]^e.t/4294967296,t&&(u[28]=~u[28],u[29]=~u[29]),n=0;n<32;n++)d[n]=o(e.b,4*n);for(n=0;n<12;n++)a(0,8,16,24,l[16*n+0],l[16*n+1]),a(2,10,18,26,l[16*n+2],l[16*n+3]),a(4,12,20,28,l[16*n+4],l[16*n+5]),a(6,14,22,30,l[16*n+6],l[16*n+7]),a(0,10,20,30,l[16*n+8],l[16*n+9]),a(2,12,22,24,l[16*n+10],l[16*n+11]),a(4,14,16,26,l[16*n+12],l[16*n+13]),a(6,8,18,28,l[16*n+14],l[16*n+15]);for(n=0;n<16;n++)e.h[n]=e.h[n]^u[n]^u[n+16]}const p=new Uint8Array([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 f(e,t,n,r){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(n&&16!==n.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(r&&16!==r.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};p.fill(0),p[0]=e,t&&(p[1]=t.length),p[2]=1,p[3]=1,n&&p.set(n,32),r&&p.set(r,48);for(let s=0;s<16;s++)i.h[s]=c[s]^o(p,4*s);return t&&(g(i,t),i.c=128),i}function g(e,t){for(let n=0;n<t.length;n++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[n]}function m(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;h(e,!0);const t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(3&n);return t}function y(e,t,n,i,s){n=n||64,e=r.normalizeInput(e),i&&(i=r.normalizeInput(i)),s&&(s=r.normalizeInput(s));const o=f(n,t,i,s);return g(o,e),m(o)}
2e.exports={blake2b:y,blake2bHex:function(e,t,n,i,s){const o=y(e,t,n,i,s);return r.toHex(o)},blake2bInit:f,blake2bUpdate:g,blake2bFinal:m}},57579:(e,t,n)=>{"use strict";n.d(t,{u:()=>s});var r=n(70495);const i=new Map;function s(e){let{fn:t,id:n,shouldSplitBatch:s,wait:o=0,sort:a}=e;const c=async()=>{const e=u();l();const n=e.map(e=>{let{args:t}=e;return t});0!==n.length&&t(n).then(t=>{a&&Array.isArray(t)&&t.sort(a);for(let n=0;n<e.length;n++){const{resolve:r}=e[n];null===r||void 0===r||r([t[n],t])}}).catch(t=>{for(let n=0;n<e.length;n++){const{reject:r}=e[n];null===r||void 0===r||r(t)}})},l=()=>i.delete(n),u=()=>i.get(n)||[],d=e=>i.set(n,[...u(),e]);return{flush:l,async schedule(e){const{promise:t,resolve:n,reject:i}=(0,r.Y)();(null===s||void 0===s?void 0:s([...u().map(e=>{let{args:t}=e;return t}),e]))&&c();return u().length>0?(d({args:e,resolve:n,reject:i}),t):(d({args:e,resolve:n,reject:i}),setTimeout(c,o),t)}}}},57722:(e,t,n)=>{"use strict";e.exports=n(62581)},58721:(e,t,n)=>{"use strict";n.d(t,{BD:()=>i,D5:()=>r,Ge:()=>s});const r=/^(.*)\[([0-9]*)\]$/,i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/},58922:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var r=n(33809),i=n(18656),s=n(14061),o=n(78203),a=n(90934),c=n(68419);function l(e){const{abi:t,data:n}=e,l=(0,s.di)(n,0,4);if("0x"===l)throw new i.O;const u=[...t||[],r.Mc,r.J9].find(e=>"error"===e.type&&l===(0,o.V)((0,c.B)(e)));if(!u)throw new i.Wq(l,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:u,args:"inputs"in u&&u.inputs&&u.inputs.length>0?(0,a.n)(u.inputs,(0,s.di)(n,4)):void 0,errorName:u.name}}},59314:(e,t,n)=>{"use strict";n.d(t,{Uf:()=>u,XW:()=>d,fO:()=>c,jf:()=>l,zR:()=>a});const r="PARSE_ERROR",i="INVALID_REQUEST",s="METHOD_NOT_FOUND",o="INVALID_PARAMS",a="INTERNAL_ERROR",c="SERVER_ERROR",l=[-32700,-32600,-32601,-32602,-32603],u={[r]:{code:-32700,message:"Parse error"},[i]:{code:-32600,message:"Invalid Request"},[s]:{code:-32601,message:"Method not found"},[o]:{code:-32602,message:"Invalid params"},[a]:{code:-32603,message:"Internal error"},[c]:{code:-32e3,message:"Server error"}},d=c},59388:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(24107),i=n(25741),s=n(55128);function o(e){var t,n,o,a;const{batch:c,chain:l,ccipRead:u,key:d="base",name:h="Base Client",type:p="base"}=e,f=null!==(t=e.experimental_blockTag)&&void 0!==t?t:"number"===typeof(null===l||void 0===l?void 0:l.experimental_preconfirmationTime)?"pending":void 0,g=null!==(n=null===l||void 0===l?void 0:l.blockTime)&&void 0!==n?n:12e3,m=Math.min(Math.max(Math.floor(g/2),500),4e3),y=null!==(o=e.pollingInterval)&&void 0!==o?o:m,v=null!==(a=e.cacheTime)&&void 0!==a?a:y,w=e.account?(0,i.J)(e.account):void 0,{config:b,request:A,value:_}=e.transport({account:w,chain:l,pollingInterval:y}),x=(0,r.A)((0,r.A)({},b),_),E=(0,r.A)({account:w,batch:c,cacheTime:v,ccipRead:u,chain:l,key:d,name:h,pollingInterval:y,request:A,transport:x,type:p,uid:(0,s.L)()},f?{experimental_blockTag:f}:{});return Object.assign(E,{extend:function e(t){return n=>{const i=n(t);for(const e in E)delete i[e];const s=(0,r.A)((0,r.A)({},t),i);return Object.assign(s,{extend:e(s)})}}(E)})}},59892:(e,t,n)=>{"use strict";n.d(t,{S:()=>a});var r=n(75008),i=n(6806),s=n(91638),o=n(652);function a(e,t){const n=t||"hex",a=(0,r.lY)((0,i.q)(e,{strict:!1})?(0,s.ZJ)(e):e);return"bytes"===n?a:(0,o.nj)(a)}},60086:(e,t,n)=>{"use strict";async function r(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}n.d(t,{L:()=>r})},60207:(e,t,n)=>{"use strict";function r(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(e){return e instanceof ArrayBuffer||"undefined"!==typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}(e)?new Uint8Array(e):Uint8Array.from(e)}n.d(t,{C:()=>r})},60522:(e,t,n)=>{"use strict";n.d(t,{BX:()=>f,RO:()=>v,i5:()=>m,iW:()=>y,l9:()=>p});var r=n(24107),i=n(5708),s=n(41684),o=n(64740),a=n(69314),c=n(10860),l=n(14674),u=n(77654),d=n(34182);function h(e){const t=Object.values(e);if(0===t.length)throw new c.tsw(c.BUQ);return t.map(e=>e||new Uint8Array(64).fill(0))}function p(){return(0,o.a5)([["signatures",(0,s.FU)((0,o.is)((0,s.Ns)((0,o.Im)(),64),{size:(0,a.tD)()}),h)],["messageBytes",(0,o.Im)()]])}function f(){return(0,s.vt)((0,o.ci)([["signatures",(0,o.O_)((0,s.pI)((0,o.EK)(),64),{size:(0,a.vU)()})],["messageBytes",(0,o.EK)()]]),g)}function g(e){const{messageBytes:t,signatures:n}=e,r=(0,o.xQ)([(0,l.N0)(),(0,s.iO)((0,a.eh)(),2),(0,o.O_)((0,i.Xg)(),{size:(0,a.vU)()})]),[u,d,h]=r.decode(t),p=h.slice(0,d);if(p.length!==n.length)throw new c.tsw(c.Ipf,{numRequiredSignatures:d,signaturesLength:n.length,signerAddresses:p});const f={};return p.forEach((e,t)=>{const r=n[t];r.every(e=>0===e)?f[e]=null:f[e]=r}),{messageBytes:t,signatures:Object.freeze(f)}}function m(e){const t=(0,l.rt)(e),n=(0,l.dU)().encode(t),i=t.staticAccounts.slice(0,t.header.numSignerAccounts),s={};for(const r of i)s[r]=null;let o;return(0,l.q0)(e)?o={blockhash:e.lifetimeConstraint.blockhash,lastValidBlockHeight:e.lifetimeConstraint.lastValidBlockHeight}:(0,l.vm)(e)&&(o={nonce:e.lifetimeConstraint.nonce,nonceAccountAddress:e.instructions[0].accounts[0].address}),Object.freeze((0,r.A)((0,r.A)({},o?{lifetimeConstraint:o}:void 0),{},{messageBytes:n,signatures:Object.freeze(s)}))}async function y(e,t){let n,s;if(await Promise.all(e.map(async e=>{const r=await(0,i.Tq)(e.publicKey),o=t.signatures[r];if(void 0===o)return s||(s=new Set),void s.add(r);if(s)return;const a=await(0,d.b_)(e.privateKey,t.messageBytes);var c,l;null!==o&&(l=o,(c=a).length===l.length&&c.every((e,t)=>
2e===l[t]))||(n||(n={}),n[r]=a)})),s&&s.size>0){const e=Object.keys(t.signatures);throw new c.tsw(c.Ngb,{expectedAddresses:e,unexpectedAddresses:[...s]})}return n?Object.freeze((0,r.A)((0,r.A)({},t),{},{signatures:Object.freeze((0,r.A)((0,r.A)({},t.signatures),n))})):t}function v(e){const t=p().encode(e);return(0,u.Ul)().decode(t)}},61307:(e,t,n)=>{"use strict";n.d(t,{D0:()=>i,Rd:()=>r});const r=new TextEncoder,i=new TextDecoder},61314:(e,t,n)=>{"use strict";n.d(t,{n:()=>r});const r={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}}},61395:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});const r={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}}},61398:(e,t,n)=>{"use strict";n.d(t,{db:()=>s,eV:()=>i});var r=n(56388);function i(e){let{dir:t,size:n=32}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"===typeof e?s(e,{dir:t,size:n}):function(e){let{dir:t,size:n=32}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===n)return e;if(e.length>n)throw new r.Fl({size:e.length,targetSize:n,type:"bytes"});const i=new Uint8Array(n);for(let r=0;r<n;r++){const s="right"===t;i[s?r:n-r-1]=e[s?r:e.length-r-1]}return i}(e,{dir:t,size:n})}function s(e){let{dir:t,size:n=32}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===n)return e;const i=e.replace("0x","");if(i.length>2*n)throw new r.Fl({size:Math.ceil(i.length/2),targetSize:n,type:"hex"});return"0x".concat(i["right"===t?"padEnd":"padStart"](2*n,"0"))}},62016:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});var r=n(5618),i=n(97811);function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"wei";return(0,i.J)(e,r.eL[t])}},62253:function(e){e.exports=function(){"use strict";function e(e){return Number.isInteger(e)&&e>=0}function t(e){this.name="ArgumentError",this.message=e}return function(n,r){if(r=r||{},"function"!==typeof n)throw new t("fetch must be a function");if("object"!==typeof r)throw new t("defaults must be an object");if(void 0!==r.retries&&!e(r.retries))throw new t("retries must be a positive integer");if(void 0!==r.retryDelay&&!e(r.retryDelay)&&"function"!==typeof r.retryDelay)throw new t("retryDelay must be a positive integer or a function returning a positive integer");if(void 0!==r.retryOn&&!Array.isArray(r.retryOn)&&"function"!==typeof r.retryOn)throw new t("retryOn property expects an array or function");var i={retries:3,retryDelay:1e3,retryOn:[]};return r=Object.assign(i,r),function(i,s){var o=r.retries,a=r.retryDelay,c=r.retryOn;if(s&&void 0!==s.retries){if(!e(s.retries))throw new t("retries must be a positive integer");o=s.retries}if(s&&void 0!==s.retryDelay){if(!e(s.retryDelay)&&"function"!==typeof s.retryDelay)throw new t("retryDelay must be a positive integer or a function returning a positive integer");a=s.retryDelay}if(s&&s.retryOn){if(!Array.isArray(s.retryOn)&&"function"!==typeof s.retryOn)throw new t("retryOn property expects an array or function");c=s.retryOn}return new Promise(function(e,t){var r=function(r){var a="undefined"!==typeof Request&&i instanceof Request?i.clone():i;n(a,s).then(function(n){if(Array.isArray(c)&&-1===c.indexOf(n.status))e(n);else if("function"===typeof c)try{return Promise.resolve(c(r,null,n)).then(function(t){t?l(r,null,n):e(n)}).catch(t)}catch(i){t(i)}else r<o?l(r,null,n):e(n)}).catch(function(e){if("function"===typeof c)try{Promise.resolve(c(r,e,null)).then(function(n){n?l(r,e,null):t(e)}).catch(function(e){t(e)})}catch(e){t(e)}else r<o?l(r,e,null):t(e)})};function l(e,t,n){var i="function"===typeof a?a(e,t,n):a;setTimeout(function(){r(++e)},i)}r(0)})}}}()},62581:(e,t)=>{"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||f}function v(){}function w(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||f}y.prototype.isReactComponent={},y.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")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var b=w.prototype=new v;b.constructor=w,g(b,y.prototype),b.isPureReactComponent=!0;var A=Array.isArray,_=Object.prototype.hasOwnProperty,x={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var i,s={},o=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)_.call(t,i)&&!E.hasOwnProperty(i)&&(s[i]=t[i]);var c=arguments.length-2;if(1===c)s.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps)void 0===s[i]&&(s[i]=c[i]);return{$$typeof:n,type:e,key:o,ref:a,props:s,_owner:x.current}}function S(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var I=/\/+/g;function T(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 C(e,t,i,s,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var c=!1;if(null===e)c=!0;else switch(a){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case n:case r:c=!0}}if(c)return o=o(c=e),e=""===s?"."+T(c,0):s,A(o)?(i="",null!=e&&(i=e.replace(I,"$&/")+"/"),C(o,t,i,"",function(e){return e})):null!=o&&(S(o)&&(o=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,i+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+e)),t.push(o)),1;if(c=0,s=""===s?".":s+":",A(e))for(var l=0;l<e.length;l++){var u=s+T(a=e[l],l);c+=C(a,t,i,u,o)}else if(u=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"===typeof u)for(e=u.call(e),l=0;!(a=e.next()).done;)c+=C(a=a.value,t,i,u=s+T(a,l++),o);else if("object"===a)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 c}function P(e,t,n){if(null==e)return e;var r=[],i=0;return C(e,r,"","",function(e){return t.call(n,e,i++)}),r}function O(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 N={current:null},R={transition:null},M={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:R,ReactCurrentOwner:x};function U(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=i,t.Profiler=o,t.PureComponent=w,t.StrictMode=s,t.Suspense=u,t.__SECRET_INT
2ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,t.act=U,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=g({},e.props),s=e.key,o=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,a=x.current),void 0!==t.key&&(s=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in t)_.call(t,l)&&!E.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==c?c[l]:t[l])}var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:n,type:e.type,key:s,ref:o,props:i,_owner:a}},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=k,t.createFactory=function(e){var t=k.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=S,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=R.transition;R.transition={};try{e()}finally{R.transition=t}},t.unstable_act=U,t.useCallback=function(e,t){return N.current.useCallback(e,t)},t.useContext=function(e){return N.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return N.current.useDeferredValue(e)},t.useEffect=function(e,t){return N.current.useEffect(e,t)},t.useId=function(){return N.current.useId()},t.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return N.current.useMemo(e,t)},t.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},t.useRef=function(e){return N.current.useRef(e)},t.useState=function(e){return N.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return N.current.useTransition()},t.version="18.3.1"},63015:(e,t,n)=>{"use strict";n.d(t,{IQ:()=>d,ME:()=>u,Nx:()=>l,Sl:()=>a,uU:()=>c});var r=n(14393),i=n(1490),s=n(65747),o=n(91638);function a(e,t){let{size:n}=t;if((0,i.E)(e)>n)throw new r.u({givenSize:(0,i.E)(e),maxSize:n})}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{signed:n}=t;t.size&&a(e,{size:t.size});const r=BigInt(e);if(!n)return r;const i=(e.length-2)/2;return r<=(1n<<8n*BigInt(i)-1n)-1n?r:r-BigInt("0x".concat("f".padStart(2*i,"f")))-1n}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;if(t.size&&(a(n,{size:t.size}),n=(0,s.B)(n)),"0x00"===(0,s.B)(n))return!1;if("0x01"===(0,s.B)(n))return!0;throw new r.H2(n)}function u(e){return Number(c(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,o.aT)(e);return t.size&&(a(n,{size:t.size}),n=(0,s.B)(n,{dir:"right"})),(new TextDecoder).decode(n)}},63679:(e,t,n)=>{"use strict";n.d(t,{$:()=>Er});var r=n(42483),i=n(15208),s=n(76416),o=n(67885),a=n(65747),c=n(652),l=n(51659),u=n(82281);function d(e){var t,n,r,i,s,o;if(!(e instanceof l.C))return!1;const a=e.walk(e=>e instanceof u.M);return a instanceof u.M&&("HttpError"===(null===(t=a.data)||void 0===t?void 0:t.errorName)||("ResolverError"===(null===(n=a.data)||void 0===n?void 0:n.errorName)||("ResolverNotContract"===(null===(r=a.data)||void 0===r?void 0:r.errorName)||("ResolverNotFound"===(null===(i=a.data)||void 0===i?void 0:i.errorName)||("ReverseAddressMismatch"===(null===(s=a.data)||void 0===s?void 0:s.errorName)||"UnsupportedResolverProfile"===(null===(o=a.data)||void 0===o?void 0:o.errorName))))))}var h=n(4564),p=n(73183),f=n(91638),g=n(59892),m=n(6806);function y(e){if(66!==e.length)return null;if(0!==e.indexOf("["))return null;if(65!==e.indexOf("]"))return null;const t="0x".concat(e.slice(1,65));return(0,m.q)(t)?t:null}function v(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,c.My)(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const e=y(n[r]),i=e?(0,f.ZJ)(e):(0,g.S)((0,f.Af)(n[r]),"bytes");t=(0,g.S)((0,p.xW)([t,i]),"bytes")}return(0,c.My)(t)}function w(e){return"[".concat(e.slice(2),"]")}function b(e){const t=new Uint8Array(32).fill(0);return e?y(e)||(0,g.S)((0,f.Af)(e)):(0,c.My)(t)}function A(e){const t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);const n=new Uint8Array((0,f.Af)(t).byteLength+2);let r=0;const i=t.split(".");for(let s=0;s<i.length;s++){let e=(0,f.Af)(i[s]);e.byteLength>255&&(e=(0,f.Af)(w(b(i[s])))),n[r]=e.length,n.set(e,r+1),r+=e.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}var _=n(44288),x=n(93520);var E=n(87999);class k extends l.C{constructor(e){let{data:t}=e;super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","","Provided data: ".concat(JSON.stringify(t))],name:"EnsAvatarInvalidMetadataError"})}}class S extends l.C{constructor(e){let{reason:t}=e;
2super("ENS NFT avatar URI is invalid. ".concat(t),{name:"EnsAvatarInvalidNftUriError"})}}class I extends l.C{constructor(e){let{uri:t}=e;super('Unable to resolve ENS avatar URI "'.concat(t,'". The URI may be malformed, invalid, or does not respond with a valid image.'),{name:"EnsAvatarUriResolutionError"})}}class T extends l.C{constructor(e){let{namespace:t}=e;super('ENS NFT avatar namespace "'.concat(t,'" is not supported. Must be "erc721" or "erc1155".'),{name:"EnsAvatarUnsupportedNamespaceError"})}}l.C;const C=(0,E.A)(/(https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(\/)?(ipfs\/|ipns\/)?([\w\-.]+)(\/.*)?/,{protocol:1,root:2,subpath:3,target:4,subtarget:5}),P=(0,E.A)(/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/([\w\-.]+))?(\/.*)?$/,{target:3,subtarget:4}),O=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,N=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function R(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function M(e){let{uri:t,gatewayUrls:n}=e;const r=O.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const i=R(null===n||void 0===n?void 0:n.ipfs,"https://ipfs.io"),s=R(null===n||void 0===n?void 0:n.arweave,"https://arweave.net"),o=t.match(C),{protocol:a,subpath:c,target:l,subtarget:u=""}=(null===o||void 0===o?void 0:o.groups)||{},d="ipns:/"===a||"ipns/"===c,h="ipfs:/"===a||"ipfs/"===c||P.test(t);if(t.startsWith("http")&&!d&&!h){let e=t;return null!==n&&void 0!==n&&n.arweave&&(e=t.replace(/https:\/\/arweave.net/g,null===n||void 0===n?void 0:n.arweave)),{uri:e,isOnChain:!1,isEncoded:!1}}if((d||h)&&l)return{uri:"".concat(i,"/").concat(d?"ipns":"ipfs","/").concat(l).concat(u),isOnChain:!1,isEncoded:!1};if("ar:/"===a&&l)return{uri:"".concat(s,"/").concat(l).concat(u||""),isOnChain:!1,isEncoded:!1};let p=t.replace(N,"");if(p.startsWith("<svg")&&(p="data:image/svg+xml;base64,".concat(btoa(p))),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new I({uri:t})}function U(e){if("object"!==typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new k({data:e});return e.image||e.image_url||e.image_data}async function L(e){let{gatewayUrls:t,uri:n}=e;const{uri:r,isOnChain:i}=M({uri:n,gatewayUrls:t});if(i)return r;const s=await async function(e){try{const t=await fetch(e,{method:"HEAD"});if(200===t.status){const e=t.headers.get("content-type");return null===e||void 0===e?void 0:e.startsWith("image/")}return!1}catch(t){return("object"!==typeof t||"undefined"===typeof t.response)&&!!Object.hasOwn(globalThis,"Image")&&new Promise(t=>{const n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=e})}}(r);if(s)return r;throw new I({uri:n})}async function B(e,t){let{gatewayUrls:n,record:r}=t;return/eip155:/i.test(r)?async function(e,t){let{gatewayUrls:n,record:r}=t;const i=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,i]=t.split("/"),[s,o]=n.split(":"),[a,c]=r.split(":");if(!s||"eip155"!==s.toLowerCase())throw new S({reason:"Only EIP-155 supported"});if(!o)throw new S({reason:"Chain ID not found"});if(!c)throw new S({reason:"Contract address not found"});if(!i)throw new S({reason:"Token ID not found"});if(!a)throw new S({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}(r),s=await async function(e,t){let{nft:n}=t;if("erc721"===n.namespace)return(0,x.J)(e,{address:n.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(n.tokenID)]});if("erc1155"===n.namespace)return(0,x.J)(e,{address:n.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(n.tokenID)]});throw new T({namespace:n.namespace})}(e,{nft:i}),{uri:o,isOnChain:a,isEncoded:c}=M({uri:s,gatewayUrls:n});if(a&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const e=c?atob(o.replace("data:application/json;base64,","")):o;return L({uri:U(JSON.parse(e)),gatewayUrls:n})}let l=i.tokenID;"erc1155"===i.namespace&&(l=l.replace("0x","").padStart(64,"0"));return async function(e){let{gatewayUrls:t,uri:n}=e;try{const e=await fetch(n).then(e=>e.json());return await L({gatewayUrls:t,uri:U(e)})}catch(r){throw new I({uri:n})}}({gatewayUrls:n,uri:o.replace(/(?:0x)?{id}/,l)})}(e,{gatewayUrls:n,record:r}):L({uri:r,gatewayUrls:n})}async function D(e,t){const{blockNumber:n,blockTag:a,key:l,name:u,gatewayUrls:p,strict:f}=t,{chain:g}=e,m=(()=>
2{if(t.universalResolverAddress)return t.universalResolverAddress;if(!g)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:n,chain:g,contract:"ensUniversalResolver"})})(),y=null===g||void 0===g?void 0:g.ensTlds;if(y&&!y.some(e=>u.endsWith(e)))return null;try{const t={address:m,abi:r.Ag,args:[(0,c.nj)(A(u)),(0,s.p)({abi:r.SJ,functionName:"text",args:[v(u),l]}),null!==p&&void 0!==p?p:[h.J]],functionName:"resolveWithGateways",blockNumber:n,blockTag:a},o=(0,_.T)(e,x.J,"readContract"),d=await o(t);if("0x"===d[0])return null;const f=(0,i.e)({abi:r.SJ,functionName:"text",data:d[0]});return""===f?null:f}catch(w){if(f)throw w;if(d(w))return null;throw w}}var j=n(36122),F=n(24107),z=n(15882),W=n(25741),q=n(8448),H=n(99705),V=n(56523),G=n(45226);const K=["account","blockNumber","blockTag","blobs","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","to","value"];async function J(e,t){const{account:n=e.account,blockNumber:r,blockTag:i="latest",blobs:s,data:o,gas:a,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,to:p,value:f}=t,g=(0,z.A)(t,K),m=n?(0,W.J)(n):void 0;try{var y;(0,G.c)(t);const n=("bigint"===typeof r?(0,c.cK)(r):void 0)||i,v=null===(y=e.chain)||void 0===y||null===(y=y.formatters)||void 0===y||null===(y=y.transactionRequest)||void 0===y?void 0:y.format,w=(v||V.Bv)((0,F.A)((0,F.A)({},(0,H.o)(g,{format:v})),{},{account:m,blobs:s,data:o,gas:a,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:h,to:p,value:f}),"createAccessList"),b=await e.request({method:"eth_createAccessList",params:[w,n]});return{accessList:b.accessList,gasUsed:BigInt(b.gasUsed)}}catch(v){throw(0,q.d)(v,(0,F.A)((0,F.A)({},t),{},{account:m,chain:e.chain}))}}function Z(e,t){var n,r;let{method:i}=t;const s={};return"fallback"===e.transport.type&&(null===(n=(r=e.transport).onResponse)||void 0===n||n.call(r,e=>{let{method:t,response:n,status:r,transport:o}=e;"success"===r&&i===t&&(s[n]=o.request)})),t=>s[t]||e.request}var Q=n(18656);class Y extends l.C{constructor(e){super('Filter type "'.concat(e,'" is not supported.'),{name:"FilterTypeNotSupportedError"})}}var X=n(47573),$=n(70759),ee=n(68419),te=n(44270);const ne="/docs/contract/encodeEventTopics";function re(e){const{abi:t,eventName:n,args:r}=e;let i=t[0];if(n){const e=(0,te.iY)({abi:t,name:n});if(!e)throw new Q.M_(n,{docsPath:ne});i=e}if("event"!==i.type)throw new Q.M_(void 0,{docsPath:ne});const s=(0,ee.B)(i),o=(0,X.h)(s);let a=[];if(r&&"inputs"in i){var c,l;const e=null===(c=i.inputs)||void 0===c?void 0:c.filter(e=>"indexed"in e&&e.indexed),t=Array.isArray(r)?r:Object.values(r).length>0&&null!==(l=null===e||void 0===e?void 0:e.map(e=>r[e.name]))&&void 0!==l?l:[];var u;if(t.length>0)a=null!==(u=null===e||void 0===e?void 0:e.map((e,n)=>Array.isArray(t[n])?t[n].map((r,i)=>ie({param:e,value:t[n][i]})):"undefined"!==typeof t[n]&&null!==t[n]?ie({param:e,value:t[n]}):null))&&void 0!==u?u:[]}return[o,...a]}function ie(e){let{param:t,value:n}=e;if("string"===t.type||"bytes"===t.type)return(0,g.S)((0,f.ZJ)(n));if("tuple"===t.type||t.type.match(/^(.*)\[(\d+)?\]$/))throw new Y(t.type);return(0,$.h)([t],[n])}async function se(e,t){const{address:n,abi:r,args:i,eventName:s,fromBlock:o,strict:a,toBlock:l}=t,u=Z(e,{method:"eth_newFilter"}),d=s?re({abi:r,args:i,eventName:s}):void 0,h=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:"bigint"===typeof o?(0,c.cK)(o):o,toBlock:"bigint"===typeof l?(0,c.cK)(l):l,topics:d}]});return{abi:r,args:i,eventName:s,id:h,request:u(h),strict:Boolean(a),type:"event"}}async function oe(e){let{address:t,args:n,event:r,events:i,fromBlock:s,strict:o,toBlock:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const l=null!==i&&void 0!==i?i:r?[r]:void 0,u=Z(e,{method:"eth_newFilter"});let d=[];if(l){const e=l.flatMap(e=>re({abi:[e],eventName:e.name,args:n}));d=[e],r&&(d=d[0])}const h=await e.request({method:"eth_newFilter",params:[(0,F.A)({address:t,fromBlock:"bigint"===typeof s?(0,c.cK)(s):s,toBlock:"bigint"===typeof a?(0,c.cK)(a):a},d.length?{topics:d}:{})]});return{abi:l,args:n,eventName:r?r.name:void 0,fromBlock:s,id:h,request:u(h),strict:Boolean(o),toBlock:a,type:"event"}}async function ae(e){const t=Z(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}var ce=n(92674),le=n(45334);const ue=["abi","address","args","functionName","dataSuffix"];var de=n(65057),he=n(44154),pe=n(52431);var fe=n(11383),ge=n(84241),me=n(63015);var ye=n(97562),ve=n(56769),we=n(93401),be=n(16046),Ae=n(1490),_e=n(90934);const xe="/docs/contract/decodeEventLog";function Ee(e){const{abi:t,data:n,strict:r,topics:i}=e,s=null===r||void 0===r||r,[o,...a]=i;if(!o)throw new Q._z({docsPath:xe});const c=t.find(e=>"event"===e.type&&o===(0,X.h)((0,ee.B)(e)));if(!c||!("name"in c)||"event"!==c.type)throw new Q.kE(o,{docsPath:xe});const{name:l,inputs:u}=c,d=null===u||void 0===u?void 0:u.some(e=>!("name"in e&&e.name)),h=d?[]:{},p=u.map((e,t)=>[e,t]).filter(e=>{let[t]=e;return"indexed"in t&&t.indexed});for(let y=0;y<p.length;y++){const[e,t]=p[y],n=a[y];if(!n)throw new Q.l3({abiItem:c,param:e});h[d?t:e.name||t]=ke({param:e,value:n})}const f=u.filter(e=>
2!("indexed"in e&&e.indexed));if(f.length>0)if(n&&"0x"!==n)try{const e=(0,_e.n)(f,n);if(e)if(d)for(let t=0;t<u.length;t++){var g;h[t]=null!==(g=h[t])&&void 0!==g?g:e.shift()}else for(let t=0;t<f.length;t++)h[f[t].name]=e[t]}catch(m){if(s){if(m instanceof Q.Iy||m instanceof be.SK)throw new Q.fo({abiItem:c,data:n,params:f,size:(0,Ae.E)(n)});throw m}}else if(s)throw new Q.fo({abiItem:c,data:"0x",params:f,size:0});return{eventName:l,args:Object.values(h).length>0?h:void 0}}function ke(e){let{param:t,value:n}=e;if("string"===t.type||"bytes"===t.type||"tuple"===t.type||t.type.match(/^(.*)\[(\d+)?\]$/))return n;return((0,_e.n)([t],n)||[])[0]}function Se(e){const{abi:t,args:n,logs:r,strict:i=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(e=>{try{const r=t.find(t=>"event"===t.type&&e.topics[0]===(0,X.h)(t));if(!r)return null;const o=Ee((0,F.A)((0,F.A)({},e),{},{abi:[r],strict:i}));return s&&!s.includes(o.eventName)?null:function(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function i(e,t,n){try{return"address"===e.type?(0,we.h)(t,n):"string"===e.type||"bytes"===e.type?(0,g.S)((0,f.ZJ)(t))===n:t===n}catch(r){return!1}}if(Array.isArray(t)&&Array.isArray(r))return r.every((e,r)=>{if(null===e||void 0===e)return!0;const s=n[r];if(!s)return!1;return(Array.isArray(e)?e:[e]).some(e=>i(s,e,t[r]))});return"object"===typeof t&&!Array.isArray(t)&&"object"===typeof r&&!Array.isArray(r)&&Object.entries(r).every(e=>{let[r,s]=e;if(null===s||void 0===s)return!0;const o=n.find(e=>e.name===r);if(!o)return!1;return(Array.isArray(s)?s:[s]).some(e=>i(o,e,t[r]))})}({args:o.args,inputs:r.inputs,matchArgs:n})?(0,F.A)((0,F.A)({},o),e):null}catch(o){let t,n;if(o instanceof Q.kE)return null;if(o instanceof Q.fo||o instanceof Q.l3){var r;if(i)return null;t=o.abiItem.name,n=null===(r=o.abiItem.inputs)||void 0===r?void 0:r.some(e=>!("name"in e&&e.name))}return(0,F.A)((0,F.A)({},e),{},{args:n?[]:{},eventName:t})}}).filter(Boolean)}var Ie=n(71226);async function Te(e){let{address:t,blockHash:n,fromBlock:r,toBlock:i,event:s,events:o,args:a,strict:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const u=null!==l&&void 0!==l&&l,d=null!==o&&void 0!==o?o:s?[s]:void 0;let h,p=[];if(d){const e=d.flatMap(e=>re({abi:[e],eventName:e.name,args:o?void 0:a}));p=[e],s&&(p=p[0])}h=n?await e.request({method:"eth_getLogs",params:[{address:t,topics:p,blockHash:n}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:p,fromBlock:"bigint"===typeof r?(0,c.cK)(r):r,toBlock:"bigint"===typeof i?(0,c.cK)(i):i}]});const f=h.map(e=>(0,Ie.e)(e));return d?Se({abi:d,args:a,logs:f,strict:u}):f}async function Ce(e,t){const{abi:n,address:r,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:c,strict:l}=t,u=o?(0,te.iY)({abi:n,name:o}):void 0,d=u?void 0:n.filter(e=>"event"===e.type);return(0,_.T)(e,Te,"getLogs")({address:r,args:i,blockHash:s,event:u,events:d,fromBlock:a,toBlock:c,strict:l})}class Pe extends l.C{constructor(e){let{address:t}=e;super('No EIP-712 domain found on contract "'.concat(t,'".'),{metaMessages:["Ensure that:",'- The contract is deployed at the address "'.concat(t,'".'),"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}const Oe=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function Ne(e,t){let{blockCount:n,blockNumber:r,blockTag:i="latest",rewardPercentiles:s}=t;const o="bigint"===typeof r?(0,c.cK)(r):void 0;return function(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:null===(t=e.reward)||void 0===t?void 0:t.map(e=>e.map(e=>BigInt(e)))}}(await e.request({method:"eth_feeHistory",params:[(0,c.cK)(n),o||i,s]},{dedupe:Boolean(o)}))}async function Re(e,t){let{filter:n}=t;const r="strict"in n&&n.strict,i=await n.request({method:"eth_getFilterChanges",params:[n.id]});if("string"===typeof i[0])return i;const s=i.map(e=>(0,Ie.e)(e));return"abi"in n&&n.abi?Se({abi:n.abi,logs:s,strict:r}):s}var Me=n(60086);async function Ue(e,t){let{address:n,blockNumber:r,blockTag:i,storageKeys:s}=t;const o=null!==i&&void 0!==i?i:"latest",a=void 0!==r?(0,c.cK)(r):void 0;return function(e){return(0,F.A)((0,F.A)({},e),{},{balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?(0,me.ME)(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map(e=>(0,F.A)((0,F.A)({},e),{},{value:BigInt(e.value)}))):void 0});var t}(await e.request({method:"eth_getProof",params:[n,s,a||o]}))}var Le=n(27610);var Be=n(66719),De=n(24428),je=n(21165);var Fe=n(86658),ze=n(14764),We=n(66320),qe=n(29213),He=n(7919);async function Ve(e,t){var n;const{blockNumber:r,blockTag:o=(null!==(n=e.experimental_blockTag)&&void 0!==n?n:"latest"),blocks:a,returnFullTransactions:l,traceTransfers:d,validation:h}=t;
2try{const t=[];for(const e of a){const n=e.blockOverrides?Fe.J(e.blockOverrides):void 0,r=e.calls.map(e=>{var t;const n=e,r=n.account?(0,W.J)(n.account):void 0,i=n.abi?(0,s.p)(n):n.data,o=(0,F.A)((0,F.A)({},n),{},{account:r,data:n.dataSuffix?(0,p.xW)([i||"0x",n.dataSuffix]):i,from:null!==(t=n.from)&&void 0!==t?t:null===r||void 0===r?void 0:r.address});return(0,G.c)(o),(0,V.Bv)(o)}),i=e.stateOverrides?(0,He.yH)(e.stateOverrides):void 0;t.push({blockOverrides:n,calls:r,stateOverrides:i})}const n=("bigint"===typeof r?(0,c.cK)(r):void 0)||o;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:l,traceTransfers:d,validation:h},n]})).map((e,t)=>(0,F.A)((0,F.A)({},(0,qe.$)(e)),{},{calls:e.calls.map((e,n)=>{var r,s,o;const{abi:c,args:l,functionName:d,to:h}=a[t].calls[n],p=null!==(r=null===(s=e.error)||void 0===s?void 0:s.data)&&void 0!==r?r:e.returnData,f=BigInt(e.gasUsed),g=null===(o=e.logs)||void 0===o?void 0:o.map(e=>(0,Ie.e)(e)),m="0x1"===e.status?"success":"failure",y=c&&"success"===m&&"0x"!==p?(0,i.e)({abi:c,data:p,functionName:d}):null,v=(t=>{if("success"===m)return;let n;return"0x"===(null===(t=e.error)||void 0===t?void 0:t.data)?n=new Q.O:e.error&&(n=new u.$S(e.error)),n?(0,ce.j)(n,{abi:null!==c&&void 0!==c?c:[],address:null!==h&&void 0!==h?h:"0x",args:l,functionName:null!==d&&void 0!==d?d:"<unknown>"}):void 0})();return(0,F.A)({data:p,gasUsed:f,logs:g,status:m},"success"===m?{result:y}:{error:v})})}))}catch(f){const e=f,t=(0,We.l)(e,{});if(t instanceof ze.RM)throw e;throw t}}var Ge=n(24419),Ke=n(71488),Je=n(23328),Ze=n(19582);function Qe(e){let t;if("string"===typeof e)t=(0,Ze.uT)(e);else{const n=(0,Je.e)(e),r=e.length;for(let i=0;i<r;i++){const r=e[i];if(!(0,Ke.WL)(r)){t=(0,Ze.uT)(r,n);break}}}if(!t)throw new Ge.xo({signature:e});return t}var Ye=n(23096),Xe=n(1207),$e=n(75008),et=n(38203);function tt(e,t){if(ht(e)>t)throw new bt({givenSize:ht(e),maxSize:t})}const nt={zero:48,nine:57,A:65,F:70,a:97,f:102};function rt(e){return e>=nt.zero&&e<=nt.nine?e-nt.zero:e>=nt.A&&e<=nt.F?e-(nt.A-10):e>=nt.a&&e<=nt.f?e-(nt.a-10):void 0}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{dir:n="left"}=t;let r=e,i=0;for(let s=0;s<r.length-1&&"0"===r["left"===n?s:r.length-s-1].toString();s++)i++;return r="left"===n?r.slice(i):r.slice(0,r.length-i),r}var st=n(87247),ot=n(92146);const at=new TextDecoder,ct=new TextEncoder;function lt(e){return e instanceof Uint8Array?e:"string"===typeof e?ut(e):function(e){return e instanceof Uint8Array?e:new Uint8Array(e)}(e)}function ut(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n}=t;let r=e;n&&(st.Sl(e,n),r=et.M7(e,n));let i=r.slice(2);i.length%2&&(i="0".concat(i));const s=i.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const e=rt(i.charCodeAt(c++)),t=rt(i.charCodeAt(c++));if(void 0===e||void 0===t)throw new Xe.C('Invalid byte sequence ("'.concat(i[c-2]).concat(i[c-1],'" in "').concat(i,'").'));o[a]=16*e+t}return o}function dt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n}=t,r=ct.encode(e);return"number"===typeof n?(tt(r,n),function(e,t){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{dir:n,size:r=32}=t;if(0===r)return e;if(e.length>r)throw new _t({size:e.length,targetSize:r,type:"Bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const t="right"===n;i[t?s:r-s-1]=e[t?s:e.length-s-1]}return i}(e,{dir:"right",size:t})}(r,n)):r}function ht(e){return e.length}function pt(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{strict:i}=r;!function(e,t){if("number"===typeof t&&t>0&&t>ht(e)-1)throw new At({offset:t,position:"start",size:ht(e)})}(e,t);const s=e.slice(t,n);return i&&function(e,t,n){if("number"===typeof t&&"number"===typeof n&&ht(e)!==n-t)throw new At({offset:n,position:"end",size:ht(e)})}(s,t,n),s}function ft(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n}=t;"undefined"!==typeof n&&tt(e,n);const r=et.uK(e,t);return et.Dg(r,t)}function gt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n}=t;let r=e;if("undefined"!==typeof n&&(tt(r,n),r=vt(r)),r.length>1||r[0]>1)throw new wt(r);return Boolean(r[0])}function mt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n}=t;"undefined"!==typeof n&&tt(e,n);const r=et.uK(e,t);return et.Ro(r,t)}function yt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n}=t;let r=e;return"undefined"!==typeof n&&(tt(r,n),r=it(r,{dir:"right"})),at.decode(r)}function vt(e){return it(e,{dir:"left"})}class wt extends Xe.C{constructor(e){super("Bytes value `".concat(e,"` is not a valid boolean."),{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}Xe.C;class bt extends Xe.C{constructor(e){let{givenSize:t,maxSize:n}=e;super("Size cannot exceed `".concat(n,"` bytes. Given size: `").concat(t,"` bytes.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class At extends Xe.C{constructor(e){let{offset:t,position:n,size:r}=e;super("Slice ".concat("start"===n?"starting":"ending"," at offset `").
2concat(t,"` is out-of-bounds (size: `").concat(r,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}class _t extends Xe.C{constructor(e){let{size:t,targetSize:n,type:r}=e;super("".concat(r.charAt(0).toUpperCase()).concat(r.slice(1).toLowerCase()," size (`").concat(t,"`) exceeds padding size (`").concat(n,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}function xt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{as:n=("string"===typeof e?"Hex":"Bytes")}=t,r=(0,$e.lY)(lt(e));return"Bytes"===n?r:et.uK(r)}class Et extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const kt={checksum:new Et(8192)},St=kt.checksum;const It=/^0x[a-fA-F0-9]{40}$/;function Tt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{strict:n=!0}=t;if(!It.test(e))throw new Ot({address:e,cause:new Nt});if(n){if(e.toLowerCase()===e)return;if(Ct(e)!==e)throw new Ot({address:e,cause:new Rt})}}function Ct(e){if(St.has(e))return St.get(e);Tt(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=xt(dt(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(15&n[s>>1])>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const i="0x".concat(r.join(""));return St.set(e,i),i}function Pt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{strict:n=!0}=null!==t&&void 0!==t?t:{};try{return Tt(e,{strict:n}),!0}catch(r){return!1}}class Ot extends Xe.C{constructor(e){let{address:t,cause:n}=e;super('Address "'.concat(t,'" is invalid.'),{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class Nt extends Xe.C{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Rt extends Xe.C{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function Mt(e){let t=!0,n="",r=0,i="",s=!1;for(let o=0;o<e.length;o++){const a=e[o];if(["(",")",","].includes(a)&&(t=!0),"("===a&&r++,")"===a&&r--,t)if(0!==r)" "!==a?(i+=a,n+=a):","!==e[o-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===a&&["event","function","error",""].includes(i))i="";else if(i+=a,")"===a){s=!0;break}}if(!s)throw new Xe.C("Unable to normalize signature.");return i}function Ut(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Pt(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every((t,n)=>Ut(Object.values(e)[n],t)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every(e=>Ut(e,(0,F.A)((0,F.A)({},t),{},{type:r.replace(/(\[[0-9]{0,}\])$/,"")}))))}}function Lt(e,t,n){for(const r in e){const i=e[r],s=t[r];if("tuple"===i.type&&"tuple"===s.type&&"components"in i&&"components"in s)return Lt(i.components,s.components,n[r]);const o=[i.type,s.type];if((()=>!(!o.includes("address")||!o.includes("bytes20"))||(o.includes("address")&&o.includes("string")||!(!o.includes("address")||!o.includes("bytes")))&&Pt(n[r],{strict:!1}))())return o}}function Bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{prepare:n=!0}=t,r=Array.isArray(e)||"string"===typeof e?Qe(e):e;return(0,F.A)((0,F.A)({},r),n?{hash:Ft(r)}:{})}function Dt(e,t,n){const{args:r=[],prepare:i=!0}=null!==n&&void 0!==n?n:{},s=et.tf(t,{strict:!1}),o=e.filter(e=>s?"function"===e.type||"error"===e.type?jt(e)===et.di(t,0,4):"event"===e.type&&Ft(e)===t:"name"in e&&e.name===t);if(0===o.length)throw new Wt({name:t});if(1===o.length)return(0,F.A)((0,F.A)({},o[0]),i?{hash:Ft(o[0])}:{});let a;for(const l of o){if(!("inputs"in l))continue;if(!r||0===r.length){if(!l.inputs||0===l.inputs.length)return(0,F.A)((0,F.A)({},l),i?{hash:Ft(l)}:{});continue}if(!l.inputs)continue;if(0===l.inputs.length)continue;
2if(l.inputs.length!==r.length)continue;const e=r.every((e,t)=>{const n="inputs"in l&&l.inputs[t];return!!n&&Ut(e,n)});if(e){if(a&&"inputs"in a&&a.inputs){const e=Lt(l.inputs,a.inputs,r);if(e)throw new zt({abiItem:l,type:e[0]},{abiItem:a,type:e[1]})}a=l}}const c=(()=>{if(a)return a;const[e,...t]=o;return(0,F.A)((0,F.A)({},e),{},{overloads:t})})();if(!c)throw new Wt({name:t});return(0,F.A)((0,F.A)({},c),i?{hash:Ft(c)}:{})}function jt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=(()=>{if(Array.isArray(t[0])){const[e,n]=t;return Dt(e,n)}return t[0]})();return et.di(Ft(r),0,4)}function Ft(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=(()=>{if(Array.isArray(t[0])){const[e,n]=t;return Dt(e,n)}return t[0]})();return"string"!==typeof r&&"hash"in r&&r.hash?r.hash:xt(et.sH(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=(()=>{if(Array.isArray(t[0])){const[e,n]=t;return Dt(e,n)}return t[0]})();return Mt("string"===typeof r?r:Ye.B(r))}(r)))}class zt extends Xe.C{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:["`".concat(e.type,"` in `").concat(Mt(Ye.B(e.abiItem)),"`, and"),"`".concat(t.type,"` in `").concat(Mt(Ye.B(t.abiItem)),"`"),"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class Wt extends Xe.C{constructor(e){let{name:t,data:n,type:r="item"}=e;const i=t?' with name "'.concat(t,'"'):n?' with data "'.concat(n,'"'):"";super("ABI ".concat(r).concat(i," not found.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}Xe.C;var qt=n(12005);function Ht(e){const t=[];if("string"===typeof e){const n=(0,Ze.NV)(e),r=n.length;for(let e=0;e<r;e++)t.push((0,Ze.Pj)(n[e],{modifiers:Ke.Dv}))}else{const n=(0,Je.e)(e),r=e.length;for(let i=0;i<r;i++){const r=e[i];if((0,Ke.WL)(r))continue;const s=(0,Ze.NV)(r),o=s.length;for(let e=0;e<o;e++)t.push((0,Ze.Pj)(s[e],{modifiers:Ke.Dv,structs:n}))}}if(0===t.length)throw new qt.A9({params:e});return t}var Vt=n(9670);const Gt=/^(.*)\[([0-9]*)\]$/,Kt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Jt=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Zt=2n**256n-1n;function Qt(e,t,n){const{checksumAddress:r,staticPosition:i}=n,s=tn(t.type);if(s){const[n,o]=s;return function(e,t,n){const{checksumAddress:r,length:i,staticPosition:s}=n;if(!i){const n=s+mt(e.readBytes(Xt)),i=n+Yt;e.setPosition(n);const o=mt(e.readBytes(Yt)),a=nn(t);let c=0;const l=[];for(let s=0;s<o;++s){e.setPosition(i+(a?32*s:c));const[n,o]=Qt(e,t,{checksumAddress:r,staticPosition:i});c+=o,l.push(n)}return e.setPosition(s+32),[l,32]}if(nn(t)){const n=s+mt(e.readBytes(Xt)),o=[];for(let s=0;s<i;++s){e.setPosition(n+32*s);const[i]=Qt(e,t,{checksumAddress:r,staticPosition:n});o.push(i)}return e.setPosition(s+32),[o,32]}let o=0;const a=[];for(let c=0;c<i;++c){const[n,i]=Qt(e,t,{checksumAddress:r,staticPosition:s+o});o+=i,a.push(n)}return[a,o]}(e,(0,F.A)((0,F.A)({},t),{},{type:o}),{checksumAddress:r,length:n,staticPosition:i})}if("tuple"===t.type)return function(e,t,n){const{checksumAddress:r,staticPosition:i}=n,s=0===t.components.length||t.components.some(e=>{let{name:t}=e;return!t}),o=s?[]:{};let a=0;if(nn(t)){const n=i+mt(e.readBytes(Xt));for(let i=0;i<t.components.length;++i){const c=t.components[i];e.setPosition(n+a);const[l,u]=Qt(e,c,{checksumAddress:r,staticPosition:n});a+=u,o[s?i:null===c||void 0===c?void 0:c.name]=l}return e.setPosition(i+32),[o,32]}for(let c=0;c<t.components.length;++c){const n=t.components[c],[l,u]=Qt(e,n,{checksumAddress:r,staticPosition:i});o[s?c:null===n||void 0===n?void 0:n.name]=l,a+=u}return[o,a]}(e,t,{checksumAddress:r,staticPosition:i});if("address"===t.type)return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{checksum:n=!1}=t,r=e.readBytes(32),i=e=>n?Ct(e):e;return[i(et.uK(pt(r,-20))),32]}(e,{checksum:r});if("bool"===t.type)return function(e){return[gt(e.readBytes(32),{size:32}),32]}(e);if(t.type.startsWith("bytes"))return function(e,t,n){let{staticPosition:r}=n;const[i,s]=t.type.split("bytes");if(!s){const t=mt(e.readBytes(32));e.setPosition(r+t);const n=mt(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];const i=e.readBytes(n);return e.setPosition(r+32),[et.uK(i),32]}const o=et.uK(e.readBytes(Number.parseInt(s,10),32));return[o,32]}(e,t,{staticPosition:i});if(t.type.startsWith("uint")||t.type.startsWith("int"))return function(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),i=e.readBytes(32);return[r>48?ft(i,{signed:n}):mt(i,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,t){let{staticPosition:n}=t;const r=mt(e.readBytes(32)),i=n+r;e.setPosition(i);const s=mt(e.readBytes(32));if(0===s)return e.setPosition(n+32),["",32];const o=e.readBytes(s,32),a=yt(vt(o));return e.setPosition(n+32),[a,32]}(e,{staticPosition:i});throw new vn(t.type)}const Yt=32,Xt=32;function $t(e){let{checksumAddress:t=!1,parameter:n,value:r}=e;
2const i=n,s=tn(i.type);if(s){const[e,n]=s;return function(e,t){const{checksumAddress:n,length:r,parameter:i}=t,s=null===r;if(!Array.isArray(e))throw new yn(e);if(!s&&e.length!==r)throw new fn({expectedLength:r,givenLength:e.length,type:"".concat(i.type,"[").concat(r,"]")});let o=!1;const a=[];for(let c=0;c<e.length;c++){const t=$t({checksumAddress:n,parameter:i,value:e[c]});t.dynamic&&(o=!0),a.push(t)}if(s||o){const e=en(a);if(s){const t=et.oB(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?et.xW(t,e):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:et.xW(...a.map(e=>{let{encoded:t}=e;return t}))}}(r,{checksumAddress:t,length:e,parameter:(0,F.A)((0,F.A)({},i),{},{type:n})})}if("tuple"===i.type)return function(e,t){const{checksumAddress:n,parameter:r}=t;let i=!1;const s=[];for(let o=0;o<r.components.length;o++){const t=r.components[o],a=$t({checksumAddress:n,parameter:t,value:e[Array.isArray(e)?o:t.name]});s.push(a),a.dynamic&&(i=!0)}return{dynamic:i,encoded:i?en(s):et.xW(...s.map(e=>{let{encoded:t}=e;return t}))}}(r,{checksumAddress:t,parameter:i});if("address"===i.type)return function(e,t){const{checksum:n=!1}=t;return Tt(e,{strict:n}),{dynamic:!1,encoded:et.Ho(e.toLowerCase())}}(r,{checksum:t});if("bool"===i.type)return function(e){if("boolean"!==typeof e)throw new Xe.C('Invalid boolean value: "'.concat(e,'" (type: ').concat(typeof e,"). Expected: `true` or `false`."));return{dynamic:!1,encoded:et.Ho(et.xb(e))}}(r);if(i.type.startsWith("uint")||i.type.startsWith("int")){var o;const e=i.type.startsWith("int"),[,,t="256"]=null!==(o=Jt.exec(i.type))&&void 0!==o?o:[];return function(e,t){let{signed:n,size:r}=t;if("number"===typeof r){const t=2n**(BigInt(r)-(n?1n:0n))-1n,i=n?-t-1n:0n;if(e>t||e<i)throw new et.Ty({max:t.toString(),min:i.toString(),signed:n,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:et.oB(e,{size:32,signed:n})}}(r,{signed:e,size:Number(t)})}if(i.type.startsWith("bytes"))return function(e,t){let{type:n}=t;const[,r]=n.split("bytes"),i=et.Ej(e);if(!r){let t=e;return i%32!==0&&(t=et.M7(t,32*Math.ceil((e.length-2)/2/32))),{dynamic:!0,encoded:et.xW(et.Ho(et.oB(i,{size:32})),t)}}if(i!==Number.parseInt(r,10))throw new gn({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:et.M7(e)}}(r,{type:i.type});if("string"===i.type)return function(e){const t=et.sH(e),n=Math.ceil(et.Ej(t)/32),r=[];for(let i=0;i<n;i++)r.push(et.M7(et.di(t,32*i,32*(i+1))));return{dynamic:!0,encoded:et.xW(et.M7(et.oB(et.Ej(t),{size:32})),...r)}}(r);throw new vn(i.type)}function en(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:n,encoded:r}=e[s];t+=n?32:et.Ej(r)}const n=[],r=[];let i=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?(n.push(et.oB(t+i,{size:32})),r.push(a),i+=et.Ej(a)):n.push(a)}return et.xW(...n,...r)}function tn(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function nn(e){var t;const{type:n}=e;if("string"===n)return!0;if("bytes"===n)return!0;if(n.endsWith("[]"))return!0;if("tuple"===n)return null===(t=e.components)||void 0===t?void 0:t.some(nn);const r=tn(e.type);return!(!r||!nn((0,F.A)((0,F.A)({},e),{},{type:r[1]})))}const rn={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new an({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new on({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new sn({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new sn({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=null!==t&&void 0!==t?t:this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=null!==e&&void 0!==e?e:this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=null!==t&&void 0!==t?t:e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};class sn extends Xe.C{constructor(e){let{offset:t}=e;super("Offset `".concat(t,"` cannot be negative.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class on extends Xe.C{constructor(e){let{length:t,position:n}=e;super("Position `".concat(n,"` is out of bounds (`0 < position < ").concat(t,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}
2class an extends Xe.C{constructor(e){let{count:t,limit:n}=e;super("Recursive read limit of `".concat(n,"` exceeded (recursive read count: `").concat(t,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function cn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{as:r="Array",checksumAddress:i=!1}=n,s="string"===typeof t?ut(t):t,o=function(e){let{recursiveReadLimit:t=8192}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Object.create(rn);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}(s);if(0===ht(s)&&e.length>0)throw new pn;if(ht(s)&&ht(s)<32)throw new hn({data:"string"===typeof t?t:et.uK(t),parameters:e,size:ht(s)});let a=0;const c="Array"===r?[]:{};for(let u=0;u<e.length;++u){var l;const t=e[u];o.setPosition(a);const[n,s]=Qt(o,t,{checksumAddress:i,staticPosition:0});a+=s,"Array"===r?c.push(n):c[null!==(l=t.name)&&void 0!==l?l:u]=n}return c}
2function ln(e,t,n){const{checksumAddress:r=!1}=null!==n&&void 0!==n?n:{};if(e.length!==t.length)throw new mn({expectedLength:e.length,givenLength:t.length});const i=function(e){let{checksumAddress:t,parameters:n,values:r}=e;const i=[];for(let s=0;s<n.length;s++)i.push($t({checksumAddress:t,parameter:n[s],value:r[s]}));return i}({checksumAddress:r,parameters:e,values:t}),s=en(i);return 0===s.length?"0x":s}function un(e,t){if(e.length!==t.length)throw new mn({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r];n.push(un.encode(i,s))}return et.xW(...n)}function dn(e){return Array.isArray(e)&&"string"===typeof e[0]||"string"===typeof e?Ht(e):e}!function(e){e.encode=function e(t,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("address"===t){const e=n;return Tt(e),et.Ho(e.toLowerCase(),r?32:0)}if("string"===t)return et.sH(n);if("bytes"===t)return n;if("bool"===t)return et.Ho(et.xb(n),r?32:1);const i=t.match(Jt);if(i){const[e,t,s="256"]=i,o=Number.parseInt(s,10)/8;return et.oB(n,{size:r?32:o,signed:"int"===t})}const s=t.match(Kt);if(s){const[e,t]=s;if(Number.parseInt(t,10)!==(n.length-2)/2)throw new gn({expectedSize:Number.parseInt(t,10),value:n});return et.M7(n,r?32:0)}const o=t.match(Gt);if(o&&Array.isArray(n)){const[t,r]=o,i=[];for(let s=0;s<n.length;s++)i.push(e(r,n[s],!0));return 0===i.length?"0x":et.xW(...i)}throw new vn(t)}}(un||(un={}));class hn extends Xe.C{constructor(e){let{data:t,parameters:n,size:r}=e;super("Data size of ".concat(r," bytes is too small for given parameters."),{metaMessages:["Params: (".concat(Vt.Q(n),")"),"Data: ".concat(t," (").concat(r," bytes)")]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class pn extends Xe.C{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class fn extends Xe.C{constructor(e){let{expectedLength:t,givenLength:n,type:r}=e;super("Array length mismatch for type `".concat(r,"`. Expected: `").concat(t,"`. Given: `").concat(n,"`.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class gn extends Xe.C{constructor(e){let{expectedSize:t,value:n}=e;super('Size of bytes "'.concat(n,'" (bytes').concat(et.Ej(n),") does not match expected size (bytes").concat(t,").")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class mn extends Xe.C{constructor(e){let{expectedLength:t,givenLength:n}=e;super(["ABI encoding parameters/values length mismatch.","Expected length (parameters): ".concat(t),"Given length (values): ".concat(n)].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class yn extends Xe.C{constructor(e){super("Value `".concat(e,"` is not a valid array.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class vn extends Xe.C{constructor(e){super("Type `".concat(e,"` is not a valid ABI Type.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function wn(e){const t=e.find(e=>"constructor"===e.type);if(!t)throw new Wt({name:"constructor"});return t}function bn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[r,i=[]]=(()=>{if(Array.isArray(t[0])){const[e,n,r]=t;return[_n(e,n,{args:r}),r]}const[e,n]=t;return[e,n]})(),{overloads:s}=r,o=s?_n([r,...s],r.name,{args:i}):r,a=jt(o);const c=i.length>0?ln(o.inputs,i):void 0;return c?et.xW(a,c):a}function An(e){return Bt(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function _n(e,t,n){const r=Dt(e,t,n);if("function"!==r.type)throw new Wt({name:t,type:"function"});return r}const xn="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",En="0x0000000000000000000000000000000000000000",kn=["calls"],Sn="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function In(e,t){var n,r,i,o,a,c,u,d;const{blockNumber:h,blockTag:p,calls:f,stateOverrides:g,traceAssetChanges:m,traceTransfers:y,validation:v}=t,w=t.account?(0,W.J)(t.account):void 0;if(m&&!w)throw new l.C("`account` is required when `traceAssetChanges` is true");const b=w?function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const[i,s]=(()=>
2{if(Array.isArray(n[0])){const[e,t]=n;return[wn(e),t]}return n})(),{bytecode:o,args:a}=s;return et.xW(o,null!==(e=i.inputs)&&void 0!==e&&e.length&&null!==a&&void 0!==a&&a.length?ln(i.inputs,a):"0x")}(Bt("constructor(bytes, bytes)"),{bytecode:je.LX,args:[Sn,bn(An("function getBalance(address)"),[w.address])]}):void 0;const A=m?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;const{accessList:n}=await J(e,(0,F.A)((0,F.A)({account:w.address},t),{},{data:t.abi?(0,s.p)(t):t.data}));return n.map(e=>{let{address:t,storageKeys:n}=e;return n.length>0?t:null})})).then(e=>e.flat().filter(Boolean)):[],_=await Ve(e,{blockNumber:h,blockTag:p,blocks:[...m?[{calls:[{data:b}],stateOverrides:g},{calls:A.map((e,t)=>({abi:[An("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[w.address],to:e,from:En,nonce:t})),stateOverrides:[{address:En,nonce:0}]}]:[],{calls:[...f,{}].map(e=>(0,F.A)((0,F.A)({},e),{},{from:null===w||void 0===w?void 0:w.address})),stateOverrides:g},...m?[{calls:[{data:b}]},{calls:A.map((e,t)=>({abi:[An("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[w.address],to:e,from:En,nonce:t})),stateOverrides:[{address:En,nonce:0}]},{calls:A.map((e,t)=>({to:e,abi:[An("function decimals() returns (uint256)")],functionName:"decimals",from:En,nonce:t})),stateOverrides:[{address:En,nonce:0}]},{calls:A.map((e,t)=>({to:e,abi:[An("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:En,nonce:t})),stateOverrides:[{address:En,nonce:0}]},{calls:A.map((e,t)=>({to:e,abi:[An("function symbol() returns (string)")],functionName:"symbol",from:En,nonce:t})),stateOverrides:[{address:En,nonce:0}]}]:[]],traceTransfers:y,validation:v}),x=m?_[2]:_[0],[E,k,,S,I,T,C,P]=m?_:[],{calls:O}=x,N=(0,z.A)(x,kn),R=null!==(n=O.slice(0,-1))&&void 0!==n?n:[],M=[...null!==(r=null===E||void 0===E?void 0:E.calls)&&void 0!==r?r:[],...null!==(i=null===k||void 0===k?void 0:k.calls)&&void 0!==i?i:[]].map(e=>"success"===e.status?(0,me.uU)(e.data):null),U=[...null!==(o=null===S||void 0===S?void 0:S.calls)&&void 0!==o?o:[],...null!==(a=null===I||void 0===I?void 0:I.calls)&&void 0!==a?a:[]].map(e=>"success"===e.status?(0,me.uU)(e.data):null),L=(null!==(c=null===T||void 0===T?void 0:T.calls)&&void 0!==c?c:[]).map(e=>"success"===e.status?e.result:null),B=(null!==(u=null===P||void 0===P?void 0:P.calls)&&void 0!==u?u:[]).map(e=>"success"===e.status?e.result:null),D=(null!==(d=null===C||void 0===C?void 0:C.calls)&&void 0!==d?d:[]).map(e=>"success"===e.status?e.result:null),j=[];for(const[s,l]of U.entries()){const e=M[s];if("bigint"!==typeof l)continue;if("bigint"!==typeof e)continue;const t=L[s-1],n=B[s-1],r=D[s-1],i=(()=>0===s?{address:xn,decimals:18,symbol:"ETH"}:{address:A[s-1],decimals:r||t?Number(null!==t&&void 0!==t?t:1):void 0,symbol:null!==n&&void 0!==n?n:void 0})();j.some(e=>e.token.address===i.address)||j.push({token:i,value:{pre:e,post:l,diff:l-e}})}return{assetChanges:j,block:N,results:R}}const Tn=["abi","address","args","dataSuffix","functionName"];async function Cn(e,t){let{filter:n}=t;return n.request({method:"eth_uninstallFilter",params:[n.id]})}const Pn="0x6492649264926492649264926492649264926492649264926492649264926492";function On(e){if(et.di(e,-32)!==Pn)throw new Nn(e)}class Nn extends Xe.C{constructor(e){super("Value `".concat(e,"` is an invalid ERC-6492 wrapped signature.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function Rn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{recovered:n}=t;if("undefined"===typeof e.r)throw new Dn({signature:e});if("undefined"===typeof e.s)throw new Dn({signature:e});if(n&&"undefined"===typeof e.yParity)throw new Dn({signature:e});if(e.r<0n||e.r>Zt)throw new jn({value:e.r});if(e.s<0n||e.s>Zt)throw new Fn({value:e.s});if("number"===typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new zn({value:e.yParity})}function Mn(e){if(130!==e.length&&132!==e.length)throw new Bn({signature:e});const t=BigInt(et.di(e,0,32)),n=BigInt(et.di(e,32,64)),r=(()=>{const t=Number("0x".concat(e.slice(130)));if(!Number.isNaN(t))try{return Ln(t)}catch(n){throw new zn({value:t})}})();return"undefined"===typeof r?{r:t,s:n}:{r:t,s:n,yParity:r}}function Un(e){const t="string"===typeof e?Mn(e):e instanceof Uint8Array?function(e){return Mn(et.uK(e))}(e):"string"===typeof e.r?function(e){const t=(()=>{const t=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if("number"===typeof t&&"number"!==typeof n&&(n=Ln(t)),"number"!==typeof n)throw new zn({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}(e):e.v?function(e){return{r:e.r,s:e.s,yParity:Ln(e.v)}}(e):(0,F.A)({r:e.r,s:e.s},"undefined"!==typeof e.yParity?{yParity:e.yParity}:{});return Rn(t),t}function Ln(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return e%2===0?1:0;throw new Wn({value:e})}class Bn extends Xe.C{constructor(e){let{signature:t}=e;
2super("Value `".concat(t,"` is an invalid signature size."),{metaMessages:["Expected: 64 bytes or 65 bytes.","Received ".concat(et.Ej(et.HT(t))," bytes.")]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Dn extends Xe.C{constructor(e){let{signature:t}=e;super("Signature `".concat(ot.A(t),"` is missing either an `r`, `s`, or `yParity` property.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class jn extends Xe.C{constructor(e){let{value:t}=e;super("Value `".concat(t,"` is an invalid r value. r must be a positive integer less than 2^256.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class Fn extends Xe.C{constructor(e){let{value:t}=e;super("Value `".concat(t,"` is an invalid s value. s must be a positive integer less than 2^256.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class zn extends Xe.C{constructor(e){let{value:t}=e;super("Value `".concat(t,"` is an invalid y-parity value. Y-parity must be 0 or 1.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class Wn extends Xe.C{constructor(e){let{value:t}=e;super("Value `".concat(t,"` is an invalid v value. v must be 27, 28 or >=35.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function qn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"===typeof e.chainId?Hn(e):(0,F.A)((0,F.A)({},e),t.signature)}function Hn(e){const{address:t,chainId:n,nonce:r}=e,i=function(e){if("undefined"!==typeof e.r&&"undefined"!==typeof e.s)return Un(e)}(e);return(0,F.A)({address:t,chainId:Number(n),nonce:BigInt(r)},i)}const Vn="0x8010801080108010801080108010801080108010801080108010801080108010",Gn=dn("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function Kn(e){if("string"===typeof e){if(et.di(e,-32)!==Vn)throw new Zn(e)}else Rn(e.authorization)}function Jn(e){Kn(e);const t=et.Ro(et.di(e,-64,-32)),n=et.di(e,-t-64,-64),r=et.di(e,0,-t-64),[i,s,o]=cn(Gn,n),a=qn({address:i.delegation,chainId:Number(i.chainId),nonce:i.nonce,yParity:i.yParity,r:i.r,s:i.s});return(0,F.A)({authorization:a,signature:r},o&&"0x"!==o?{data:o,to:s}:{})}class Zn extends Xe.C{constructor(e){super("Value `".concat(e,"` is an invalid ERC-8010 wrapped signature.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}var Qn=n(78686),Yn=n(10133),Xn=n(6259);var $n=n(93551),er=n(17015);const tr=["address","factory","factoryData","hash","signature","verifierAddress"];async function nr(e,t){var n,i,o,a;const{address:l,hash:d,erc6492VerifierAddress:h=(null!==(n=t.universalSignatureVerifierAddress)&&void 0!==n?n:null===(i=e.chain)||void 0===i||null===(i=i.contracts)||void 0===i||null===(i=i.erc6492Verifier)||void 0===i?void 0:i.address),multicallAddress:f=(null!==(o=t.multicallAddress)&&void 0!==o?o:null===(a=e.chain)||void 0===a||null===(a=a.contracts)||void 0===a||null===(a=a.multicall3)||void 0===a?void 0:a.address)}=t,g=(()=>{const e=t.signature;return(0,m.q)(e)?e:"object"===typeof e&&"r"in e&&"s"in e?(0,er.h)(e):(0,c.My)(e)})();try{return function(e){try{return Kn(e),!0}catch(t){return!1}}(g)?await async function(e,t){var n;const{address:i,blockNumber:o,blockTag:a,hash:l,multicallAddress:d}=t,{authorization:h,data:f,signature:g,to:m}=Jn(t.signature),y=await(0,ve.Q)(e,{address:i,blockNumber:o,blockTag:a});if(y===(0,p.aP)(["0xef0100",h.address]))return await async function(e,t){const{address:n,blockNumber:i,blockTag:s,hash:o,signature:a}=t,c=await(0,_.T)(e,x.J,"readContract")({address:n,abi:r.UW,args:[o,a],blockNumber:i,blockTag:s,functionName:"isValidSignature"}).catch(e=>{if(e instanceof u.bG)throw new rr;throw e});if(c.startsWith("0x1626ba7e"))return!0;throw new rr}(e,{address:i,blockNumber:o,blockTag:a,hash:l,signature:g});const v={address:h.address,chainId:Number(h.chainId),nonce:Number(h.nonce),r:(0,c.cK)(h.r,{size:32}),s:(0,c.cK)(h.s,{size:32}),yParity:h.yParity},w=await async function(e){let{address:t,authorization:n,signature:r}=e;return(0,we.h)((0,Yn.b)(t),await(0,Xn.g)({authorization:n,signature:r}))}({address:i,authorization:v});if(!w)throw new rr;const b=await(0,_.T)(e,x.J,"readContract")((0,F.A)((0,F.A)({},d?{address:d}:{code:je.Ez}),{},{authorizationList:[v],abi:r.v2,blockNumber:o,blockTag:"pending",functionName:"aggregate3",args:[[...f?[{allowFailure:!0,target:null!==m&&void 0!==m?m:i,callData:f}
2]:[],{allowFailure:!0,target:i,callData:(0,s.p)({abi:r.UW,functionName:"isValidSignature",args:[l,g]})}]]})),A=null===(n=b[b.length-1])||void 0===n?void 0:n.returnData;if(null!==A&&void 0!==A&&A.startsWith("0x1626ba7e"))return!0;throw new rr}(e,(0,F.A)((0,F.A)({},t),{},{multicallAddress:f,signature:g})):await async function(e,t){const{address:n,factory:i,factoryData:o,hash:a,signature:c,verifierAddress:l}=t,d=(0,z.A)(t,tr),h=await(async()=>i||o?function(e){try{return On(e),!0}catch(t){return!1}}(c)?c:function(e){const{data:t,signature:n,to:r}=e;return et.xW(ln(dn("address, bytes, bytes"),[r,t,n]),Pn)}({data:o,signature:c,to:i}):c)(),p=l?(0,F.A)({to:l,data:(0,s.p)({abi:r.E5,functionName:"isValidSig",args:[n,a,h]})},d):(0,F.A)({data:(0,Qn.m)({abi:r.E5,args:[n,a,h],bytecode:je.fT})},d),{data:f}=await(0,_.T)(e,j.T,"call")(p).catch(e=>{if(e instanceof u.zX)throw new rr;throw e});if((0,me.Nx)(null!==f&&void 0!==f?f:"0x0"))return!0;throw new rr}(e,(0,F.A)((0,F.A)({},t),{},{verifierAddress:h,signature:g}))}catch(y){try{if((0,we.h)((0,Yn.b)(l),await(0,$n.x)({hash:d,signature:g})))return!0}catch(v){}if(y instanceof rr)return!1;throw y}}class rr extends Error{}var ir=n(26856);const sr=["address","message","factory","factoryData","signature"];var or=n(44423);const ar=["address","factory","factoryData","signature","message","primaryType","types","domain"];var cr=n(1212),lr=n(83923),ur=n(38274),dr=n(68337),hr=n(73251);var pr=n(41661);const fr=["scheme","statement"],gr=["chainId","expirationTime","issuedAt","notBefore","requestId"];const mr=(0,E.A)(/^(?:([a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?([a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(0x[a-fA-F0-9]{40})\n\n(?:(.*)\n\n)?/,{scheme:1,domain:2,address:3,statement:4}),yr=(0,E.A)(/(?:URI: (.+))\n(?:Version: (.+))\n(?:Chain ID: (\d+))\n(?:Nonce: ([a-zA-Z0-9]+))\n(?:Issued At: (.+))(?:\nExpiration Time: (.+))?(?:\nNot Before: (.+))?(?:\nRequest ID: (.+))?/,{uri:1,version:2,chainId:3,nonce:4,issuedAt:5,expirationTime:6,notBefore:7,requestId:8});var vr=n(27133);const wr=["address","domain","message","nonce","scheme","signature","time"];async function br(e,t){const{address:n,domain:r,message:i,nonce:s,scheme:o,signature:a,time:c=new Date}=t,l=(0,z.A)(t,wr),u=function(e){var t,n,r,i,s;const o=null!==(t=null===(n=e.match(mr))||void 0===n?void 0:n.groups)&&void 0!==t?t:{},{scheme:a,statement:c}=o,l=(0,z.A)(o,fr),u=null!==(r=null===(i=e.match(yr))||void 0===i?void 0:i.groups)&&void 0!==r?r:{},{chainId:d,expirationTime:h,issuedAt:p,notBefore:f,requestId:g}=u,m=(0,z.A)(u,gr),y=null===(s=e.split("Resources:")[1])||void 0===s?void 0:s.split("\n- ").slice(1);return(0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)((0,F.A)({},l),m),d?{chainId:Number(d)}:{}),h?{expirationTime:new Date(h)}:{}),p?{issuedAt:new Date(p)}:{}),f?{notBefore:new Date(f)}:{}),g?{requestId:g}:{}),y?{resources:y}:{}),a?{scheme:a}:{}),c?{statement:c}:{})}(i);if(!u.address)return!1;const d=function(e){const{address:t,domain:n,message:r,nonce:i,scheme:s,time:o=new Date}=e;if(n&&r.domain!==n)return!1;if(i&&r.nonce!==i)return!1;if(s&&r.scheme!==s)return!1;if(r.expirationTime&&o>=r.expirationTime)return!1;if(r.notBefore&&o<r.notBefore)return!1;try{if(!r.address)return!1;if(!(0,vr.P)(r.address,{strict:!1}))return!1;if(t&&!(0,we.h)(r.address,t))return!1}catch(a){return!1}return!0}({address:n,domain:r,message:u,nonce:s,scheme:o,time:c});if(!d)return!1;const h=(0,ir.A)(i);return nr(e,(0,F.A)({address:u.address,hash:h,signature:a},l))}var Ar=n(4386),_r=n(75470),xr=n(93341);function Er(e){return{call:t=>(0,j.T)(e,t),createAccessList:t=>J(e,t),createBlockFilter:()=>async function(e){const t=Z(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>se(e,t),createEventFilter:t=>oe(e,t),createPendingTransactionFilter:()=>ae(e),estimateContractGas:t=>async function(e,t){const{abi:n,address:r,args:i,functionName:o,dataSuffix:a}=t,c=(0,z.A)(t,ue),l=(0,s.p)({abi:n,args:i,functionName:o});try{return await(0,_.T)(e,le.Q,"estimateGas")((0,F.A)({data:"".concat(l).concat(a?a.replace("0x",""):""),to:r},c))}catch(u){const e=c.account?(0,W.J)(c.account):void 0;throw(0,ce.j)(u,{abi:n,address:r,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:null===e||void 0===e?void 0:e.address})}}(e,t),estimateGas:t=>(0,le.Q)(e,t),getBalance:t=>async function(e,t){var n;let{address:r,blockNumber:i,blockTag:s=(null!==(n=e.experimental_blockTag)&&void 0!==n?n:"latest")}=t;const o="bigint"===typeof i?(0,c.cK)(i):void 0,a=await e.request({method:"eth_getBalance",params:[r,o||s]});return BigInt(a)}(e,t),getBlobBaseFee:()=>async function(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}(e),getBlock:t=>(0,fe.g)(e,t),getBlockNumber:t=>(0,ge.G)(e,t),getBlockTransactionCount:t=>async function(e){let{blockHash:t,blockNumber:n,blockTag:r="latest"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=void 0!==n?(0,c.cK)(n):void 0;let s;return s=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[i||r]},{dedupe:Boolean(i)}),(0,me.ME)(s)}(e,t),getBytecode:t=>(0,ve.Q)(e,t),getChainId:()=>(0,ye.T)(e),getCode:t=>(0,ve.Q)(e,t),getContractEvents:t=>Ce(e,t),getEip712Domain:t=>async function(e,t){const{address:n,factory:r,factoryData:i}=t;try{const[t,s,o,a,c,l,u]=await(0,_.T)(e,x.J,"readContract")({abi:Oe,address:n,functionName:"eip712Domain",factory:r,factoryData:i});return{domain:{name:s,version:o,chainId:Number(a),verifyingContract:c,salt:l},extensions:u,fields:t}}catch(s){const e=s;if("ContractFunctionExecutionError"===e.name&&"ContractFunctionZeroDataError"===e.cause.name)throw new Pe({address:n});throw e}}(e,t),getEnsAddress:t=>async function(e,t){const{blockNumber:n,blockTag:l,coinType:u,name:p,gatewayUrls:f,strict:g}=t,{chain:m}=e,y=(()=>
2{if(t.universalResolverAddress)return t.universalResolverAddress;if(!m)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:n,chain:m,contract:"ensUniversalResolver"})})(),w=null===m||void 0===m?void 0:m.ensTlds;if(w&&!w.some(e=>p.endsWith(e)))return null;const b=null!=u?[v(p),BigInt(u)]:[v(p)];try{const t=(0,s.p)({abi:r.Rm,functionName:"addr",args:b}),o={address:y,abi:r.Ag,functionName:"resolveWithGateways",args:[(0,c.nj)(A(p)),t,null!==f&&void 0!==f?f:[h.J]],blockNumber:n,blockTag:l},u=(0,_.T)(e,x.J,"readContract"),d=await u(o);if("0x"===d[0])return null;const g=(0,i.e)({abi:r.Rm,args:b,functionName:"addr",data:d[0]});return"0x"===g||"0x00"===(0,a.B)(g)?null:g}catch(E){if(g)throw E;if(d(E))return null;throw E}}(e,t),getEnsAvatar:t=>async function(e,t){let{blockNumber:n,blockTag:r,assetGatewayUrls:i,name:s,gatewayUrls:o,strict:a,universalResolverAddress:c}=t;const l=await(0,_.T)(e,D,"getEnsText")({blockNumber:n,blockTag:r,key:"avatar",name:s,universalResolverAddress:c,gatewayUrls:o,strict:a});if(!l)return null;try{return await B(e,{record:l,gatewayUrls:i})}catch(u){return null}}(e,t),getEnsName:t=>async function(e,t){const{address:n,blockNumber:i,blockTag:s,coinType:a=60n,gatewayUrls:c,strict:l}=t,{chain:u}=e,p=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!u)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:i,chain:u,contract:"ensUniversalResolver"})})();try{const t={address:p,abi:r.oX,args:[n,a,null!==c&&void 0!==c?c:[h.J]],functionName:"reverseWithGateways",blockNumber:i,blockTag:s},o=(0,_.T)(e,x.J,"readContract"),[l]=await o(t);return l||null}catch(f){if(l)throw f;if(d(f))return null;throw f}}(e,t),getEnsResolver:t=>async function(e,t){const{blockNumber:n,blockTag:r,name:i}=t,{chain:s}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,o.M)({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),l=null===s||void 0===s?void 0:s.ensTlds;if(l&&!l.some(e=>i.endsWith(e)))throw new Error("".concat(i," is not a valid ENS TLD (").concat(null===l||void 0===l?void 0:l.join(", "),') for chain "').concat(s.name,'" (id: ').concat(s.id,")."));const[u]=await(0,_.T)(e,x.J,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,c.nj)(A(i))],blockNumber:n,blockTag:r});return u}(e,t),getEnsText:t=>D(e,t),getFeeHistory:t=>Ne(e,t),estimateFeesPerGas:t=>(0,de._)(e,t),getFilterChanges:e=>Re(0,e),getFilterLogs:e=>async function(e,t){var n;let{filter:r}=t;const i=null!==(n=r.strict)&&void 0!==n&&n,s=(await r.request({method:"eth_getFilterLogs",params:[r.id]})).map(e=>(0,Ie.e)(e));return r.abi?Se({abi:r.abi,logs:s,strict:i}):s}(0,e),getGasPrice:()=>(0,Me.L)(e),getLogs:t=>Te(e,t),getProof:t=>Ue(e,t),estimateMaxPriorityFeePerGas:t=>(0,he.b)(e,t),fillTransaction:t=>(0,pe.a)(e,t),getStorageAt:t=>async function(e,t){let{address:n,blockNumber:r,blockTag:i="latest",slot:s}=t;const o=void 0!==r?(0,c.cK)(r):void 0;return await e.request({method:"eth_getStorageAt",params:[n,s,o||i]})}(e,t),getTransaction:t=>(0,Le.x)(e,t),getTransactionConfirmations:t=>async function(e,t){let{hash:n,transactionReceipt:r}=t;const[i,s]=await Promise.all([(0,_.T)(e,ge.G,"getBlockNumber")({}),n?(0,_.T)(e,Le.x,"getTransaction")({hash:n}):void 0]),o=(null===r||void 0===r?void 0:r.blockNumber)||(null===s||void 0===s?void 0:s.blockNumber);return o?i-o+1n:0n}(e,t),getTransactionCount:t=>(0,Be.y)(e,t),getTransactionReceipt:t=>(0,De.h)(e,t),multicall:t=>async function(e,t){var n,a,c;const{account:d,authorizationList:h,allowFailure:p=!0,blockNumber:f,blockOverrides:g,blockTag:m,stateOverride:y}=t,v=t.contracts,{batchSize:w=(null!==(n=t.batchSize)&&void 0!==n?n:1024),deployless:b=null!==(a=t.deployless)&&void 0!==a&&a}="object"===typeof(null===(c=e.batch)||void 0===c?void 0:c.multicall)?e.batch.multicall:{},A=(()=>
2{if(t.multicallAddress)return t.multicallAddress;if(b)return null;if(e.chain)return(0,o.M)({blockNumber:f,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),E=[[]];let k=0,S=0;for(let r=0;r<v.length;r++){const{abi:e,address:t,args:n,functionName:i}=v[r];try{const r=(0,s.p)({abi:e,args:n,functionName:i});S+=(r.length-2)/2,w>0&&S>w&&E[k].length>0&&(k++,S=(r.length-2)/2,E[k]=[]),E[k]=[...E[k],{allowFailure:!0,callData:r,target:t}]}catch(C){const r=(0,ce.j)(C,{abi:e,address:t,args:n,docsPath:"/docs/contract/multicall",functionName:i,sender:d});if(!p)throw r;E[k]=[...E[k],{allowFailure:!0,callData:"0x",target:t}]}}const I=await Promise.allSettled(E.map(t=>(0,_.T)(e,x.J,"readContract")((0,F.A)((0,F.A)({},null===A?{code:je.Ez}:{address:A}),{},{abi:r.v2,account:d,args:[t],authorizationList:h,blockNumber:f,blockOverrides:g,blockTag:m,functionName:"aggregate3",stateOverride:y})))),T=[];for(let r=0;r<I.length;r++){const e=I[r];if("rejected"===e.status){if(!p)throw e.reason;for(let t=0;t<E[r].length;t++)T.push({status:"failure",error:e.reason,result:void 0});continue}const t=e.value;for(let n=0;n<t.length;n++){const{returnData:e,success:s}=t[n],{callData:o}=E[r][n],{abi:a,address:c,functionName:l,args:d}=v[T.length];try{if("0x"===o)throw new Q.O;if(!s)throw new u.$S({data:e});const t=(0,i.e)({abi:a,args:d,data:e,functionName:l});T.push(p?{result:t,status:"success"}:t)}catch(C){const e=(0,ce.j)(C,{abi:a,address:c,args:d,docsPath:"/docs/contract/multicall",functionName:l});if(!p)throw e;T.push({error:e,result:void 0,status:"failure"})}}}if(T.length!==v.length)throw new l.C("multicall results mismatch");return T}(e,t),prepareTransactionRequest:t=>(0,Ar.ft)(e,t),readContract:t=>(0,x.J)(e,t),sendRawTransaction:t=>(0,_r.L)(e,t),sendRawTransactionSync:t=>(0,xr.s)(e,t),simulate:t=>Ve(e,t),simulateBlocks:t=>Ve(e,t),simulateCalls:t=>In(e,t),simulateContract:t=>async function(e,t){const{abi:n,address:r,args:o,dataSuffix:a,functionName:c}=t,l=(0,z.A)(t,Tn),u=l.account?(0,W.J)(l.account):e.account,d=(0,s.p)({abi:n,args:o,functionName:c});try{const{data:s}=await(0,_.T)(e,j.T,"call")((0,F.A)((0,F.A)({batch:!1,data:"".concat(d).concat(a?a.replace("0x",""):""),to:r},l),{},{account:u})),h=(0,i.e)({abi:n,args:o,functionName:c,data:s||"0x"}),p=n.filter(e=>"name"in e&&e.name===t.functionName);return{result:h,request:(0,F.A)((0,F.A)({abi:p,address:r,args:o,dataSuffix:a,functionName:c},l),{},{account:u})}}catch(h){throw(0,ce.j)(h,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:c,sender:null===u||void 0===u?void 0:u.address})}}(e,t),verifyHash:t=>nr(e,t),verifyMessage:t=>async function(e,t){let{address:n,message:r,factory:i,factoryData:s,signature:o}=t,a=(0,z.A)(t,sr);const c=(0,ir.A)(r);return(0,_.T)(e,nr,"verifyHash")((0,F.A)({address:n,factory:i,factoryData:s,hash:c,signature:o},a))}(e,t),verifySiweMessage:t=>br(e,t),verifyTypedData:t=>async function(e,t){const{address:n,factory:r,factoryData:i,signature:s,message:o,primaryType:a,types:c,domain:l}=t,u=(0,z.A)(t,ar),d=(0,or.Zh)({message:o,primaryType:a,types:c,domain:l});return(0,_.T)(e,nr,"verifyHash")((0,F.A)({address:n,factory:r,factoryData:i,hash:d,signature:s},u))}(e,t),uninstallFilter:e=>Cn(0,e),waitForTransactionReceipt:t=>(0,cr.n)(e,t),watchBlocks:t=>function(e,t){var n;let{blockTag:r=(null!==(n=e.experimental_blockTag)&&void 0!==n?n:"latest"),emitMissed:i=!1,emitOnBegin:s=!1,onBlock:o,onError:a,includeTransactions:c,poll:l,pollingInterval:u=e.pollingInterval}=t;const d="undefined"!==typeof l?l:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
2onfig.type&&"ipc"!==e.transport.transports[0].config.type),h=null!==c&&void 0!==c&&c;let p;return d?(()=>{const t=(0,hr.A)(["watchBlocks",e.uid,r,i,s,h,u]);return(0,ur.lB)(t,{onBlock:o,onError:a},t=>(0,dr.w)(async()=>{try{var n,s;const a=await(0,_.T)(e,fe.g,"getBlock")({blockTag:r,includeTransactions:h});if(null!==a.number&&null!=(null===(n=p)||void 0===n?void 0:n.number)){if(a.number===p.number)return;if(a.number-p.number>1&&i)for(let n=(null===(o=p)||void 0===o?void 0:o.number)+1n;n<a.number;n++){var o;const r=await(0,_.T)(e,fe.g,"getBlock")({blockNumber:n,includeTransactions:h});t.onBlock(r,p),p=r}}(null==(null===(s=p)||void 0===s?void 0:s.number)||"pending"===r&&null==(null===a||void 0===a?void 0:a.number)||null!==a.number&&a.number>p.number)&&(t.onBlock(a,p),p=a)}catch(c){var a;null===(a=t.onError)||void 0===a||a.call(t,c)}},{emitOnBegin:s,interval:u}))})():(()=>{let t=!0,n=!0,i=()=>t=!1;return(async()=>{try{s&&(0,_.T)(e,fe.g,"getBlock")({blockTag:r,includeTransactions:h}).then(e=>{t&&n&&(o(e,void 0),n=!1)}).catch(a);const c=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:l}=await c.subscribe({params:["newHeads"],async onData(r){var i;if(!t)return;const s=await(0,_.T)(e,fe.g,"getBlock")({blockNumber:null===(i=r.result)||void 0===i?void 0:i.number,includeTransactions:h}).catch(()=>{});t&&(o(s,p),n=!1,p=s)},onError(e){null===a||void 0===a||a(e)}});i=l,t||i()}catch(c){null===a||void 0===a||a(c)}})(),()=>i()})()}(e,t),watchBlockNumber:t=>(0,lr.q)(e,t),watchContractEvent:t=>function(e,t){const{abi:n,address:r,args:i,batch:s=!0,eventName:o,fromBlock:a,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:h}=t;return("undefined"!==typeof u?u:"bigint"===typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
2onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{const t=null!==h&&void 0!==h&&h,u=(0,hr.A)(["watchContractEvent",r,i,s,e.uid,o,d,t,a]);return(0,ur.lB)(u,{onLogs:l,onError:c},c=>{let l,u;void 0!==a&&(l=a-1n);let h=!1;const p=(0,dr.w)(async()=>{if(h)try{let a;if(u)a=await(0,_.T)(e,Re,"getFilterChanges")({filter:u});else{const s=await(0,_.T)(e,ge.G,"getBlockNumber")({});a=l&&l<s?await(0,_.T)(e,Ce,"getContractEvents")({abi:n,address:r,args:i,eventName:o,fromBlock:l+1n,toBlock:s,strict:t}):[],l=s}if(0===a.length)return;if(s)c.onLogs(a);else for(const e of a)c.onLogs([e])}catch(p){var d;u&&p instanceof pr.Di&&(h=!1),null===(d=c.onError)||void 0===d||d.call(c,p)}else{try{u=await(0,_.T)(e,se,"createContractEventFilter")({abi:n,address:r,args:i,eventName:o,strict:t,fromBlock:a})}catch(f){}h=!0}},{emitOnBegin:!0,interval:d});return async()=>{u&&await(0,_.T)(e,Cn,"uninstallFilter")({filter:u}),p()}})})():(()=>{const t=null!==h&&void 0!==h&&h,a=(0,hr.A)(["watchContractEvent",r,i,s,e.uid,o,d,t]);let u=!0,p=()=>u=!1;return(0,ur.lB)(a,{onLogs:l,onError:c},t=>((async()=>{try{const s=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),a=o?re({abi:n,eventName:o,args:i}):[],{unsubscribe:c}=await s.subscribe({params:["logs",{address:r,topics:a}],onData(e){if(!u)return;const r=e.result;try{const{eventName:e,args:i}=Ee({abi:n,data:r.data,topics:r.topics,strict:h}),s=(0,Ie.e)(r,{args:i,eventName:e});t.onLogs([s])}catch(s){let e,n;if(s instanceof Q.fo||s instanceof Q.l3){var i;if(h)return;e=s.abiItem.name,n=null===(i=s.abiItem.inputs)||void 0===i?void 0:i.some(e=>!("name"in e&&e.name))}const o=(0,Ie.e)(r,{args:n?[]:{},eventName:e});t.onLogs([o])}},onError(e){var n;null===(n=t.onError)||void 0===n||n.call(t,e)}});p=c,u||p()}catch(s){null===c||void 0===c||c(s)}})(),()=>p()))})()}(e,t),watchEvent:t=>function(e,t){let{address:n,args:r,batch:i=!0,event:s,events:o,fromBlock:a,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:h}=t;const p="undefined"!==typeof u?u:"bigint"===typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
2onfig.type&&"ipc"!==e.transport.transports[0].config.type),f=null!==h&&void 0!==h&&h;return p?(()=>{const t=(0,hr.A)(["watchEvent",n,r,i,e.uid,s,d,a]);return(0,ur.lB)(t,{onLogs:l,onError:c},t=>{let c,l;void 0!==a&&(c=a-1n);let u=!1;const h=(0,dr.w)(async()=>{if(u)try{let a;if(l)a=await(0,_.T)(e,Re,"getFilterChanges")({filter:l});else{const t=await(0,_.T)(e,ge.G,"getBlockNumber")({});a=c&&c!==t?await(0,_.T)(e,Te,"getLogs")({address:n,args:r,event:s,events:o,fromBlock:c+1n,toBlock:t}):[],c=t}if(0===a.length)return;if(i)t.onLogs(a);else for(const e of a)t.onLogs([e])}catch(h){var d;l&&h instanceof pr.Di&&(u=!1),null===(d=t.onError)||void 0===d||d.call(t,h)}else{try{l=await(0,_.T)(e,oe,"createEventFilter")({address:n,args:r,event:s,events:o,strict:f,fromBlock:a})}catch(p){}u=!0}},{emitOnBegin:!0,interval:d});return async()=>{l&&await(0,_.T)(e,Cn,"uninstallFilter")({filter:l}),h()}})})():(()=>{let t=!0,i=()=>t=!1;return(async()=>{try{const a=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),u=null!==o&&void 0!==o?o:s?[s]:void 0;let d=[];if(u){const e=u.flatMap(e=>re({abi:[e],eventName:e.name,args:r}));d=[e],s&&(d=d[0])}const{unsubscribe:p}=await a.subscribe({params:["logs",{address:n,topics:d}],onData(e){if(!t)return;const n=e.result;try{const{eventName:e,args:t}=Ee({abi:null!==u&&void 0!==u?u:[],data:n.data,topics:n.topics,strict:f}),r=(0,Ie.e)(n,{args:t,eventName:e});l([r])}catch(i){let e,t;if(i instanceof Q.fo||i instanceof Q.l3){var r;if(h)return;e=i.abiItem.name,t=null===(r=i.abiItem.inputs)||void 0===r?void 0:r.some(e=>!("name"in e&&e.name))}const s=(0,Ie.e)(n,{args:t?[]:{},eventName:e});l([s])}},onError(e){null===c||void 0===c||c(e)}});i=p,t||i()}catch(a){null===c||void 0===c||c(a)}})(),()=>i()})()}(e,t),watchPendingTransactions:t=>function(e,t){let{batch:n=!0,onError:r,onTransactions:i,poll:s,pollingInterval:o=e.pollingInterval}=t;return("undefined"!==typeof s?s:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?(()=>{const t=(0,hr.A)(["watchPendingTransactions",e.uid,n,o]);return(0,ur.lB)(t,{onTransactions:i,onError:r},t=>{let r;const i=(0,dr.w)(async()=>{try{if(!r)try{return void(r=await(0,_.T)(e,ae,"createPendingTransactionFilter")({}))}catch(o){throw i(),o}const s=await(0,_.T)(e,Re,"getFilterChanges")({filter:r});if(0===s.length)return;if(n)t.onTransactions(s);else for(const e of s)t.onTransactions([e])}catch(o){var s;null===(s=t.onError)||void 0===s||s.call(t,o)}},{emitOnBegin:!0,interval:o});return async()=>{r&&await(0,_.T)(e,Cn,"uninstallFilter")({filter:r}),i()}})})():(()=>{let t=!0,n=()=>t=!1;return(async()=>{try{const{unsubscribe:s}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;i([n])},onError(e){null===r||void 0===r||r(e)}});n=s,t||n()}catch(s){null===r||void 0===r||r(s)}})(),()=>n()})()}(e,t)}}},63736:(e,t,n)=>{"use strict";n.d(t,{sc:()=>r});const r=n(36457).sc},64284:(e,t,n)=>{"use strict";function r(e,t){if(e in t){let r=t[e];for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];return"function"==typeof r?r(...i):r}let o=new Error('Tried to handle "'.concat(e,'" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(t).map(e=>'"'.concat(e,'"')).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(o,r),o}n.d(t,{Y:()=>r})},64492:(e,t,n)=>{"use strict";n.d(t,{z:()=>s});var r=n(57722),i=n(25087);function s(e,t,n,s){let o=(0,i.Y)(n);(0,r.useEffect)(()=>{if(e)return document.addEventListener(t,n,s),()=>document.removeEventListener(t,n,s);function n(e){o.current(e)}},[e,t,s])}},64655:(e,t,n)=>{"use strict";n.d(t,{IJsonRpcProvider:()=>o.kF,formatJsonRpcError:()=>s.dZ,formatJsonRpcRequest:()=>s.e_,formatJsonRpcResult:()=>s.Im,getBigIntRpcId:()=>s.eX,isHttpUrl:()=>a.q$,isJsonRpcError:()=>c.U$,isJsonRpcRequest:()=>c.p3,isJsonRpcResponse:()=>c.tq,isJsonRpcResult:()=>c.xT,isLocalhostUrl:()=>a.z,isWsUrl:()=>a.A1,parseConnectionError:()=>r.eF,payloadId:()=>s.ER});n(59314);var r=n(31229),i=n(56);n.o(i,"IJsonRpcProvider")&&n.d(t,{IJsonRpcProvider:function(){return i.IJsonRpcProvider}}),n.o(i,"formatJsonRpcError")&&n.d(t,{formatJsonRpcError:function(){return i.formatJsonRpcError}}),n.o(i,"formatJsonRpcRequest")&&n.d(t,{formatJsonRpcRequest:function(){return i.formatJsonRpcRequest}}),n.o(i,"formatJsonRpcResult")&&n.d(t,{formatJsonRpcResult:function(){return i.formatJsonRpcResult}}),n.o(i,"getBigIntRpcId")&&n.d(t,{getBigIntRpcId:function(){return i.getBigIntRpcId}}),n.o(i,"isHttpUrl")&&n.d(t,{isHttpUrl:function(){return i.isHttpUrl}}),n.o(i,"isJsonRpcError")&&n.d(t,{isJsonRpcError:function(){return i.isJsonRpcError}}),n.o(i,"isJsonRpcRequest")&&n.d(t,{isJsonRpcRequest:function(){return i.isJsonRpcRequest}}),n.o(i,"isJsonRpcResponse")&&n.d(t,{isJsonRpcResponse:function(){return i.isJsonRpcResponse}}),n.o(i,"isJsonRpcResult")&&n.d(t,{isJsonRpcResult:function(){return i.isJsonRpcResult}}),n.o(i,"isLocalhostUrl")&&n.d(t,{isLocalhostUrl:function(){return i.isLocalhostUrl}}),n.o(i,"isReactNative")&&n.d(t,{isReactNative:function(){return i.isReactNative}}),n.o(i,"isWsUrl")&&n.d(t,{isWsUrl:function(){return i.isWsUrl}}),n.o(i,"payloadId")&&n.d(t,{payloadId:function(){return i.payloadId}});var s=n(30340),o=n(21809),a=n(32182),c=n(96784)},64740:(e,t,n)=>{"use strict";n.d(t,{EK:()=>g,Im:()=>f,J8:()=>m,O_:()=>h,a5:()=>_,ci:()=>x,is:()=>d,md:()=>v,xQ:()=>y});var r=n(24107),i=n(41684),s=n(69314),o=n(10860);function a(e,t,n){if(t!==n)throw new o.tsw(o.lUj,{actual:n,codecDescription:e,expected:t})}function c(e){return e.reduce((e,t)=>
2null===e||null===t?null:e+t,0)}function l(e){return(0,i.Sc)(e)?e.fixedSize:null}function u(e){var t;return(0,i.Sc)(e)?e.fixedSize:null!==(t=e.maxSize)&&void 0!==t?t:null}function d(e){var t,n;const o=null!==(t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).size)&&void 0!==t?t:(0,s.PL)(),c=p(o,l(e)),d=null!==(n=p(o,u(e)))&&void 0!==n?n:void 0;return(0,i.xv)((0,r.A)((0,r.A)({},null!==c?{fixedSize:c}:{getSizeFromValue:t=>("object"===typeof o?(0,i.QM)(t.length,o):0)+[...t].reduce((t,n)=>t+(0,i.QM)(n,e),0),maxSize:d}),{},{write:(t,n,r)=>("number"===typeof o&&a("array",o,t.length),"object"===typeof o&&(r=o.write(t.length,n,r)),t.forEach(t=>{r=e.write(t,n,r)}),r)}))}function h(e){var t,n;const o=null!==(t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).size)&&void 0!==t?t:(0,s.VI)(),a=l(e),c=p(o,a),d=null!==(n=p(o,u(e)))&&void 0!==n?n:void 0;return(0,i.$C)((0,r.A)((0,r.A)({},null!==c?{fixedSize:c}:{maxSize:d}),{},{read:(t,n)=>{const r=[];if("object"===typeof o&&0===t.slice(n).length)return[r,n];if("remainder"===o){for(;n<t.length;){const[i,s]=e.read(t,n);n=s,r.push(i)}return[r,n]}const[i,s]="number"===typeof o?[o,n]:o.read(t,n);n=s;for(let o=0;o<i;o+=1){const[i,s]=e.read(t,n);n=s,r.push(i)}return[r,n]}}))}function p(e,t){return"number"!==typeof e?null:0===e?0:null===t?null:t*e}function f(){return(0,i.xv)({getSizeFromValue:e=>e.length,write:(e,t,n)=>(t.set(e,n),n+e.length)})}function g(){return(0,i.$C)({read:(e,t)=>{const n=e.slice(t);return[n,t+n.length]}})}function m(e){return(0,i.xv)({fixedSize:e.length,write:(t,n,r)=>(n.set(e,r),r+e.length)})}function y(e){var t;const n=c(e.map(l)),s=null!==(t=c(e.map(u)))&&void 0!==t?t:void 0;return(0,i.$C)((0,r.A)((0,r.A)({},null===n?{maxSize:s}:{fixedSize:n}),{},{read:(t,n)=>{const r=[];return e.forEach(e=>{const[i,s]=e.read(t,n);r.push(i),n=s}),[r,n]}}))}function v(e,t){const n=b(e),s=(n,r,i)=>{const s=t(n);return w(e,s),e[s].write(n,r,i)};if(null!==n)return(0,i.xv)({fixedSize:n,write:s});const o=A(e);return(0,i.xv)((0,r.A)((0,r.A)({},null!==o?{maxSize:o}:{}),{},{getSizeFromValue:n=>{const r=t(n);return w(e,r),(0,i.QM)(n,e[r])},write:s}))}function w(e,t){if("undefined"===typeof e[t])throw new o.tsw(o.bg4,{maxRange:e.length-1,minRange:0,variant:t})}function b(e){if(0===e.length)return 0;if(!(0,i.Sc)(e[0]))return null;const t=e[0].fixedSize;return e.every(e=>(0,i.Sc)(e)&&e.fixedSize===t)?t:null}function A(e){return e.map(e=>u(e)).reduce((e,t)=>null===e||null===t?null:Math.max(e,t),0)}function _(e){var t;const n=e.map(e=>{let[,t]=e;return t}),s=c(n.map(l)),o=null!==(t=c(n.map(u)))&&void 0!==t?t:void 0;return(0,i.xv)((0,r.A)((0,r.A)({},null===s?{getSizeFromValue:t=>e.map(e=>{let[n,r]=e;return(0,i.QM)(t[n],r)}).reduce((e,t)=>e+t,0),maxSize:o}:{fixedSize:s}),{},{write:(t,n,r)=>(e.forEach(e=>{let[i,s]=e;r=s.write(t[i],n,r)}),r)}))}function x(e){var t;const n=e.map(e=>{let[,t]=e;return t}),s=c(n.map(l)),o=null!==(t=c(n.map(u)))&&void 0!==t?t:void 0;return(0,i.$C)((0,r.A)((0,r.A)({},null===s?{maxSize:o}:{fixedSize:s}),{},{read:(t,n)=>{const r={};return e.forEach(e=>{let[i,s]=e;const[o,a]=s.read(t,n);n=a,r[i]=o}),[r,n]}}))}},65015:(e,t,n)=>{"use strict";n.d(t,{Ci:()=>o,J8:()=>a,MU:()=>c});var r=n(73251),i=n(51659),s=n(31479);class o extends i.C{constructor(e){let{body:t,cause:n,details:i,headers:o,status:a,url:c}=e;super("HTTP request failed.",{cause:n,details:i,metaMessages:[a&&"Status: ".concat(a),"URL: ".concat((0,s.I)(c)),t&&"Request body: ".concat((0,r.A)(t))].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=a,this.url=c}}i.C;class a extends i.C{constructor(e){let{body:t,error:n,url:i}=e;super("RPC Request failed.",{cause:n,details:n.message,metaMessages:["URL: ".concat((0,s.I)(i)),"Request body: ".concat((0,r.A)(t))],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=i}}i.C;class c extends i.C{constructor(e){let{body:t,url:n}=e;super("The request took too long to respond.",{details:"The request timed out.",metaMessages:["URL: ".concat((0,s.I)(n)),"Request body: ".concat((0,r.A)(t))],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}},65057:(e,t,n)=>{"use strict";n.d(t,{O:()=>l,_:()=>c});var r=n(94718),i=n(44288),s=n(44154),o=n(11383),a=n(60086);async function c(e,t){return l(e,t)}async function l(e,t){var n,c,l,u;const{block:d,chain:h=e.chain,request:p,type:f="eip1559"}=t||{},g=await(async(t,n,r)=>"function"===typeof(null===h||void 0===h||null===(t=h.fees)||void 0===t?void 0:t.baseFeeMultiplier)?h.fees.baseFeeMultiplier({block:d,client:e,request:p}):null!==(n=null===h||void 0===h||null===(r=h.fees)||void 0===r?void 0:r.baseFeeMultiplier)&&void 0!==n?n:1.2)();if(g<1)throw new r.sM;const m=10**(null!==(n=null===(c=g.toString().split(".")[1])||void 0===c?void 0:c.length)&&void 0!==n?n:0),y=e=>e*BigInt(Math.ceil(g*m))/BigInt(m),v=d||await(0,i.T)(e,o.g,"getBlock")({});if("function"===typeof(null===h||void 0===h||null===(l=h.fees)||void 0===l?void 0:l.estimateFeesPerGas)){const t=await h.fees.estimateFeesPerGas({block:d,client:e,multiply:y,request:p,type:f});if(null!==t)return t}if("eip1559"===f){var w;if("bigint"!==typeof v.baseFeePerGas)throw new r.pw;const t="bigint"===typeof(null===p||void 0===p?void 0:p.maxPriorityFeePerGas)?p.maxPriorityFeePerGas:await(0,s.N)(e,{block:v,chain:h,request:p}),n=y(v.baseFeePerGas);return{maxFeePerGas:null!==(w=null===p||void 0===p?void 0:p.maxFeePerGas)&&void 0!==w?w:n+t,maxPriorityFeePerGas:t}}return{gasPrice:null!==(u=null===p||void 0===p?void 0:p.gasPrice)&&void 0!==u?u:y(await(0,i.T)(e,a.L,"getGasPrice")({}))}}},65747:(e,t,n)=>{"use strict";function r(e){let{dir:t="left"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"===typeof e?e.replace("0x",""):e,r=0;for(let i=0;i<n.length-1&&"0"===n["left"===t?i:n.length-i-1].toString();
2i++)r++;return n="left"===t?n.slice(r):n.slice(0,n.length-r),"string"===typeof e?(1===n.length&&"right"===t&&(n="".concat(n,"0")),"0x".concat(n.length%2===1?"0".concat(n):n)):n}n.d(t,{B:()=>r})},65997:(e,t,n)=>{"use strict";var r=n(57722);var i="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},s=r.useSyncExternalStore,o=r.useRef,a=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=c(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),void 0!==u&&h.hasValue){var t=h.value;if(u(t,e))return o=t}return o=e}if(t=o,i(s,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(s=e,t):(s=e,o=n)}var s,o,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,u]);var p=s(e,d[0],d[1]);return a(function(){h.hasValue=!0,h.value=p},[p]),l(p),p}},66252:(e,t,n)=>{"use strict";n.d(t,{P:()=>f,S:()=>m,a:()=>g,b:()=>y,g:()=>b,p:()=>h,u:()=>k});var r=n(24107),i=n(90034),s=n(57722),o=n(49931),a=n(17488),c=n(51380),l=n(93116),u=n(44131),d=n(99844);const h=e=>{let{address:t,nonce:n}=e;return"".concat(window.location.host," wants you to sign in with your Solana account:\n").concat(t,"\n\n","You are proving you own ".concat(t,"."),"\n\nURI: ").concat(window.location.origin,"\nVersion: 1\nChain ID: mainnet\nNonce: ").concat(n,"\nIssued At: ").concat((new Date).toISOString(),"\nResources:\n- https://privy.io")};let p=(0,s.createContext)({plugins:{current:{}}});const f=e=>{let{children:t}=e,n=(0,s.useRef)({});return(0,i.jsx)(p.Provider,{value:{plugins:n},children:t})},g=()=>{let{plugins:e}=(0,s.useContext)(p);return(0,s.useCallback)(t=>e.current[t],[e])},m=Symbol("solana-funding-plugin"),y=Symbol("solana-ledger-plugin"),v=function(e){var t;let{chainType:n,walletIndex:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(t=null===e||void 0===e?void 0:e.linkedAccounts.filter(e=>!("wallet"!==e.type||"privy"!==e.walletClientType||void 0!==r&&e.walletIndex!==r||void 0!==n&&e.chainType!==n)))&&void 0!==t?t:[]},w=e=>e.reduce((e,t)=>!e||e.walletIndex<t.walletIndex?t:e,null),b=async e=>{let{user:t,accessToken:n,proxy:r,refreshSessionAndUser:i,privy:s,appConfig:a,recoverEmbeddedWallet:c,setUser:d,walletIndex:h,chainType:p,recoveryMethod:f,recoveryPassword:g,recoveryAccessToken:m}=e;if(0===h)if("user-controlled-server-wallets-only"===a.embeddedWallets.mode)await(0,l.v)(s,{request:{chain_type:p}});else if("ethereum"===p){let e=(0,o.c)(t);e&&await c({address:e.address}),await r.create({accessToken:n,solanaAddress:null===e||void 0===e?void 0:e.address,recoveryMethod:f,recoveryPassword:g,recoveryAccessToken:m})}else{if("solana"!==p)throw Error("Invalid input to create wallet");{let e=(0,o.b)(t);e&&await c({address:e.address}),await r.createSolana({accessToken:n,ethereumAddress:null===e||void 0===e?void 0:e.address,recoveryMethod:f,recoveryPassword:g,recoveryAccessToken:m})}}else if("user-controlled-server-wallets-only"===a.embeddedWallets.mode)await(0,l.v)(s,{request:{chain_type:p}});else{let{entropyId:e,entropyIdVerifier:i}=(0,u.g)(t);await c(),await r.addWallet({accessToken:n,entropyId:e,entropyIdVerifier:i,chainType:p,hdWalletIndex:h})}let y=await i(),w=v(y,{chainType:p,walletIndex:h})[0];return d(y),{user:y,account:w}};let A=async e=>{let{accessToken:t,appConfig:n,privy:r,emitPrivyEvent:i,proxy:s,refreshSessionAndUser:a,recoverEmbeddedWallet:l,user:u,walletIndex:d,setModalData:h,openModal:p,chainType:f,setUser:g}=e;if(d<0)throw i("createWallet","onError",c.b.EMBEDDED_WALLET_CREATE_ERROR),Error("A negative walletIndex (".concat(d,") is invalid."));let m=(0,o.g)(u);if(d>0&&!m)throw i("createWallet","onError",c.b.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(n.embeddedWallets.requireUserOwnedRecoveryOnCreate&&"user-controlled-server-wallets-only"===n.embeddedWallets.mode)throw i("createWallet","onError",c.b.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!m&&n.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await _({emitPrivyEvent:i,setModalData:h,openModal:p,chainType:f});let y=v(u,{chainType:f,walletIndex:d})[0];if(y)return{user:u,account:y};if(0===d&&!s)return _({emitPrivyEvent:i,setModalData:h,openModal:p,chainType:f});if(!s)throw i("createWallet","onError",c.b.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return b({appConfig:n,walletIndex:d,chainType:f,user:u,accessToken:t,proxy:s,refreshSessionAndUser:a,privy:r,recoverEmbeddedWallet:l,setUser:g})},_=async e=>
2{let{emitPrivyEvent:t,setModalData:n,openModal:r,chainType:i}=e;return new Promise((e,s)=>{n({createWallet:{onSuccess:n=>{let{user:r,account:i}=n;t("createWallet","onSuccess",{wallet:i}),e({user:r,account:i})},onFailure:e=>{t("createWallet","onError",c.b.UNKNOWN_EMBEDDED_WALLET_ERROR),s(e)},callAuthOnSuccessOnClose:!1,shouldCreateEth:"ethereum"===i,shouldCreateSol:"solana"===i}}),r("EmbeddedWalletOnAccountCreateScreen")})};function x(e){let{create:t}=(()=>{let e=(0,d.u)(),t=(0,a.a)(),{setModalData:n}=(0,o.a)(),{initializeWalletProxy:r,recoverEmbeddedWallet:i,setUser:s,openModal:l,refreshSessionAndUser:u,privy:h,client:p}=(0,c.u)();return{create:async o=>{let{chainType:a,options:f,latestUser:g}=o,m=g;if(m||(m=await u()),!m)throw t("createWallet","onError",c.b.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await(async(e,t,n,r)=>{let{appConfig:i,getAccessToken:s,initializeWalletProxy:o,user:a,privy:l,emitPrivyEvent:u,recoverEmbeddedWallet:d,setModalData:h,openModal:p,setUser:f,options:g,timeoutDuration:m,refreshSessionAndUser:y,chainType:b}=e,[_,x]=await Promise.all([o(m),s()]);if(!x||!a)throw u("createWallet","onError",c.b.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!_&&null!==(t=i.customAuth)&&void 0!==t&&t.enabled)throw u("createWallet","onError",c.b.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(g&&"walletIndex"in g&&"number"==typeof g.walletIndex){if("user-controlled-server-wallets-only"===i.embeddedWallets.mode)throw u("createWallet","onError",c.b.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return A({accessToken:x,appConfig:i,privy:l,emitPrivyEvent:u,openModal:p,proxy:_,refreshSessionAndUser:y,recoverEmbeddedWallet:d,setModalData:h,user:a,walletIndex:g.walletIndex,chainType:b,setUser:f})}let E=g&&"createAdditional"in g&&g.createAdditional,k=v(a,{chainType:b});if(k[0]&&!E)throw u("createWallet","onError",c.b.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return A({accessToken:x,appConfig:i,privy:l,emitPrivyEvent:u,openModal:p,proxy:_,recoverEmbeddedWallet:d,setModalData:h,user:a,walletIndex:(null!==(n=null===(r=w(k))||void 0===r?void 0:r.walletIndex)&&void 0!==n?n:-1)+1,chainType:b,refreshSessionAndUser:y,setUser:f})})({appConfig:e,privy:h,getAccessToken:()=>p.getAccessToken(),refreshSessionAndUser:u,initializeWalletProxy:r,user:m,emitPrivyEvent:t,recoverEmbeddedWallet:i,setModalData:n,openModal:l,setUser:s,options:f,timeoutDuration:d.W,chainType:a})}}})();return(0,a.u)("createWallet",e),{createWallet:async e=>{e&&"target"in e&&e&&(e=void 0);let{account:n}=await t({chainType:"ethereum",options:e});return n}}}const E=()=>{let{user:e}=(0,o.u)(),{client:t,refreshSessionAndUser:n,initializeWalletProxy:r}=(0,c.u)(),i=(0,a.a)(),l=(0,d.u)();return{importWallet:(0,s.useCallback)(s=>{let{privateKey:a,additionalSigners:u}=s;return(async(e,t)=>{let{emitPrivyEvent:n,getAccessToken:r,initializeWalletProxy:i,refreshSessionAndUser:s,user:a,appConfig:l}=e,{privateKey:u,chainType:d,additionalSigners:h}=t;if(!a)throw n("linkAccount","onError",c.b.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new c.a("User must be authenticated before linking an account.");let p="user-controlled-server-wallets-only"===l.embeddedWallets.mode?"tee":"on-device";if(h&&"on-device"===p)throw new c.a("Specifying additionalSigners is only supported for TEE execution and this app uses On-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[f,g]=await Promise.all([r(),i(15e3)]);if(!g||!f)throw n("linkAccount","onError",c.b.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new c.a("User must be authenticated before linking an account.");let{address:m}=await g.importWallet({privateKey:u,accessToken:f,chainType:d,mode:p,additionalSigners:h}),y=await s(),v="solana"===d?(0,o.j)(y):(0,o.f)(y),w=null===v||void 0===v?void 0:v.find(e=>e.address===m);if(!w)throw n("createWallet","onError",c.b.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return n("createWallet","onSuccess",{wallet:w}),w})({getAccessToken:()=>t.getAccessToken(),user:e,initializeWalletProxy:r,refreshSessionAndUser:n,emitPrivyEvent:i,appConfig:l},{privateKey:a,chainType:"ethereum",additionalSigners:u})},[e,t,n,r,i,l])}},k=()=>{let{importWallet:e}=E(),{createWallet:t}=x();return(0,r.A)((0,r.A)({},(0,s.useContext)(o.P)),{},{importWallet:e,createWallet:t})}},66320:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var r=n(51659),i=n(14764);function s(e,t){const n=(e.details||"").toLowerCase(),s=e instanceof r.C?e.walk(e=>(null===e||void 0===e?void 0:e.code)===i.A7.code):e;return s instanceof r.C?new i.A7({cause:e,message:s.details}):i.A7.nodeMessage.test(n)?new i.A7({cause:e,message:e.details}):i.BG.nodeMessage.test(n)?new i.BG({cause:e,maxFeePerGas:null===t||void 0===t?void 0:t.maxFeePerGas}):i.jj.nodeMessage.test(n)?new i.jj({cause:e,maxFeePerGas:null===t||void 0===t?void 0:t.maxFeePerGas}):i.K0.nodeMessage.test(n)?new i.K0({cause:e,nonce:null===t||void 0===t?void 0:t.nonce}):i.Oh.nodeMessage.test(n)?new i.Oh({cause:e,nonce:null===t||void 0===t?void 0:t.nonce}):i.vW.nodeMessage.test(n)?new i.vW({cause:e,nonce:null===t||void 0===t?void 0:t.nonce}):i.k5.nodeMessage.test(n)?new i.k5({cause:e}):i.lY.nodeMessage.test(n)?new i.lY({cause:e,gas:null===t||void 0===t?void 0:t.gas}):i.Fo.nodeMessage.test(n)?new i.Fo({cause:e,gas:null===t||void 0===t?void 0:t.gas}):i.uC.nodeMessage.test(n)?new i.uC({cause:e}):i.lN.nodeMessage.test(n)?new i.lN({cause:e,maxFeePerGas:null===t||void 0===t?void 0:t.maxFeePerGas,maxPriorityFeePerGas:null===t||void 0===t?void 0:t.maxPriorityFeePerGas}):new i.RM({cause:e})}}
2,66398:(e,t,n)=>{"use strict";n.d(t,{F:()=>D,c:()=>K});var r=n(24107),i=n(40767);Math.floor,String.fromCharCode;const s=/#/g,o=/&/g,a=/\//g,c=/=/g,l=/\+/g,u=/%5e/gi,d=/%60/gi,h=/%7c/gi,p=/%20/gi;function f(e){return encodeURI(""+e).replace(h,"|")}function g(e){return f("string"===typeof e?e:JSON.stringify(e)).replace(l,"%2B").replace(p,"+").replace(s,"%23").replace(o,"%26").replace(d,"`").replace(u,"^").replace(a,"%2F")}function m(e){return g(e).replace(c,"%3D")}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{return decodeURIComponent(""+e)}catch(t){return""+e}}function v(e){return y(e.replace(l," "))}function w(e){return y(e.replace(l," "))}function b(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=Object.create(null);"?"===e[0]&&(e=e.slice(1));for(const n of e.split("&")){const e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;const r=v(e[1]);if("__proto__"===r||"constructor"===r)continue;const i=w(e[2]||"");void 0===t[r]?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function A(e){return Object.keys(e).filter(t=>void 0!==e[t]).map(t=>{return n=t,"number"!==typeof(r=e[t])&&"boolean"!==typeof r||(r=String(r)),r?Array.isArray(r)?r.map(e=>"".concat(m(n),"=").concat(g(e))).join("&"):"".concat(m(n),"=").concat(g(r)):m(n);var n,r}).filter(Boolean).join("&")}const _=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,x=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,E=/^([/\\]\s*){2,}[^/\\]/,k=/\/$|\/\?|\/#/,S=/^\.?\//;function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"boolean"===typeof t&&(t={acceptRelative:t}),t.strict?_.test(e):x.test(e)||!!t.acceptRelative&&E.test(e)}function T(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(arguments.length>1?arguments[1]:void 0)?k.test(e):e.endsWith("/")}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!(arguments.length>1?arguments[1]:void 0))return(T(e)?e.slice(0,-1):e)||"/";if(!T(e,!0))return e||"/";let t=e,n="";const r=e.indexOf("#");-1!==r&&(t=e.slice(0,r),n=e.slice(r));const[i,...s]=t.split("?");return((i.endsWith("/")?i.slice(0,-1):i)||"/")+(s.length>0?"?".concat(s.join("?")):"")+n}function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!(arguments.length>1?arguments[1]:void 0))return e.endsWith("/")?e:e+"/";if(T(e,!0))return e||"/";let t=e,n="";const r=e.indexOf("#");if(-1!==r&&(t=e.slice(0,r),n=e.slice(r),!t))return n;const[i,...s]=t.split("?");return i+"/"+(s.length>0?"?".concat(s.join("?")):"")+n}function O(e,t){if(N(t)||I(e))return e;const n=C(t);return e.startsWith(n)?e:function(e){let t=e||"";for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(const s of r.filter(e=>R(e)))if(t){const e=s.replace(S,"");t=P(t)+e}else t=s;return t}(n,e)}function N(e){return!e||"/"===e}function R(e){return e&&"/"!==e}const M=Symbol.for("ufo:protocolRelative");function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;const n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,e,t=""]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:"",host:"",search:"",hash:""}}if(!I(e,{acceptRelative:!0}))return t?U(t+e):L(e);const[,r="",i,s=""]=e.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,o="",a=""]=s.match(/([^#/?]*)(.*)?/)||[];"file:"===r&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:c,search:l,hash:u}=L(a);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:o,pathname:c,search:l,hash:u,[M]:!r}}function L(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t="",n="",r=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function B(e){const t=e.pathname||"",n=e.search?(e.search.startsWith("?")?"":"?")+e.search:"",r=e.hash||"",i=e.auth?e.auth+"@":"",s=e.host||"";return(e.protocol||e[M]?(e.protocol||"")+"//":"")+i+s+t+n+r}class D extends Error{constructor(e,t){super(e,t),this.name="FetchError",null!==t&&void 0!==t&&t.cause&&!this.cause&&(this.cause=t.cause)}}const j=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function F(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"GET";return j.has(e.toUpperCase())}const z=new Set(["image/svg","application/xml","application/xhtml","application/html"]),W=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function q(e,t,n,i){var s;const o=function(e,t,n){if(!t)return new n(e);const r=new n(t);if(e)for(const[i,s]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(i,s);return r}(null!==(s=null===t||void 0===t?void 0:t.headers)&&void 0!==s?s:null===e||void 0===e?void 0:e.headers,null===n||void 0===n?void 0:n.headers,i);let a;return(null!==n&&void 0!==n&&n.query||null!==n&&void 0!==n&&n.params||null!==t&&void 0!==t&&t.params||null!==t&&void 0!==t&&t.query)&&(a=(0,r.A)((0,r.A)((0,r.A)((0,r.A)({},null===n||void 0===n?void 0:n.params),null===n||void 0===n?void 0:n.query),null===t||void 0===t?void 0:t.params),null===t||void 0===t?void 0:t.query)),(0,r.A)((0,r.A)((0,r.A)({},n),t),{},{query:a,params:a,headers:o})}async function H(e,t){if(t)if(Array.isArray(t))for(const n of t)await n(e);else await t(e)}const V=new Set([408,409,425,429,500,502,503,504]),G=new Set([101,204,205,304]);function K(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:s=globalThis.AbortController}=e;async function o(e){const t=e.error&&"AbortError"===e.error.name&&!e.options.timeout||!1;if(!1!==e.options.retry&&!t){let t;
2t="number"===typeof e.options.retry?e.options.retry:F(e.options.method)?0:1;const n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):V.has(n))){const n="function"===typeof e.options.retryDelay?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,(0,r.A)((0,r.A)({},e.options),{},{retry:t-1}))}}const n=function(e){var t,n,r,i,s;const o=(null===(t=e.error)||void 0===t?void 0:t.message)||(null===(n=e.error)||void 0===n?void 0:n.toString())||"",a=(null===(r=e.request)||void 0===r?void 0:r.method)||(null===(i=e.options)||void 0===i?void 0:i.method)||"GET",c=(null===(s=e.request)||void 0===s?void 0:s.url)||String(e.request)||"/",l="[".concat(a,"] ").concat(JSON.stringify(c)),u=e.response?"".concat(e.response.status," ").concat(e.response.statusText):"<no response>",d="".concat(l,": ").concat(u).concat(o?" ".concat(o):""),h=new D(d,e.error?{cause:e.error}:void 0);for(const p of["request","options","response"])Object.defineProperty(h,p,{get:()=>e[p]});for(const[p,f]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(h,p,{get:()=>e.response&&e.response[f]});return h}(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}const a=async function(a){const c={request:a,options:q(a,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e.defaults,n),response:void 0,error:void 0};if(c.options.method&&(c.options.method=c.options.method.toUpperCase()),c.options.onRequest&&(await H(c,c.options.onRequest),c.options.headers instanceof n||(c.options.headers=new n(c.options.headers||{}))),"string"===typeof c.request&&(c.options.baseURL&&(c.request=O(c.request,c.options.baseURL)),c.options.query&&(c.request=function(e,t){const n=U(e),i=(0,r.A)((0,r.A)({},b(n.search)),t);return n.search=A(i),B(n)}(c.request,c.options.query),delete c.options.query),"query"in c.options&&delete c.options.query,"params"in c.options&&delete c.options.params),c.options.body&&F(c.options.method))if(function(e){if(void 0===e)return!1;const t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&!(e instanceof FormData||e instanceof URLSearchParams)&&(e.constructor&&"Object"===e.constructor.name||"function"===typeof e.toJSON))}(c.options.body)){const e=c.options.headers.get("content-type");"string"!==typeof c.options.body&&(c.options.body="application/x-www-form-urlencoded"===e?new URLSearchParams(c.options.body).toString():JSON.stringify(c.options.body)),e||c.options.headers.set("content-type","application/json"),c.options.headers.has("accept")||c.options.headers.set("accept","application/json")}else("pipeTo"in c.options.body&&"function"===typeof c.options.body.pipeTo||"function"===typeof c.options.body.pipe)&&("duplex"in c.options||(c.options.duplex="half"));let l;if(!c.options.signal&&c.options.timeout){const e=new s;l=setTimeout(()=>{const t=new Error("[TimeoutError]: The operation was aborted due to timeout");t.name="TimeoutError",t.code=23,e.abort(t)},c.options.timeout),c.options.signal=e.signal}try{c.response=await t(c.request,c.options)}catch(u){return c.error=u,c.options.onRequestError&&await H(c,c.options.onRequestError),await o(c)}finally{l&&clearTimeout(l)}if((c.response.body||c.response._bodyInit)&&!G.has(c.response.status)&&"HEAD"!==c.options.method){const e=(c.options.parseResponse?"json":c.options.responseType)||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)return"json";const t=e.split(";").shift()||"";return W.test(t)?"json":"text/event-stream"===t?"stream":z.has(t)||t.startsWith("text/")?"text":"blob"}(c.response.headers.get("content-type")||"");switch(e){case"json":{const e=await c.response.text(),t=c.options.parseResponse||i.Ay;c.response._data=t(e);break}case"stream":c.response._data=c.response.body||c.response._bodyInit;break;default:c.response._data=await c.response[e]()}}return c.options.onResponse&&await H(c,c.options.onResponse),!c.options.ignoreResponseError&&c.response.status>=400&&c.response.status<600?(c.options.onResponseError&&await H(c,c.options.onResponseError),await o(c)):c.response},c=async function(e,t){return(await a(e,t))._data};return c.raw=a,c.native=function(){return t(...arguments)},c.create=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return K((0,r.A)((0,r.A)((0,r.A)({},e),n),{},{defaults:(0,r.A)((0,r.A)((0,r.A)({},e.defaults),n.defaults),t)}))},c}},66601:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(t){return'"[Circular]"'}}e.exports=function(e,n,r){var i=r&&r.stringify||t;if("object"===typeof e&&null!==e){var s=n.length+1;if(1===s)return e;var o=new Array(s);o[0]=i(e);for(var a=1;a<s;a++)o[a]=i(n[a]);return o.join(" ")}if("string"!==typeof e)return e;var c=n.length;if(0===c)return e;for(var l="",u=0,d=-1,h=e&&e.length||0,p=0;p<h;){if(37===e.charCodeAt(p)&&p+1<h){switch(d=d>-1?d:0,e.charCodeAt(p+1)){case 100:case 102:if(u>=c)break;if(null==n[u])break;d<p&&(l+=e.slice(d,p)),l+=Number(n[u]),d=p+2,p++;break;case 105:if(u>=c)break;if(null==n[u])break;d<p&&(l+=e.slice(d,p)),l+=Math.floor(Number(n[u])),d=p+2,p++;break;case 79:case 111:case 106:if(u>=c)break;if(void 0===n[u])break;d<p&&(l+=e.slice(d,p));var f=typeof n[u];if("string"===f){l+="'"+n[u]+"'",d=p+2,p++;break}if("function"===f){l+=n[u].name||"<anonymous>",d=p+2,p++;break}l+=i(n[u]),d=p+2,p++;break;case 115:if(u>=c)break;d<p&&(l+=e.slice(d,p)),l+=String(n[u]),d=p+2,p++;break;case 37:d<p&&(l+=e.slice(d,p)),l+="%",d=p+2,p++,u--}++u}++p}if(-1===d)return e;d<h&&(l+=e.slice(d));return l}},66719:(e,t,n)=>{"use strict";n.d(t,{y:()=>s});var r=n(63015),i=n(652);async function s(e,t){let{address:n,blockTag:s="latest",blockNumber:o}=t;const a=await e.request({method:"eth_getTransactionCount",params:[n,"bigint"===typeof o?(0,i.cK)(o):s]},{dedupe:Boolean(o)});return(0,r.ME)(a)}},66751:(e,t,n)=>{"use strict";n.d(t,{VY:()=>y,rU:()=>g});var r=n(24107),i=n(15882),s=n(57722),o=n(72582),a=n(73660),c=n(82504),l=n(6642),u=n(48117),d=n(31445);const h=["id"];let p=(0,s.createContext)(null);function f(){let e=(0,s.useContext)(p);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,f),e}return e}
2function g(){let[e,t]=(0,s.useState)([]);return[e.length>0?e.join(" "):void 0,(0,s.useMemo)(()=>function(e){let n=(0,o._)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),r=(0,s.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return s.createElement(p.Provider,{value:r},e.children)},[t])]}p.displayName="DescriptionContext";let m=(0,d.FX)(function(e,t){let n=(0,s.useId)(),o=(0,u._)(),{id:p="headlessui-description-".concat(n)}=e,g=(0,i.A)(e,h),m=f(),y=(0,l.P)(t);(0,a.s)(()=>m.register(p),[p,m.register]);let v=(0,c._)((0,r.A)((0,r.A)({},m.slot),{},{disabled:o||!1})),w=(0,r.A)((0,r.A)({ref:y},m.props),{},{id:p});return(0,d.Ci)()({ourProps:w,theirProps:g,slot:v,defaultTag:"p",name:m.name||"Description"})}),y=Object.assign(m,{})},67456:(e,t,n)=>{"use strict";n.d(t,{Bm:()=>o,Di:()=>c,K9:()=>a});var r=n(75581),i=n(46755),s=n(27999);const o=(e,t,n,o)=>{let c=Number(e),l=t.find(e=>e.id===c);if(!l)throw new s.g1("Unsupported chainId ".concat(e),4901);return(0,r.l)({transport:(0,i.L)(a(l,n,o.appId)),chain:l})},a=(e,t,n)=>{var r,i,o;let a,c=e.id,l=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])a=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[l])a=t.rpcUrls[l];else if(null!==(r=e.rpcUrls.privy)&&void 0!==r&&r.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",n),a=t.toString()}else a=null!==(i=e.rpcUrls.public)&&void 0!==i&&i.http[0]?e.rpcUrls.public.http[0]:null===(o=e.rpcUrls.default)||void 0===o?void 0:o.http[0];if(!a)throw new s.g1("No RPC url found for ".concat(c));return a};function c(e){let{currentRecoveryMethod:t,upgradeToRecoveryMethod:n}=e;switch(t){case"privy":case"user-passcode":case"recovery-encryption-key":return!0;case"icloud":case"google-drive":if(t===n)throw Error("Cannot upgrade to the existing cloud platform");return!0;default:throw Error("Unknown recovery method")}}},67735:e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!==typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,function(e){return(e<16?"0":"")+e.toString(16)}).join("")},debugPrint:function(e,n,r){let i="\n"+e+" = ";for(let s=0;s<n.length;s+=2){if(32===r)i+=t(n[s]).toUpperCase(),i+=" ",i+=t(n[s+1]).toUpperCase();else{if(64!==r)throw new Error("Invalid size "+r);i+=t(n[s+1]).toUpperCase(),i+=t(n[s]).toUpperCase()}s%6===4?i+="\n"+new Array(e.length+4).join(" "):s<n.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,n){let r=(new Date).getTime();const i=new Uint8Array(t);for(let o=0;o<t;o++)i[o]=o%256;const s=(new Date).getTime();console.log("Generated random input in "+(s-r)+"ms"),r=s;for(let o=0;o<n;o++){const n=e(i),s=(new Date).getTime(),o=s-r;r=s,console.log("Hashed in "+o+"ms: "+n.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(o/1e3)*100)/100+" MB PER SECOND")}}}},67775:(e,t,n)=>{"use strict";n.d(t,{D:()=>r});var r=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(r||{})},67821:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>r,gn:()=>s,wE:()=>i});class r extends Error{constructor(e){let{error:t,code:n}=e;super(t),this.error=t,this.code=n}}class i extends Error{constructor(e){let{error:t,code:n}=e;super(t),this.code=n,this.error=t}}class s extends Error{constructor(e){let{error:t,code:n,response:r}=e;super(t),this.code=n,this.error=t,this.response=r}}},67885:(e,t,n)=>{"use strict";n.d(t,{M:()=>i});var r=n(52763);function i(e){var t;let{blockNumber:n,chain:i,contract:s}=e;const o=null===i||void 0===i||null===(t=i.contracts)||void 0===t?void 0:t[s];if(!o)throw new r.rj({chain:i,contract:{name:s}});if(n&&o.blockCreated&&o.blockCreated>n)throw new r.rj({blockNumber:n,chain:i,contract:{name:s,blockCreated:o.blockCreated}});return o.address}},68337:(e,t,n)=>{"use strict";n.d(t,{w:()=>i});var r=n(14825);function i(e,t){let{emitOnBegin:n,initialWaitTime:i,interval:s}=t,o=!0;const a=()=>o=!1;return(async()=>{var t;let c;n&&(c=await e({unpoll:a}));const l=null!==(t=await(null===i||void 0===i?void 0:i(c)))&&void 0!==t?t:s;await(0,r.u)(l);const u=async()=>{o&&(await e({unpoll:a}),await(0,r.u)(s),u())};u()})(),a}},68419:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,B:()=>i});var r=n(18656);function i(e){let{includeName:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new r.d_(e.type);return"".concat(e.name,"(").concat(s(e.inputs,{includeName:t}),")")}function s(e){let{includeName:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e.map(e=>function(e,t){let{includeName:n}=t;if(e.type.startsWith("tuple"))return"(".concat(s(e.components,{includeName:n}),")").concat(e.type.slice(5));return e.type+(n&&e.name?" ".concat(e.name):"")}(e,{includeName:t})).join(t?", ":","):""}}
2,69314:(e,t,n)=>{"use strict";n.d(t,{PL:()=>d,Qe:()=>f,VI:()=>h,eC:()=>p,eh:()=>g,tD:()=>l,vU:()=>u});var r=n(10860),i=n(41684);function s(e,t,n,i){if(i<t||i>n)throw new r.tsw(r.hMG,{codecDescription:e,max:n,min:t,value:i})}function o(e){return 1!==(null===e||void 0===e?void 0:e.endian)}function a(e){return(0,i.xv)({fixedSize:e.size,write(t,n,r){e.range&&s(e.name,e.range[0],e.range[1],t);const i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,o(e.config)),n.set(new Uint8Array(i),r),r+e.size}})}function c(e){return(0,i.$C)({fixedSize:e.size,read(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,i.xL)(e.name,t,n),(0,i.C1)(e.name,e.size,t,n);const r=new DataView(function(e,t,n){const r=e.byteOffset+(null!==t&&void 0!==t?t:0),i=null!==n&&void 0!==n?n:e.byteLength;return e.buffer.slice(r,r+i)}(t,n,e.size));return[e.get(r,o(e.config)),n+e.size]}})}var l=()=>(0,i.xv)({getSizeFromValue:e=>e<=127?1:e<=16383?2:3,maxSize:3,write:(e,t,n)=>{s("shortU16",0,65535,e);const r=[0];for(let i=0;;i+=1){const t=Number(e)>>7*i;if(0===t)break;const n=127&t;r[i]=n,i>0&&(r[i-1]|=128)}return t.set(r,n),n+r.length}}),u=()=>(0,i.$C)({maxSize:3,read:(e,t)=>{let n=0,r=0;for(;++r;){const i=r-1,s=e[t+i];if(n|=(127&s)<<7*i,0===(128&s))break}return[n,t+r]}}),d=function(){return a({config:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},name:"u32",range:[0,Number("0xffffffff")],set:(e,t,n)=>e.setUint32(0,Number(t),n),size:4})},h=function(){return c({config:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},get:(e,t)=>e.getUint32(0,t),name:"u32",size:4})},p=function(){return a({config:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(e,t,n)=>e.setBigUint64(0,BigInt(t),n),size:8})},f=()=>a({name:"u8",range:[0,Number("0xff")],set:(e,t)=>e.setUint8(0,Number(t)),size:1}),g=()=>c({get:e=>e.getUint8(0),name:"u8",size:1})},69523:(e,t,n)=>{"use strict";n.d(t,{$:()=>u,A:()=>i,B:()=>te,C:()=>ie,D:()=>X,E:()=>$,F:()=>ee,G:()=>k,H:()=>P,I:()=>l,J:()=>f,K:()=>B,L:()=>b,M:()=>Q,N:()=>ce,O:()=>se,P:()=>oe,Q:()=>ae,R:()=>s,S:()=>o,T:()=>a,U:()=>c,V:()=>d,W:()=>h,X:()=>D,Y:()=>g,Z:()=>Y,_:()=>A,a:()=>E,a0:()=>R,a1:()=>I,a2:()=>p,a3:()=>le,a4:()=>ue,a8:()=>z,a9:()=>F,aa:()=>j,b:()=>_,c:()=>v,d:()=>m,e:()=>w,f:()=>y,g:()=>L,h:()=>M,i:()=>K,j:()=>G,k:()=>V,l:()=>H,m:()=>q,n:()=>W,o:()=>U,p:()=>x,q:()=>O,r:()=>C,s:()=>T,t:()=>N,u:()=>S,v:()=>J,w:()=>Z,x:()=>ne,y:()=>re,z:()=>r});const r="/api/v1/sessions",i="/api/v1/sessions/logout",s="/api/v1/siwe/init",o="/api/v1/siwe/authenticate",a="/api/v1/siwe/link",c="/api/v1/siwe/link_smart_wallet",l="/api/v1/siwe/unlink",u="/api/v1/siwe/transfer",d="/api/v1/siws/init",h="/api/v1/siws/authenticate",p="/api/v1/siws/link",f="/api/v1/siws/unlink",g="/api/v1/siws/transfer",m="/api/v1/farcaster/init",y="/api/v1/farcaster/authenticate",v="/api/v1/farcaster/link",w="/api/v1/farcaster/status",b="/api/v1/farcaster/unlink",A="/api/v1/farcaster/transfer",_="/api/v1/passwordless/init",x="/api/v1/passwordless/authenticate",E="/api/v1/passwordless/link",k="/api/v1/passwordless/unlink",S="/api/v1/passwordless/update",I="/api/v1/passwordless/transfer",T="/api/v1/passwordless_sms/init",C="/api/v1/passwordless_sms/link",P="/api/v1/passwordless_sms/unlink",O="/api/v1/passwordless_sms/authenticate",N="/api/v1/passwordless_sms/update",R="/api/v1/passwordless_sms/transfer",M="/api/v1/oauth/init",U="/api/v1/oauth/authenticate",L="/api/v1/oauth/link",B="/api/v1/oauth/unlink",D="/api/v1/oauth/transfer",j="/api/v1/recovery/oauth/init",F="/api/v1/recovery/oauth/init_icloud",z="/api/v1/recovery/oauth/authenticate",W="/api/v1/passkeys/link/init",q="/api/v1/passkeys/authenticate/init",H="/api/v1/passkeys/register/init",V="/api/v1/passkeys/link",G="/api/v1/passkeys/authenticate",K="/api/v1/passkeys/register",J="/api/v1/telegram/authenticate",Z="/api/v1/telegram/link",Q="/api/v1/telegram/unlink",Y="/api/v1/telegram/transfer",X="/api/v1/mfa/passwordless_sms/init",$="/api/v1/mfa/passkeys/init",ee="/api/v1/users/me/accept_terms",te="/api/v1/analytics_events",ne="/api/v1/custom_jwt_account/authenticate",re="/api/v1/custom_jwt_account/link",ie="/api/v1/guest/authenticate",se="/api/v1/plugins/moonpay_on_ramp/sign",oe="/api/v1/funding/coinbase_on_ramp/init",ae="/api/v1/funding/coinbase_on_ramp/status",ce="/api/v1/wallets/revoke",le="/api/v1/users/me",ue="/api/v1/scan/transaction"},69692:e=>{"use strict";var t,n="object"===typeof Reflect?Reflect:null,r=n&&"function"===typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"===typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t,n){"function"===typeof e.on&&g(e,"error",t,n)}(e,i,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,s,o,l;if(a(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"===typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):f(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"===typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!==typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){r.once&&e.removeEventListener(t,i),n(s)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o}
2,set:function(e){if("number"!==typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(void 0===c)return!1;if("function"===typeof c)r(c,this,t);else{var l=c.length,u=f(c,l);for(n=0;n<l;++n)r(u[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,s,o;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!==typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},69856:(e,t,n)=>{"use strict";n.d(t,{X9:()=>o,s7:()=>i,x8:()=>s});var r=n(12379);class i extends r.C{constructor(e){let{signature:t,type:n}=e;super("Invalid ".concat(n," signature."),{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class s extends r.C{constructor(e){let{signature:t}=e;super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class o extends r.C{constructor(e){let{signature:t}=e;super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}},69886:(e,t,n)=>{"use strict";n.d(t,{IX:()=>u,Rx:()=>p,v:()=>f});var r=n(50022),i=n(72735),s=n(61395),o=n(5843),a=n(3756),c=n(76058),l=n(61314);const u={prod:{url:"https://api.moonpay.com/v1",key:"pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL"},sandbox:{url:"https://api.moonpay.com/v1",key:"pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI"}};let d=new Set([a.r.id,r.D.id,s.E.id,l.n.id,i.m.id,o.A.id]),h=new Set([a.r.id,r.D.id,c.R.id,s.E.id,l.n.id,i.m.id]);function p(e,t){switch(t){case"native-currency":return d.has(e);case"USDC":return h.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}}function f(e,t){switch(e){case r.D.id:return"native-currency"===t?"ETH_ARBITRUM":"USDC_ARBITRUM";case i.m.id:return"native-currency"===t?"AVAX_CCHAIN":"USDC_CCHAIN";case s.E.id:return"native-currency"===t?"ETH_BASE":"USDC_BASE";case o.A.id:return"CELO_CELO";case l.n.id:return"native-currency"===t?"MATIC_POLYGON":"USDC_POLYGON";case a.r.id:return"native-currency"===t?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn("Chain ".concat(e," not supported by Moonpay, defaulting to Ethereum mainnet")),"ETH_ETHEREUM"}}},70121:(e,t)=>{"use strict";function n(e){let t;return"undefined"!==typeof window&&"undefined"!==typeof window[e]&&(t=window[e]),t}function r(e){const t=n(e);if(!t)throw new Error("".concat(e," is not defined in Window"));return t}
2Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=n,t.getFromWindowOrThrow=r,t.getDocumentOrThrow=function(){return r("document")},t.getDocument=function(){return n("document")},t.getNavigatorOrThrow=function(){return r("navigator")},t.getNavigator=function(){return n("navigator")},t.getLocationOrThrow=function(){return r("location")},t.getLocation=function(){return n("location")},t.getCryptoOrThrow=function(){return r("crypto")},t.getCrypto=function(){return n("crypto")},t.getLocalStorageOrThrow=function(){return r("localStorage")},t.getLocalStorage=function(){return n("localStorage")}},70293:(e,t,n)=>{"use strict";n.d(t,{h:()=>l});var r=n(25741),i=n(3717),s=n(93401),o=n(44288),a=n(97562),c=n(66719);async function l(e,t){var n,l,u;const{account:d=e.account,chainId:h,nonce:p}=t;if(!d)throw new i.T({docsPath:"/docs/eip7702/prepareAuthorization"});const f=(0,r.J)(d),g=(()=>{if(t.executor)return"self"===t.executor?t.executor:(0,r.J)(t.executor)})(),m={address:null!==(n=t.contractAddress)&&void 0!==n?n:t.address,chainId:h,nonce:p};return"undefined"===typeof m.chainId&&(m.chainId=null!==(l=null===(u=e.chain)||void 0===u?void 0:u.id)&&void 0!==l?l:await(0,o.T)(e,a.T,"getChainId")({})),"undefined"===typeof m.nonce&&(m.nonce=await(0,o.T)(e,c.y,"getTransactionCount")({address:f.address,blockTag:"pending"}),("self"===g||null!==g&&void 0!==g&&g.address&&(0,s.h)(g.address,f.address))&&(m.nonce+=1)),m}},70495:(e,t,n)=>{"use strict";function r(){let e=()=>{},t=()=>{};return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}n.d(t,{Y:()=>r})},70759:(e,t,n)=>{"use strict";n.d(t,{h:()=>g,k:()=>v});var r=n(24107),i=n(18656),s=n(23422),o=n(51659),a=n(14393),c=n(27133),l=n(73183),u=n(61398),d=n(1490),h=n(14061),p=n(652),f=n(58721);function g(e,t){if(e.length!==t.length)throw new i.YE({expectedLength:e.length,givenLength:t.length});const n=function(e){let{params:t,values:n}=e;const r=[];for(let i=0;i<t.length;i++)r.push(m({param:t[i],value:n[i]}));return r}({params:e,values:t}),r=y(n);return 0===r.length?"0x":r}function m(e){let{param:t,value:n}=e;const g=v(t.type);if(g){const[e,s]=g;return function(e,t){let{length:n,param:r}=t;const s=null===n;if(!Array.isArray(e))throw new i.dm(e);if(!s&&e.length!==n)throw new i.Nc({expectedLength:n,givenLength:e.length,type:"".concat(r.type,"[").concat(n,"]")});let o=!1;const a=[];for(let i=0;i<e.length;i++){const t=m({param:r,value:e[i]});t.dynamic&&(o=!0),a.push(t)}if(s||o){const e=y(a);if(s){const t=(0,p.cK)(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?(0,l.xW)([t,e]):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,l.xW)(a.map(e=>{let{encoded:t}=e;return t}))}}(n,{length:e,param:(0,r.A)((0,r.A)({},t),{},{type:s})})}if("tuple"===t.type)return function(e,t){let{param:n}=t,r=!1;const i=[];for(let s=0;s<n.components.length;s++){const t=n.components[s],o=m({param:t,value:e[Array.isArray(e)?s:t.name]});i.push(o),o.dynamic&&(r=!0)}return{dynamic:r,encoded:r?y(i):(0,l.xW)(i.map(e=>{let{encoded:t}=e;return t}))}}(n,{param:t});if("address"===t.type)return function(e){if(!(0,c.P)(e))throw new s.M({address:e});return{dynamic:!1,encoded:(0,u.db)(e.toLowerCase())}}(n);if("bool"===t.type)return function(e){if("boolean"!==typeof e)throw new o.C('Invalid boolean value: "'.concat(e,'" (type: ').concat(typeof e,"). Expected: `true` or `false`."));return{dynamic:!1,encoded:(0,u.db)((0,p.$P)(e))}}(n);if(t.type.startsWith("uint")||t.type.startsWith("int")){var w;const e=t.type.startsWith("int"),[,,r="256"]=null!==(w=f.Ge.exec(t.type))&&void 0!==w?w:[];return function(e,t){let{signed:n,size:r=256}=t;if("number"===typeof r){const t=2n**(BigInt(r)-(n?1n:0n))-1n,i=n?-t-1n:0n;if(e>t||e<i)throw new a.Ty({max:t.toString(),min:i.toString(),signed:n,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:(0,p.cK)(e,{size:32,signed:n})}}(n,{signed:e,size:Number(r)})}if(t.type.startsWith("bytes"))return function(e,t){let{param:n}=t;const[,r]=n.type.split("bytes"),s=(0,d.E)(e);if(!r){let t=e;return s%32!==0&&(t=(0,u.db)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,l.xW)([(0,u.db)((0,p.cK)(s,{size:32})),t])}}if(s!==Number.parseInt(r,10))throw new i.gH({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:(0,u.db)(e,{dir:"right"})}}(n,{param:t});if("string"===t.type)return function(e){const t=(0,p.i3)(e),n=Math.ceil((0,d.E)(t)/32),r=[];for(let i=0;i<n;i++)r.push((0,u.db)((0,h.di)(t,32*i,32*(i+1)),{dir:"right"}));return{dynamic:!0,encoded:(0,l.xW)([(0,u.db)((0,p.cK)((0,d.E)(t),{size:32})),...r])}}(n);throw new i.nK(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function y(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:n,encoded:r}=e[s];t+=n?32:(0,d.E)(r)}const n=[],r=[];let i=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?(n.push((0,p.cK)(t+i,{size:32})),r.push(a),i+=(0,d.E)(a)):n.push(a)}return(0,l.xW)([...n,...r])}function v(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}},70822:(e,t,n)=>{"use strict";n.d(t,{F:()=>F});var r=n(24107),i=n(59388),s=n(52431),o=n(97562),a=n(652);var c=n(15882),l=n(78686),u=n(38254);const d=["abi","args","bytecode"];var h=n(10133);var p=n(5269),f=n(25741);var g=n(70293),m=n(4386);var y=n(21839),v=n(14177);
2var w=n(75470),b=n(93341),A=n(3717),_=n(51659),x=n(41226),E=n(6259),k=n(84090),S=n(81946),I=n(99705),T=n(56523),C=n(44288),P=n(6195),O=n(45226),N=n(1212);const R=["account","chain","accessList","authorizationList","blobs","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","nonce","pollingInterval","throwOnReceiptRevert","type","value"],M=new P.A(128);async function U(e,t){var n,i;const{account:s=e.account,chain:a=e.chain,accessList:l,authorizationList:u,blobs:d,data:h,gas:p,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:P,pollingInterval:U,throwOnReceiptRevert:L,type:B,value:D}=t,j=(0,c.A)(t,R),F=null!==(n=t.timeout)&&void 0!==n?n:Math.max(3*(null!==(i=null===a||void 0===a?void 0:a.blockTime)&&void 0!==i?i:0),5e3);if("undefined"===typeof s)throw new A.T({docsPath:"/docs/actions/wallet/sendTransactionSync"});const z=s?(0,f.J)(s):null;try{(0,O.c)(t);const n=await(async()=>t.to?t.to:null!==t.to&&u&&u.length>0?await(0,E.g)({authorization:u[0]}).catch(()=>{throw new _.C("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if("json-rpc"===(null===z||void 0===z?void 0:z.type)||null===z){var W;let t;null!==a&&(t=await(0,C.T)(e,o.T,"getChainId")({}),(0,k.v)({currentChainId:t,chain:a}));const i=null===(W=e.chain)||void 0===W||null===(W=W.formatters)||void 0===W||null===(W=W.transactionRequest)||void 0===W?void 0:W.format,s=(i||T.Bv)((0,r.A)((0,r.A)({},(0,I.o)(j,{format:i})),{},{accessList:l,account:z,authorizationList:u,blobs:d,chainId:t,data:h,gas:p,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:P,to:n,type:B,value:D}),"sendTransaction"),c=M.get(e.uid),f=c?"wallet_sendTransaction":"eth_sendTransaction",m=await(async()=>{try{return await e.request({method:f,params:[s]},{retryCount:0})}catch(t){if(!1===c)throw t;const n=t;if("InvalidInputRpcError"===n.name||"InvalidParamsRpcError"===n.name||"MethodNotFoundRpcError"===n.name||"MethodNotSupportedRpcError"===n.name)return await e.request({method:"wallet_sendTransaction",params:[s]},{retryCount:0}).then(t=>(M.set(e.uid,!0),t)).catch(t=>{const r=t;if("MethodNotFoundRpcError"===r.name||"MethodNotSupportedRpcError"===r.name)throw M.set(e.uid,!1),n;throw r});throw n}})(),b=await(0,C.T)(e,N.n,"waitForTransactionReceipt")({checkReplacement:!1,hash:m,pollingInterval:U,timeout:F});if(L&&"reverted"===b.status)throw new x.Sq({receipt:b});return b}if("local"===(null===z||void 0===z?void 0:z.type)){var q;const t=await(0,C.T)(e,m.ft,"prepareTransactionRequest")((0,r.A)((0,r.A)({account:z,accessList:l,authorizationList:u,blobs:d,chain:a,data:h,gas:p,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:P,nonceManager:z.nonceManager,parameters:[...m.MM,"sidecars"],type:B,value:D},j),{},{to:n})),i=null===a||void 0===a||null===(q=a.serializers)||void 0===q?void 0:q.transaction,s=await z.signTransaction(t,{serializer:i});return await(0,C.T)(e,b.s,"sendRawTransactionSync")({serializedTransaction:s,throwOnReceiptRevert:L})}if("smart"===(null===z||void 0===z?void 0:z.type))throw new A.Z({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new A.Z({docsPath:"/docs/actions/wallet/sendTransactionSync",type:null===z||void 0===z?void 0:z.type})}catch(H){if(H instanceof A.Z)throw H;throw(0,S.p)(H,(0,r.A)((0,r.A)({},t),{},{account:z,chain:t.chain||void 0}))}}var L=n(36679),B=n(87315);var D=n(47197);function j(e){return{addChain:t=>async function(e,t){let{chain:n}=t;const{id:r,name:i,nativeCurrency:s,rpcUrls:o,blockExplorers:c}=n;await e.request({method:"wallet_addEthereumChain",params:[{chainId:(0,a.cK)(r),chainName:i,nativeCurrency:s,rpcUrls:o.default.http,blockExplorerUrls:c?Object.values(c).map(e=>{let{url:t}=e;return t}):void 0}]},{dedupe:!0,retryCount:0})}(e,t),deployContract:t=>function(e,t){const{abi:n,args:i,bytecode:s}=t,o=(0,c.A)(t,d),a=(0,l.m)({abi:n,args:i,bytecode:s});return(0,u.v)(e,(0,r.A)((0,r.A)((0,r.A)({},o),o.authorizationList?{to:null}:{}),{},{data:a}))}(e,t),fillTransaction:t=>(0,s.a)(e,t),getAddresses:()=>async function(e){var t;return"local"===(null===(t=e.account)||void 0===t?void 0:t.type)?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(e=>(0,h.o)(e))}(e),getCallsStatus:t=>(0,p.k)(e,t),getCapabilities:t=>async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{account:n=e.account,chainId:r}=t,i=n?(0,f.J)(n):void 0,s=r?[null===i||void 0===i?void 0:i.address,[(0,a.cK)(r)]]:[null===i||void 0===i?void 0:i.address],o=await e.request({method:"wallet_getCapabilities",params:s}),c={};for(const[a,l]of Object.entries(o)){c[Number(a)]={};for(let[e,t]of Object.entries(l))"addSubAccount"===e&&(e="unstable_addSubAccount"),c[Number(a)][e]=t}return"number"===typeof r?c[r]:c}(e,t),getChainId:()=>(0,o.T)(e),getPermissions:()=>async function(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}(e),prepareAuthorization:t=>(0,g.h)(e,t),prepareTransactionRequest:t=>(0,m.ft)(e,t),requestAddresses:()=>async function(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(e=>(0,h.b)(e))}(e),requestPermissions:t=>async function(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}(e,t),sendCalls:t=>(0,y.yM)(e,t),sendCallsSync:t=>async function(e,t){var n,i;const{chain:s=e.chain}=t,o=null!==(n=t.timeout)&&void 0!==n?n:Math.max(3*(null!==(i=null===s||void 0===s?void 0:s.blockTime)&&void 0!==i?i:0),5e3),a=await(0,y.yM)(e,t);return await(0,v.c)(e,(0,r.A)((0,r.A)({},t),{},{id:a.id,timeout:o}))}(e,t),sendRawTransaction:t=>(0,w.L)(e,t),sendRawTransactionSync:t=>(0,b.s)(e,t),sendTransaction:t=>(0,u.v)(e,t),sendTransactionSync:t=>U(e,t),showCallsStatus:t=>async function(e,t){const{id:n}=t;await e.request({method:"wallet_showCallsStatus",params:[n]})}(e,t),signAuthorization:t=>async function(e,t){const{account:n=e.account}=t;if(!n)throw new A.T({docsPath:"/docs/eip7702/signAuthorization"});const r=(0,f.J)(n);if(!r.signAuthorization)throw new A.Z({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:r.type});const i=await(0,g.h)(e,t);return r.signAuthorization(i)}(e,t),signMessage:t=>async function(e,t){let{account:n=e.account,message:r}=t;if(!n)throw new A.T({docsPath:"/docs/actions/wallet/signMessage"});const i=(0,f.J)(n);if(i.signMessage)return i.signMessage({message:r});const s="string"===typeof r?(0,a.i3)(r):r.raw instanceof Uint8Array?(0,a.nj)(r.raw):r.raw;return e.request({method:"personal_sign",params:[s,i.address]},{retryCount:0})}(e,t),signTransaction:t=>(0,L.W)(e,t),signTypedData:t=>(0,B.C)(e,t),switchChain:t=>async function(e,t){let{id:n}=t;await e.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,a.cK)(n)}]},{retryCount:0})}(e,t),waitForCallsStatus:t=>(0,v.c)(e,t),watchAsset:t=>async function(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}(e,t),writeContract:t=>(0,D.E)(e,t),writeContractSync:t=>async function(e,t){return D.E.internal(e,U,"sendTransactionSync",t)}(e,t)}}function F(e){const{key:t="wallet",name:n="Wallet Client",transport:s}=e;return(0,i.U)((0,r.A)((0,r.A)({},e),{},{key:t,name:n,transport:s,type:"walletClient"})).extend(j)}},71226:(e,t,n)=>{"use strict";n.d(t,{e:()=>i});var r=n(24107);function i(e){let{args:t,eventName:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.A)((0,r.A)({},e),{},{blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null},n?{args:t,eventName:n}:{})}}
2,71488:(e,t,n)=>{"use strict";n.d(t,{Dv:()=>k,FO:()=>m,If:()=>_,Ji:()=>h,Rv:()=>l,WL:()=>g,Yo:()=>w,ej:()=>p,fC:()=>S,iB:()=>u,kz:()=>a,l9:()=>v,pc:()=>o,sP:()=>E,v7:()=>I,v8:()=>A});var r=n(87999),i=n(81232);const s=(0,r.A)(/^error ([a-zA-Z$_][a-zA-Z0-9$_]*)\((.*?)\)$/,{name:1,parameters:2});function o(e){return s.test(e)}function a(e){return(0,i.Yv)(s,e)}const c=(0,r.A)(/^event ([a-zA-Z$_][a-zA-Z0-9$_]*)\((.*?)\)$/,{name:1,parameters:2});function l(e){return c.test(e)}function u(e){return(0,i.Yv)(c,e)}const d=(0,r.A)(/^function ([a-zA-Z$_][a-zA-Z0-9$_]*)\((.*?)\)(?: (external|public{1}))?(?: (pure|view|nonpayable|payable{1}))?(?: returns\s?\((.*?)\))?$/,{name:1,parameters:2,scope:3,stateMutability:4,returns:5});function h(e){return d.test(e)}function p(e){return(0,i.Yv)(d,e)}const f=(0,r.A)(/^struct ([a-zA-Z$_][a-zA-Z0-9$_]*) \{(.*?)\}$/,{name:1,properties:2});function g(e){return f.test(e)}function m(e){return(0,i.Yv)(f,e)}const y=(0,r.A)(/^constructor\((.*?)\)(?:\s(payable{1}))?$/,{parameters:1,stateMutability:2});function v(e){return y.test(e)}function w(e){return(0,i.Yv)(y,e)}const b=(0,r.A)(/^fallback\(\) external(?:\s(payable{1}))?$/,{stateMutability:1});function A(e){return b.test(e)}function _(e){return(0,i.Yv)(b,e)}const x=/^receive\(\) external payable$/;function E(e){return x.test(e)}const k=new Set(["memory","indexed","storage","calldata"]),S=new Set(["indexed"]),I=new Set(["calldata","memory","storage"])},72582:(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var r=n(57722),i=n(25087);let s=function(e){let t=(0,i.Y)(e);return r.useCallback(function(){return t.current(...arguments)},[t])}},72735:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}}},73160:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(57722),i=n(44179),s=n(72582);function o(e){let t=(0,s._)(e),n=(0,r.useRef)(!1);(0,r.useEffect)(()=>(n.current=!1,()=>{n.current=!0,(0,i._)(()=>{n.current&&t()})}),[t])}},73183:(e,t,n)=>{"use strict";function r(e){return"string"===typeof e[0]?i(e):function(e){let t=0;for(const i of e)t+=i.length;const n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(e)}function i(e){return"0x".concat(e.reduce((e,t)=>e+t.replace("0x",""),""))}n.d(t,{aP:()=>i,xW:()=>r})},73251:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=(e,t,n)=>JSON.stringify(e,(e,n)=>{const r="bigint"===typeof n?n.toString():n;return"function"===typeof t?t(e,r):r},n)},73524:(e,t,n)=>{"use strict";n.d(t,{j:()=>d});var r=n(57722),i=n(56973),s=n(51145),o=n(54966),a=n(64492),c=n(25087),l=n(35653);const u=30;function d(e,t,n){let d=(0,c.Y)(n),h=(0,r.useCallback)(function(e,n){if(e.defaultPrevented)return;let r=n(e);if(null===r||!r.getRootNode().contains(r)||!r.isConnected)return;let i=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of i)if(null!==t&&(t.contains(r)||e.composed&&e.composedPath().includes(t)))return;return!(0,s.Bm)(r,s.MZ.Loose)&&-1!==r.tabIndex&&e.preventDefault(),d.current(e,r)},[d,t]),p=(0,r.useRef)(null);(0,a.z)(e,"pointerdown",e=>{var t,n;(0,o.Fr)()||(p.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),(0,a.z)(e,"pointerup",e=>{if((0,o.Fr)()||!p.current)return;let t=p.current;return p.current=null,h(e,()=>t)},!0);let f=(0,r.useRef)({x:0,y:0});(0,a.z)(e,"touchstart",e=>{f.current.x=e.touches[0].clientX,f.current.y=e.touches[0].clientY},!0),(0,a.z)(e,"touchend",e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-f.current.x)>=u||Math.abs(n-f.current.y)>=u))return h(e,()=>i.Lk(e.target)?e.target:null)},!0),(0,l.M)(e,"blur",e=>h(e,()=>i.Gu(window.document.activeElement)?window.document.activeElement:null),!0)}},73660:(e,t,n)=>{"use strict";n.d(t,{s:()=>s});var r=n(57722),i=n(39898);let s=(e,t)=>{i._.isServer?(0,r.useEffect)(e,t):(0,r.useLayoutEffect)(e,t)}},74324:(e,t,n)=>{"use strict";n.d(t,{y:()=>o});var r=n(41893),i=n(72582),s=n(95886);function o(e,t){let n=arguments.length>
22&&void 0!==arguments[2]?arguments[2]:s.bN;return(0,r.useSyncExternalStoreWithSelector)((0,i._)(t=>e.subscribe(a,t)),(0,i._)(()=>e.state),(0,i._)(()=>e.state),(0,i._)(t),n)}function a(e){return e}},74878:(e,t,n)=>{"use strict";function r(){return(null===n.g||void 0===n.g?void 0:n.g.crypto)||(null===n.g||void 0===n.g?void 0:n.g.msCrypto)||{}}function i(){const e=r();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=r,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=function(){return!!r()&&!!i()}},75008:(e,t,n)=>{"use strict";n.d(t,{lY:()=>A});var r=n(34673),i=n(5282);const s=BigInt(0),o=BigInt(1),a=BigInt(2),c=BigInt(7),l=BigInt(256),u=BigInt(113),d=[],h=[],p=[];for(let _=0,x=o,E=1,k=0;_<24;_++){[E,k]=[k,(2*E+3*k)%5],d.push(2*(5*k+E)),h.push((_+1)*(_+2)/2%64);let e=s;for(let t=0;t<7;t++)x=(x<<o^(x>>c)*u)%l,x&a&&(e^=o<<(o<<BigInt(t))-o);p.push(e)}const f=(0,r.lD)(p,!0),g=f[0],m=f[1],y=(e,t,n)=>n>32?(0,r.WM)(e,t,n):(0,r.P5)(e,t,n),v=(e,t,n)=>n>32?(0,r.im)(e,t,n):(0,r.B4)(e,t,n);class w extends i.Vw{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,(0,i.Fe)(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,i.DH)(this.state)}clone(){return this._cloneInto()}keccak(){(0,i.fd)(this.state32),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const t=(r+8)%10,i=(r+2)%10,s=n[i],o=n[i+1],a=y(s,o,1)^n[t],c=v(s,o,1)^n[t+1];for(let n=0;n<50;n+=10)e[r+n]^=a,e[r+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=h[n],s=y(t,i,r),o=v(t,i,r),a=d[n];t=e[a],i=e[a+1],e[a]=s,e[a+1]=o}for(let r=0;r<50;r+=10){for(let t=0;t<10;t++)n[t]=e[r+t];for(let t=0;t<10;t++)e[r+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=g[r],e[1]^=m[r]}(0,i.uH)(n)}(this.state32,this.rounds),(0,i.fd)(this.state32),this.posOut=0,this.pos=0}update(e){(0,i.CC)(this),e=(0,i.ZJ)(e),(0,i.DO)(e);const{blockLen:t,state:n}=this,r=e.length;for(let i=0;i<r;){const s=Math.min(t-this.pos,r-i);for(let t=0;t<s;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,0!==(128&t)&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){(0,i.CC)(this,!1),(0,i.DO)(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,i.Fe)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.Ht)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,i.uH)(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:s}=this;return e||(e=new w(t,n,r,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=s,e.destroyed=this.destroyed,e}}const b=(e,t,n)=>(0,i.qj)(()=>new w(t,e,n)),A=(()=>b(1,136,32))()},75408:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});const r=1},75470:(e,t,n)=>{"use strict";async function r(e,t){let{serializedTransaction:n}=t;return e.request({method:"eth_sendRawTransaction",params:[n]},{retryCount:0})}n.d(t,{L:()=>r})},75581:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(24107),i=n(59388),s=n(63679);function o(e){const{key:t="public",name:n="Public Client"}=e;return(0,i.U)((0,r.A)((0,r.A)({},e),{},{key:t,name:n,type:"publicClient"})).extend(s.$)}},76058:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});const r={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol
vendor: 5,437 bytes, line 2
2:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}}},76416:(e,t,n)=>{"use strict";n.d(t,{p:()=>u});var r=n(73183),i=n(70759),s=n(18656),o=n(78203),a=n(68419),c=n(44270);const l="/docs/contract/encodeFunctionData";function u(e){const{args:t}=e,{abi:n,functionName:u}=1===e.abi.length&&null!==(d=e.functionName)&&void 0!==d&&d.startsWith("0x")?e:function(e){const{abi:t,args:n,functionName:r}=e;let i=t[0];if(r){const e=(0,c.iY)({abi:t,args:n,name:r});if(!e)throw new s.Iz(r,{docsPath:l});i=e}if("function"!==i.type)throw new s.Iz(void 0,{docsPath:l});return{abi:[i],functionName:(0,o.V)((0,a.B)(i))}}(e);var d;const h=n[0],p=u,f="inputs"in h&&h.inputs?(0,i.h)(h.inputs,null!==t&&void 0!==t?t:[]):void 0;return(0,r.aP)([p,null!==f&&void 0!==f?f:"0x"])}},77011:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=1e6,i=1e6,s="[big.js] ",o=s+"Invalid ",a=o+"decimal places",c=o+"rounding mode",l=s+"Division by zero",u={},d=void 0,h=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function p(e,t,n,r){var i=e.c;if(n===d&&(n=e.constructor.RM),0!==n&&1!==n&&2!==n&&3!==n)throw Error(c);if(t<1)r=3===n&&(r||!!i[0])||0===t&&(1===n&&i[0]>=5||2===n&&(i[0]>5||5===i[0]&&(r||i[1]!==d))),i.length=1,r?(e.e=e.e-t+1,i[0]=1):i[0]=e.e=0;else if(t<i.length){if(r=1===n&&i[t]>=5||2===n&&(i[t]>5||5===i[t]&&(r||i[t+1]!==d||1&i[t-1]))||3===n&&(r||!!i[0]),i.length=t,r)for(;++i[--t]>9;)if(i[t]=0,0===t){++e.e,i.unshift(1);break}for(t=i.length;!i[--t];)i.pop()}return e}function f(e,t,n){var r=e.e,i=e.c.join(""),s=i.length;if(t)i=i.charAt(0)+(s>1?"."+i.slice(1):"")+(r<0?"e":"e+")+r;else if(r<0){for(;++r;)i="0"+i;i="0."+i}else if(r>0)if(++r>s)for(r-=s;r--;)i+="0";else r<s&&(i=i.slice(0,r)+"."+i.slice(r));else s>1&&(i=i.charAt(0)+"."+i.slice(1));return e.s<0&&n?"-"+i:i}u.abs=function(){var e=new this.constructor(this);return e.s=1,e},u.cmp=function(e){var t,n=this,r=n.c,i=(e=new n.constructor(e)).c,s=n.s,o=e.s,a=n.e,c=e.e;if(!r[0]||!i[0])return r[0]?s:i[0]?-o:0;if(s!=o)return s;if(t=s<0,a!=c)return a>c^t?1:-1;for(o=(a=r.length)<(c=i.length)?a:c,s=-1;++s<o;)if(r[s]!=i[s])return r[s]>i[s]^t?1:-1;return a==c?0:a>c^t?1:-1},u.div=function(e){var t=this,n=t.constructor,i=t.c,s=(e=new n(e)).c,o=t.s==e.s?1:-1,c=n.DP;if(c!==~~c||c<0||c>r)throw Error(a);if(!s[0])throw Error(l);if(!i[0])return e.s=o,e.c=[e.e=0],e;var u,h,f,g,m,y=s.slice(),v=u=s.length,w=i.length,b=i.slice(0,u),A=b.length,_=e,x=_.c=[],E=0,k=c+(_.e=t.e-e.e)+1;for(_.s=o,o=k<0?0:k,y.unshift(0);A++<u;)b.push(0);do{for(f=0;f<10;f++){if(u!=(A=b.length))g=u>A?1:-1;else for(m=-1,g=0;++m<u;)if(s[m]!=b[m]){g=s[m]>b[m]?1:-1;break}if(!(g<0))break;for(h=A==u?s:y;A;){if(b[--A]<h[A]){for(m=A;m&&!b[--m];)b[m]=9;--b[m],b[A]+=10}b[A]-=h[A]}for(;!b[0];)b.shift()}x[E++]=g?f:++f,b[0]&&g?b[A]=i[v]||0:b=[i[v]]}while((v++<w||b[0]!==d)&&o--);return x[0]||1==E||(x.shift(),_.e--,k--),E>k&&p(_,k,n.RM,b[0]!==d),_},u.eq=function(e){return 0===this.cmp(e)},u.gt=function(e){return this.cmp(e)>0},u.gte=function(e){return this.cmp(e)>-1},u.lt=function(e){return this.cmp(e)<0},u.lte=function(e){return this.cmp(e)<1},u.minus=u.sub=function(e){var t,n,r,i,s=this,o=s.constructor,a=s.s,c=(e=new o(e)).s;if(a!=c)return e.s=-c,s.plus(e);var l=s.c.slice(),u=s.e,d=e.c,h=e.e;if(!l[0]||!d[0])return d[0]?e.s=-c:l[0]?e=new o(s):e.s=1,e;if(a=u-h){for((i=a<0)?(a=-a,r=l):(h=u,r=d),r.reverse(),c=a;c--;)r.push(0);r.reverse()}else for(n=((i=l.length<d.length)?l:d).length,a=c=0;c<n;c++)if(l[c]!=d[c]){i=l[c]<d[c];break}if(i&&(r=l,l=d,d=r,e.s=-e.s),(c=(n=d.length)-(t=l.length))>0)for(;c--;)l[t++]=0;for(c=t;n>a;){if(l[--n]<d[n]){for(t=n;t&&!l[--t];)l[t]=9;--l[t],l[n]+=10}l[n]-=d[n]}for(;0===l[--c];)l.pop();for(;0===l[0];)l.shift(),--h;return l[0]||(e.s=1,l=[h=0]),e.c=l,e.e=h,e},u.mod=function(e){var t,n=this,r=n.constructor,i=n.s,s=(e=new r(e)).s;if(!e.c[0])throw Error(l);return n.s=e.s=1,t=1==e.cmp(n),n.s=i,e.s=s,t?new r(n):(i=r.DP,s=r.RM,r.DP=r.RM=0,n=n.div(e),r.DP=i,r.RM=s,this.minus(n.times(e)))},u.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e},u.plus=u.add=function(e){var t,n,r,i=this,s=i.constructor;if(e=new s(e),i.s!=e.s)return e.s=-e.s,i.minus(e);var o=i.e,a=i.c,c=e.e,l=e.c;if(!a[0]||!l[0])return l[0]||(a[0]?e=new s(i):e.s=i.s),e;if(a=a.slice(),t=o-c){for(t>0?(c=o,r=l):(t=-t,r=a),r.reverse();t--;)r.push(0);r.reverse()}for(a.length-l.length<0&&(r=l,l=a,a=r),t=l.length,n=0;t;a[t]%=10)n=(a[--t]=a[t]+l[t]+n)/10|0;for(n&&(a.unshift(n),++c),t=a.length;0===a[--t];)a.pop();return e.c=a,e.e=c,e},u.pow=function(e){var t=this,n=new t.constructor("1"),r=n,s=e<0;if(e!==~~e||e<-1e6||e>i)throw Error(o+"exponent");for(s&&(e=-e);1&e&&(r=r.times(t)),e>>=1;)t=t.times(t);return s?n.div(r):r},u.prec=function(e,t){if(e!==~~e||e<1||e>r)throw Error(o+"precision");return p(new this.constructor(this),e,t)},u.round=function(e,t){if(e===d)e=0;else if(e!==~~e||e<-r||e>r)throw Error(a);return p(new this.constructor(this),e+this.e+1,t)},u.sqrt=function(){var e,t,n,r=this,i=r.constructor,o=r.s,a=r.e,c=new i("0.5");
2if(!r.c[0])return new i(r);if(o<0)throw Error(s+"No square root");0===(o=Math.sqrt(+f(r,!0,!0)))||o===1/0?((t=r.c.join("")).length+a&1||(t+="0"),a=((a+1)/2|0)-(a<0||1&a),e=new i(((o=Math.sqrt(t))==1/0?"5e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+a)):e=new i(o+""),a=e.e+(i.DP+=4);do{n=e,e=c.times(n.plus(r.div(n)))}while(n.c.slice(0,a).join("")!==e.c.slice(0,a).join(""));return p(e,(i.DP-=4)+e.e+1,i.RM)},u.times=u.mul=function(e){var t,n=this,r=n.constructor,i=n.c,s=(e=new r(e)).c,o=i.length,a=s.length,c=n.e,l=e.e;if(e.s=n.s==e.s?1:-1,!i[0]||!s[0])return e.c=[e.e=0],e;for(e.e=c+l,o<a&&(t=i,i=s,s=t,l=o,o=a,a=l),t=new Array(l=o+a);l--;)t[l]=0;for(c=a;c--;){for(a=0,l=o+c;l>c;)a=t[l]+s[c]*i[l-c-1]+a,t[l--]=a%10,a=a/10|0;t[l]=a}for(a?++e.e:t.shift(),c=t.length;!t[--c];)t.pop();return e.c=t,e},u.toExponential=function(e,t){var n=this,i=n.c[0];if(e!==d){if(e!==~~e||e<0||e>r)throw Error(a);for(n=p(new n.constructor(n),++e,t);n.c.length<e;)n.c.push(0)}return f(n,!0,!!i)},u.toFixed=function(e,t){var n=this,i=n.c[0];if(e!==d){if(e!==~~e||e<0||e>r)throw Error(a);for(e=e+(n=p(new n.constructor(n),e+n.e+1,t)).e+1;n.c.length<e;)n.c.push(0)}return f(n,!1,!!i)},u[Symbol.for("nodejs.util.inspect.custom")]=u.toJSON=u.toString=function(){var e=this,t=e.constructor;return f(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])},u.toNumber=function(){var e=+f(this,!0,!0);if(!0===this.constructor.strict&&!this.eq(e.toString()))throw Error(s+"Imprecise conversion");return e},u.toPrecision=function(e,t){var n=this,i=n.constructor,s=n.c[0];if(e!==d){if(e!==~~e||e<1||e>r)throw Error(o+"precision");for(n=p(new i(n),e,t);n.c.length<e;)n.c.push(0)}return f(n,e<=n.e||n.e<=i.NE||n.e>=i.PE,!!s)},u.valueOf=function(){var e=this,t=e.constructor;if(!0===t.strict)throw Error(s+"valueOf disallowed");return f(e,e.e<=t.NE||e.e>=t.PE,!0)};var g=function e(){function t(n){var r=this;if(!(r instanceof t))return n===d?e():new t(n);if(n instanceof t)r.s=n.s,r.e=n.e,r.c=n.c.slice();else{if("string"!==typeof n){if(!0===t.strict&&"bigint"!==typeof n)throw TypeError(o+"value");n=0===n&&1/n<0?"-0":String(n)}!function(e,t){var n,r,i;if(!h.test(t))throw Error(o+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(n=t.indexOf("."))>-1&&(t=t.replace(".",""));(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length);for(i=t.length,r=0;r<i&&"0"==t.charAt(r);)++r;if(r==i)e.c=[e.e=0];else{for(;i>0&&"0"==t.charAt(--i););for(e.e=n-r-1,e.c=[],n=0;r<=i;)e.c[n++]=+t.charAt(r++)}}(r,n)}r.constructor=t}return t.prototype=u,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.strict=false,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}();const m=g},77101:(e,t,n)=>{"use strict";n.d(t,{h:()=>o,j:()=>s});const r=e=>JSON.stringify(e,(e,t)=>"bigint"===typeof t?t.toString()+"n":t),i=e=>{const t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(t,(e,t)=>"string"===typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t)};function s(e){if("string"!==typeof e)throw new Error("Cannot safe json parse value of type ".concat(typeof e));try{return i(e)}catch(t){return e}}function o(e){return"string"===typeof e?e:r(e)||""}}
2,77354:(e,t,n)=>{"use strict";n.d(t,{b:()=>i});var r=n(14825);function i(e){let{delay:t=100,retryCount:n=2,shouldRetry:i=()=>!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((s,o)=>{const a=async function(){let{count:c=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t=await e();s(t)}catch(l){if(c<n&&await i({count:c,error:l}))return(async e=>{let{error:n}=e;const i="function"===typeof t?t({count:c,error:n}):t;i&&await(0,r.u)(i),a({count:c+1})})({error:l});o(l)}};a()})}},77417:(e,t,n)=>{"use strict";n.d(t,{A:()=>v,V:()=>v});var r=n(69692),i=n(30105),s=n.n(i),o=n(77101),a=n(64655),c=Object.defineProperty,l=Object.defineProperties,u=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(e,t,n)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g=(e,t)=>{for(var n in t||(t={}))h.call(t,n)&&f(e,n,t[n]);if(d)for(var n of d(t))p.call(t,n)&&f(e,n,t[n]);return e},m=(e,t)=>l(e,u(t));const y={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class v{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.url=e,this.disableProviderPing=t,this.events=new r.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,a.isHttpUrl)(e))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(e));this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=(0,o.h)(e),n=await(await s()(this.url,m(g({},y),{body:t}))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;if(!(0,a.isHttpUrl)(e))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(e));if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(new Error("HTTP connection is missing or invalid"));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=(0,o.h)({id:1,jsonrpc:"2.0",method:"test",params:[]});await s()(e,m(g({},y),{body:t}))}this.onOpen()}catch(t){const e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?(0,o.j)(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=n.message||n.toString(),i=(0,a.formatJsonRpcError)(e,r);this.events.emit("payload",i)}parseError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return(0,a.parseConnectionError)(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}},77628:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1598);r.__exportStar(n(93374),t),r.__exportStar(n(28499),t),r.__exportStar(n(97234),t),r.__exportStar(n(79482),t)},77654:(e,t,n)=>{"use strict";n.d(t,{BC:()=>h,Iz:()=>f,Ul:()=>g,nZ:()=>d});var r=n(10860),i=n(41684);function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!t.match(new RegExp("^[".concat(e,"]*$"))))throw new r.tsw(r.mZ_,{alphabet:e,base:e.length,value:n})}var o=e=>(0,i.xv)({getSizeFromValue:t=>{const[n,r]=c(t,e[0]);if(!r)return t.length;const i=l(r,e);return n.length+Math.ceil(i.toString(16).length/2)},write(t,n,r){if(s(e,t),""===t)return r;const[i,o]=c(t,e[0]);if(!o)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let a=l(o,e);const u=[];for(;a>0n;)u.unshift(Number(a%256n)),a/=256n;const d=[...Array(i.length).fill(0),...u];return n.set(d,r),r+d.length}}),a=e=>(0,i.$C)({read(t,n){const r=0===n?t:t.slice(n);if(0===r.length)return["",0];let i=r.findIndex(e=>0!==e);i=-1===i?r.length:i;const s=e[0].repeat(i);if(i===r.length)return[s,t.length];const o=function(e,t){const n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join("")}(r.slice(i).reduce((e,t)=>
2256n*e+BigInt(t),0n),e);return[s+o,t.length]}});function c(e,t){const[n,r]=e.split(new RegExp("((?!".concat(t,").*)")));return[n,r]}function l(e,t){const n=BigInt(t.length);let r=0n;for(const i of e)r*=n,r+=BigInt(t.indexOf(i));return r}var u="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",d=()=>o(u),h=()=>a(u);var p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=()=>(0,i.xv)({getSizeFromValue:e=>{try{return atob(e).length}catch(t){throw new r.tsw(r.mZ_,{alphabet:p,base:64,value:e})}},write(e,t,n){try{const r=atob(e).split("").map(e=>e.charCodeAt(0));return t.set(r,n),r.length+n}catch(i){throw new r.tsw(r.mZ_,{alphabet:p,base:64,value:e})}}}),g=()=>(0,i.$C)({read(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.slice(t);return[btoa(String.fromCharCode(...n)),e.length]}});globalThis.TextDecoder,globalThis.TextEncoder},78055:(e,t,n)=>{"use strict";n.d(t,{A:()=>BE,B:()=>dk,C:()=>Ix,D:()=>K_,E:()=>UE,F:()=>hk,G:()=>j_,H:()=>Lk,P:()=>oE,R:()=>ax,S:()=>xx,W:()=>iE,a:()=>Cx,b:()=>_x,c:()=>LE,d:()=>Dk,e:()=>cE,f:()=>pE,g:()=>dE,h:()=>uE,i:()=>fE,j:()=>hE,k:()=>VE,l:()=>jE,m:()=>F_,n:()=>z_,o:()=>wx,p:()=>KE,q:()=>Ox,r:()=>lE,s:()=>qE,t:()=>WE,u:()=>Bk,v:()=>fx,w:()=>gx,x:()=>mx,y:()=>ME,z:()=>FE});var r=n(92030),i=n(24107),s=n(15882),o=n(90034),a=n(57722),c=n.t(a,2),l=n(32381),u=n(50448),d=n(17587),h=n(22904),p=n(51475),f=n(7488),g=n(49931),m=n(30549),y=n(1991),v=n(44131),w=n(51380),b=n(49080);class A{constructor(e,t){this.scope=e,this.module=t}storeObject(e,t){this.setItem(e,JSON.stringify(t))}loadObject(e){const t=this.getItem(e);return t?JSON.parse(t):void 0}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);"string"===typeof r&&r.startsWith(e)&&t.push(r)}t.forEach(e=>localStorage.removeItem(e))}scopedKey(e){return"-".concat(this.scope).concat(this.module?":".concat(this.module):"",":").concat(e)}static clearAll(){new A("CBWSDK").clear(),new A("walletlink").clear()}}const _={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},x={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902},E={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},k="Unspecified error message.";function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;if(e&&Number.isInteger(e)){const t=e.toString();if(P(E,t))return E[t].message;if(T(e))return"Unspecified server error."}return t}function I(e){let{shouldIncludeStack:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={};if(e&&"object"===typeof e&&!Array.isArray(e)&&P(e,"code")&&function(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!E[t]||!!T(e)}(e.code)){const t=e;
2n.code=t.code,t.message&&"string"===typeof t.message?(n.message=t.message,P(t,"data")&&(n.data=t.data)):(n.message=S(n.code),n.data={originalError:C(e)})}else n.code=_.internal,n.message=O(e,"message")?e.message:k,n.data={originalError:C(e)};return t&&(n.stack=O(e,"stack")?e.stack:void 0),n}function T(e){return e>=-32099&&e<=-32e3}function C(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function O(e,t){return"object"===typeof e&&null!==e&&t in e&&"string"===typeof e[t]}const N={parse:e=>M(_.parse,e),invalidRequest:e=>M(_.invalidRequest,e),invalidParams:e=>M(_.invalidParams,e),methodNotFound:e=>M(_.methodNotFound,e),internal:e=>M(_.internal,e),server:e=>{if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return M(t,e)},invalidInput:e=>M(_.invalidInput,e),resourceNotFound:e=>M(_.resourceNotFound,e),resourceUnavailable:e=>M(_.resourceUnavailable,e),transactionRejected:e=>M(_.transactionRejected,e),methodNotSupported:e=>M(_.methodNotSupported,e),limitExceeded:e=>M(_.limitExceeded,e)},R={userRejectedRequest:e=>U(x.userRejectedRequest,e),unauthorized:e=>U(x.unauthorized,e),unsupportedMethod:e=>U(x.unsupportedMethod,e),disconnected:e=>U(x.disconnected,e),chainDisconnected:e=>U(x.chainDisconnected,e),unsupportedChain:e=>U(x.unsupportedChain,e),custom:e=>{if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:n,data:r}=e;if(!n||"string"!==typeof n)throw new Error('"message" must be a nonempty string');return new D(t,n,r)}};function M(e,t){const[n,r]=L(t);return new B(e,n||S(e),r)}function U(e,t){const[n,r]=L(t);return new D(e,n||S(e),r)}function L(e){if(e){if("string"===typeof e)return[e];if("object"===typeof e&&!Array.isArray(e)){const{message:t,data:n}=e;
2if(t&&"string"!==typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}class B extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!==typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}}class D extends B{constructor(e,t,n){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}const j=e=>e,F=e=>e,z=e=>e;function W(e){return Math.floor(e)}const q=/^[0-9]*$/,H=/^[a-f0-9]*$/;function V(e){return G(crypto.getRandomValues(new Uint8Array(e)))}function G(e){return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}function K(e){return new Uint8Array(e.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function J(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.toString("hex");return j(t?"0x".concat(n):n)}function Z(e){return J(ie(e),!0)}function Q(e){return z(e.toString(10))}function Y(e){return j("0x".concat(BigInt(e).toString(16)))}function X(e){return e.startsWith("0x")||e.startsWith("0X")}function $(e){return X(e)?e.slice(2):e}function ee(e){return X(e)?"0x".concat(e.slice(2)):"0x".concat(e)}function te(e){if("string"!==typeof e)return!1;const t=$(e).toLowerCase();return H.test(t)}function ne(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"===typeof e){const n=$(e).toLowerCase();if(H.test(n))return j(t?"0x".concat(n):n)}throw N.invalidParams('"'.concat(String(e),'" is not a hexadecimal string'))}(e,!1);return n.length%2===1&&(n=j("0".concat(n))),t?j("0x".concat(n)):n}function re(e){if("string"===typeof e){const t=$(e).toLowerCase();if(te(t)&&40===t.length)return F(ee(t))}throw N.invalidParams("Invalid Ethereum address: ".concat(String(e)))}function ie(e){if(Buffer.isBuffer(e))return e;if("string"===typeof e){if(te(e)){const t=ne(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw N.invalidParams("Not binary data: ".concat(String(e)))}function se(e){if("number"===typeof e&&Number.isInteger(e))return W(e);if("string"===typeof e){if(q.test(e))return W(Number(e));if(te(e))return W(Number(BigInt(ne(e,!0))))}throw N.invalidParams("Not an integer: ".concat(String(e)))}function oe(e){if(null!==e&&("bigint"===typeof e||function(e){if(null==e||"function"!==typeof e.constructor)return!1;const{constructor:t}=e;return"function"===typeof t.config&&"number"===typeof t.EUCLID}(e)))return BigInt(e.toString(10));if("number"===typeof e)return BigInt(se(e));if("string"===typeof e){if(q.test(e))return BigInt(e);if(te(e))return BigInt(ne(e,!0))}throw N.invalidParams("Not an integer: ".concat(String(e)))}function ae(e){if("string"===typeof e)return JSON.parse(e);if("object"===typeof e)return e;throw N.invalidParams("Not a JSON string or an object: ".concat(String(e)))}function ce(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}async function le(e,t){const n=ce(e),r=await crypto.subtle.exportKey(n,t);return G(new Uint8Array(r))}async function ue(e,t){const n=ce(e),r=K(t).buffer;return await crypto.subtle.importKey(n,new Uint8Array(r),{name:"ECDH",namedCurve:"P-256"},!0,"private"===e?["deriveKey"]:[])}async function de(e,t){return async function(e,t){const n=crypto.getRandomValues(new Uint8Array(12));return{iv:n,cipherText:await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,(new TextEncoder).encode(t))}}(t,JSON.stringify(e,(e,t)=>{if(!(t instanceof Error))return t;const n=t;return Object.assign(Object.assign({},n.code?{code:n.code}:{}),{message:n.message})}))}async function he(e,t){return JSON.parse(await async function(e,t){let{iv:n,cipherText:r}=t;const i=await crypto.subtle.decrypt({name:"AES-GCM",iv:n},e,r);return(new TextDecoder).decode(i)}(t,e))}const pe={storageKey:"ownPrivateKey",keyType:"private"},fe={storageKey:"ownPublicKey",keyType:"public"},ge={storageKey:"peerPublicKey",keyType:"public"};
2class me{constructor(){this.storage=new A("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(ge,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(fe.storageKey),this.storage.removeItem(pe.storageKey),this.storage.removeItem(ge.storageKey)}async generateKeyPair(){const e=await async function(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(pe,e.privateKey),await this.storeKey(fe,e.publicKey)}async loadKeysIfNeeded(){if(null===this.ownPrivateKey&&(this.ownPrivateKey=await this.loadKey(pe)),null===this.ownPublicKey&&(this.ownPublicKey=await this.loadKey(fe)),null!==this.ownPrivateKey&&null!==this.ownPublicKey||await this.generateKeyPair(),null===this.peerPublicKey&&(this.peerPublicKey=await this.loadKey(ge)),null===this.sharedSecret){if(null===this.ownPrivateKey||null===this.peerPublicKey)return;this.sharedSecret=await async function(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?ue(e.keyType,t):null}async storeKey(e,t){const n=await le(e.keyType,t);this.storage.setItem(e.storageKey,n)}}const ye="4.3.2",ve="@coinbase/wallet-sdk";async function we(e,t){const n=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()}
2),r=await window.fetch(t,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":ye,"X-Cbw-Sdk-Platform":ve}}),{result:i,error:s}=await r.json();if(s)throw s;return i}function be(e){let{metadata:t,preference:n}=e;var r,i;const{appName:s,appLogoUrl:o,appChainIds:a}=t;if("smartWalletOnly"!==n.options){const e=globalThis.coinbaseWalletExtension;if(e)return null===(r=e.setAppInfo)||void 0===r||r.call(e,s,o,a,n),e}const c=function(){var e,t;try{const n=globalThis;return null!==(e=n.ethereum)&&void 0!==e?e:null===(t=n.top)||void 0===t?void 0:t.ethereum}catch(cl){return}}();if(null===c||void 0===c?void 0:c.isCoinbaseBrowser)return null===(i=c.setAppInfo)||void 0===i||i.call(c,s,o,a,n),c}const Ae="accounts",_e="activeChain",xe="availableChains",Ee="walletCapabilities";class ke{constructor(e){var t,n,r;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new me,this.storage=new A("CBWSDK","SCWStateManager"),this.accounts=null!==(t=this.storage.loadObject(Ae))&&void 0!==t?t:[],this.chain=this.storage.loadObject(_e)||{id:null!==(r=null===(n=e.metadata.appChainIds)||void 0===n?void 0:n[0])&&void 0!==r?r:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var t,n,r,i;await(null===(n=(t=this.communicator).waitForPopupLoaded)||void 0===n?void 0:n.call(t));const s=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,null!==(r=e.params)&&void 0!==r?r:{})}}),o=await this.communicator.postRequestAndWaitForResponse(s);if("failure"in o.content)throw o.content.failure;const a=await ue("public",o.sender);await this.keyManager.setPeerPublicKey(a);const c=(await this.decryptResponseMessage(o)).result;if("error"in c)throw c.error;switch(e.method){case"eth_requestAccounts":{const e=c.value;this.accounts=e,this.storage.storeObject(Ae,e),null===(i=this.callback)||void 0===i||i.call(this,"accountsChanged",e);break}}}async request(e){var t;if(0===this.accounts.length){if("wallet_sendCalls"===e.method)return this.sendRequestToPopup(e);throw R.unauthorized()}switch(e.method){case"eth_requestAccounts":return null===(t=this.callback)||void 0===t||t.call(this,"connect",{chainId:Y(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return Y(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(Ee);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw N.internal("No RPC URL set for chain");return we(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var t,n;await(null===(n=(t=this.communicator).waitForPopupLoaded)||void 0===n?void 0:n.call(t));const r=await this.sendEncryptedRequest(e),i=(await this.decryptResponseMessage(r)).result;if("error"in i)throw i.error;return i.value}async cleanup(){var e,t;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:null!==(t=null===(e=this.metadata.appChainIds)||void 0===e?void 0:e[0])&&void 0!==t?t:1}}async handleSwitchChainRequest(e){var t;const n=e.params;if(!n||!(null===(t=n[0])||void 0===t?void 0:t.chainId))throw N.invalidParams();const r=se(n[0].chainId);if(this.updateChain(r))return null;const i=await this.sendRequestToPopup(e);return null===i&&this.updateChain(r),i}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw R.unauthorized("No valid session found, try requestAccounts before other methods");const n=await de({action:e,chainId:this.chain.id},t),r=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(r)}async createRequestMessage(e){const t=await le("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){var t,n;const r=e.content;if("failure"in r)throw r.failure;
2const i=await this.keyManager.getSharedSecret();if(!i)throw R.unauthorized("Invalid session");const s=await he(r.encrypted,i),o=null===(t=s.data)||void 0===t?void 0:t.chains;if(o){const e=Object.entries(o).map(e=>{let[t,n]=e;return{id:Number(t),rpcUrl:n}});this.storage.storeObject(xe,e),this.updateChain(this.chain.id,e)}const a=null===(n=s.data)||void 0===n?void 0:n.capabilities;return a&&this.storage.storeObject(Ee,a),s}updateChain(e,t){var n;const r=null!==t&&void 0!==t?t:this.storage.loadObject(xe),i=null===r||void 0===r?void 0:r.find(t=>t.id===e);return!!i&&(i!==this.chain&&(this.chain=i,this.storage.storeObject(_e,i),null===(n=this.callback)||void 0===n||n.call(this,"chainChanged",Y(i.id))),!0)}}const Se=n.p+"static/media/index.02a87dd5cbbefe30bb30.cjs",Ie="Addresses";function Te(e){return void 0!==e.errorMessage}class Ce{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",K(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,i.encode(e)),o=s.slice(s.byteLength-16),a=s.slice(0,s.byteLength-16),c=new Uint8Array(o),l=new Uint8Array(a);return G(new Uint8Array([...n,...c,...l]))}async decrypt(e){const t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((n,r)=>{!async function(){const i=await crypto.subtle.importKey("raw",K(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=K(e),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),l=new Uint8Array([...c,...a]),u={name:"AES-GCM",iv:new Uint8Array(o)};try{const e=await window.crypto.subtle.decrypt(u,i,l),t=new TextDecoder;n(t.decode(e))}catch(d){r(d)}}()})}}class Pe{constructor(e,t,n){this.linkAPIUrl=e,this.sessionId=t;const r="".concat(t,":").concat(n);this.auth="Basic ".concat(btoa(r))}async markUnseenEventsAsSeen(e){return Promise.all(e.map(e=>fetch("".concat(this.linkAPIUrl,"/events/").concat(e.eventId,"/seen"),{method:"POST",headers:{Authorization:this.auth}}))).catch(e=>console.error("Unabled to mark event as failed:",e))}async fetchUnseenEvents(){var e;const t=await fetch("".concat(this.linkAPIUrl,"/events?unseen=true"),{headers:{Authorization:this.auth}});if(t.ok){const{events:n,error:r}=await t.json();if(r)throw new Error("Check unseen events failed: ".concat(r));const i=null!==(e=null===n||void 0===n?void 0:n.filter(e=>"Web3Response"===e.event).map(e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data})))&&void 0!==e?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error("Check unseen events failed: ".concat(t.status))}}var Oe;!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(Oe||(Oe={}));class Ne{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WebSocket;this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,t)=>{var n;let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(i){return void t(i)}null===(n=this.connectionStateListener)||void 0===n||n.call(this,Oe.CONNECTING),r.onclose=e=>{var n;this.clearWebSocket(),t(new Error("websocket error ".concat(e.code,": ").concat(e.reason))),null===(n=this.connectionStateListener)||void 0===n||n.call(this,Oe.DISCONNECTED)},r.onopen=t=>{var n;if(e(),null===(n=this.connectionStateListener)||void 0===n||n.call(this,Oe.CONNECTED),this.pendingData.length>0){[...this.pendingData].forEach(e=>this.sendData(e)),this.pendingData=[]}},r.onmessage=e=>{var t,n;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{const t=JSON.parse(e.data);null===(n=this.incomingDataListener)||void 0===n||n.call(this,t)}catch(cl){}}})}disconnect(){var e;const{webSocket:t}=this;if(t){this.clearWebSocket(),null===(e=this.connectionStateListener)||void 0===e||e.call(this,Oe.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(n){}}}sendData(e){const{webSocket:t}=this;if(!t)return this.pendingData.push(e),void this.connect();t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}class Re{constructor(e){let{session:t,linkAPIUrl:n,listener:r}=e;this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=W(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{if(!e)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>
2e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach((t,n)=>{const r=e[n];void 0!==r&&t(r)})},this.handleDestroyed=e=>{var t;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload())},this.handleAccountUpdated=async e=>{var t;const n=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(n)},this.handleMetadataUpdated=async(e,t)=>{var n;const r=await this.cipher.decrypt(t);null===(n=this.listener)||void 0===n||n.metadataUpdated(e,r)},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated("walletUsername",e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated("AppVersion",e)},this.handleChainUpdated=async(e,t)=>{var n;const r=await this.cipher.decrypt(e),i=await this.cipher.decrypt(t);null===(n=this.listener)||void 0===n||n.chainUpdated(r,i)},this.session=t,this.cipher=new Ce(t.secret),this.listener=r;const i=new Ne("".concat(n,"/rpc"),WebSocket);i.setConnectionStateListener(async e=>{let t=!1;switch(e){case Oe.DISCONNECTED:if(!this.destroyed){const e=async()=>{await new Promise(e=>setTimeout(e,5e3)),this.destroyed||i.connect().catch(()=>{e()})};e()}break;case Oe.CONNECTED:t=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case Oe.CONNECTING:}this.connected!==t&&(this.connected=t)}),i.setIncomingDataListener(e=>{var t;switch(e.type){case"Heartbeat":return void this.updateLastHeartbeat();case"IsLinkedOK":case"Linked":{const t="IsLinkedOK"===e.type?e.linked:void 0;this.linked=t||e.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":this.handleSessionMetadataUpdated(e.metadata);break;case"Event":this.handleIncomingEvent(e)}void 0!==e.id&&(null===(t=this.requestResolutions.get(e.id))||void 0===t||t(e))}),this.ws=i,this.http=new Pe(n,t.id,t.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:W(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var t,n;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(n=this.listener)||void 0===n||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if("Event"!==e.type||"Web3Response"!==e.event)return;const n=await this.cipher.decrypt(e.data),r=JSON.parse(n);if("WEB3_RESPONSE"!==r.type)return;const{id:i,response:s}=r;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(i,s)}async checkUnseenEvents(){if(this.connected){await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(Qe){console.error("Unable to check for unseen events",Qe)}}else this.shouldFetchUnseenEventsOnConnect=!0}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1;(await this.http.fetchUnseenEvents()).forEach(e=>this.handleIncomingEvent(e))}async publishEvent(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:W(this.nextReqId++),sessionId:this.session.id,event:e,data:r,callWebhook:n};return this.setOnceLinked(async()=>{const e=await this.makeRequest(i);if("Fail"===e.type)throw new Error(e.error||"failed to publish event");return e.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(e){}}async makeRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:6e4};const n=e.id;let r;return this.sendData(e),Promise.race([new Promise((e,i)=>{r=window.setTimeout(()=>{i(new Error("request ".concat(n," timed out")))},t.timeout)}),new Promise(e=>{this.requestResolutions.set(n,t=>{clearTimeout(r),e(t),this.requestResolutions.delete(n)})})])}
vendor: 7,121 bytes, line 2
2async handleConnected(){return"Fail"!==(await this.makeRequest({type:"HostSession",id:W(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type&&(this.sendData({type:"IsLinked",id:W(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:W(this.nextReqId++),sessionId:this.session.id}),!0)}}class Me{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=ee(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}var Ue=n(63736),Le=n(5282);const Be="session:id",De="session:secret",je="session:linked";class Fe{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.storage=e,this.id=t,this.secret=n,this.key=(0,Le.My)((0,Ue.sc)("".concat(t,", ").concat(n," WalletLink"))),this._linked=!!r}static create(e){const t=V(16),n=V(32);return new Fe(e,t,n).save()}static load(e){const t=e.getItem(Be),n=e.getItem(je),r=e.getItem(De);return t&&r?new Fe(e,t,r,"1"===n):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(Be,this.id),this.storage.setItem(De,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(je,this._linked?"1":"0")}}function ze(){try{return function(){try{return null!==window.frameElement}catch(Qe){return!1}}()&&window.top?window.top.location:window.location}catch(Qe){return window.location}}function We(){var e,t;return null!==(t=null===(e=null===window||void 0===window?void 0:window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)&&void 0!==t&&t}function qe(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode('@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')),document.documentElement.appendChild(e)}var He,Ve,Ge,Ke,Je,Ze,Qe,Ye,Xe,$e,et,tt=n(42983),nt={},rt=[],it=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,st=Array.isArray;function ot(e,t){for(var n in t)e[n]=t[n];return e}function at(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ct(e,t,n){var r,i,s,o={};for(s in t)"key"==s?r=t[s]:"ref"==s?i=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?He.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return lt(e,o,r,i,null)}function lt(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++Ge:i,__i:-1,__u:0};return null==i&&null!=Ve.vnode&&Ve.vnode(s),s}function ut(e){return e.children}function dt(e,t){this.props=e,this.context=t}function ht(e,t){if(null==t)return e.__?ht(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?ht(e):null}function pt(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return pt(e)}}function ft(e){(!e.__d&&(e.__d=!0)&&Ke.push(e)&&!gt.__r++||Je!=Ve.debounceRendering)&&((Je=Ve.debounceRendering)||Ze)(gt)}function gt(){for(var e,t,n,r,i,s,o,a=1;Ke.length;)Ke.length>a&&Ke.sort(Qe),e=Ke.shift(),a=Ke.length,e.__d&&(n=void 0,r=void 0,i=(r=(t=e).__v).__e,s=[],o=[],t.__P&&((n=ot({},r)).__v=r.__v+1,Ve.vnode&&Ve.vnode(n),xt(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,s,null==i?ht(r):i,!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,kt(s,n,o),r.__e=r.__=null,n.__e!=i&&pt(n)));gt.__r=0}function mt(e,t,n,r,i,s,o,a,c,l,u){var d,h,p,f,g,m,y,v=r&&r.__k||rt,w=t.length;for(c=yt(n,t,v,c,w),d=0;d<w;d++)null!=(p=n.__k[d])&&(h=-1==p.__i?nt:v[p.__i]||nt,p.__i=d,m=xt(e,p,h,i,s,o,a,c,l,u),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Tt(h.ref,null,p),u.push(p.ref,p.__c||f,p)),null==g&&null!=f&&(g=f),(y=!!(4&p.__u))||h.__k===p.__k?c=vt(p,c,e,y):"function"==typeof p.t
vendor: 8,262 bytes, line 2
2ype&&void 0!==m?c=m:f&&(c=f.nextSibling),p.__u&=-7);return n.__e=g,c}function yt(e,t,n,r,i){var s,o,a,c,l,u=n.length,d=u,h=0;for(e.__k=new Array(i),s=0;s<i;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=lt(null,o,null,null,null):st(o)?o=e.__k[s]=lt(ut,{children:o},null,null,null):null==o.constructor&&o.__b>0?o=e.__k[s]=lt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,c=s+h,o.__=e,o.__b=e.__b+1,-1!=(l=o.__i=wt(o,n,c,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(i>u?h--:i<u&&h++),"function"!=typeof o.type&&(o.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;s<u;s++)null!=(a=n[s])&&0==(2&a.__u)&&(a.__e==r&&(r=ht(a)),Ct(a,a));return r}function vt(e,t,n,r){var i,s;if("function"==typeof e.type){for(i=e.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=e,t=vt(i[s],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=ht(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function wt(e,t,n,r){var i,s,o,a=e.key,c=e.type,l=t[n],u=null!=l&&0==(2&l.__u);if(null===l&&null==a||u&&a==l.key&&c==l.type)return n;if(r>(u?1:0))for(i=n-1,s=n+1;i>=0||s<t.length;)if(null!=(l=t[o=i>=0?i--:s++])&&0==(2&l.__u)&&a==l.key&&c==l.type)return o;return-1}function bt(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||it.test(t)?n:n+"px"}function At(e,t,n,r,i){var s,o;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||bt(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||bt(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(Ye,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=Xe,e.addEventListener(t,s?et:$e,s)):e.removeEventListener(t,s?et:$e,s);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function _t(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=Xe++;else if(t.t<n.u)return;return n(Ve.event?Ve.event(t):t)}}}function xt(e,t,n,r,i,s,o,a,c,l){var u,d,h,p,f,g,m,y,v,w,b,A,_,x,E,k,S,I=t.type;if(null!=t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=t.__e=n.__e]),(u=Ve.__b)&&u(t);e:if("function"==typeof I)try{if(y=t.props,v="prototype"in I&&I.prototype.render,w=(u=I.contextType)&&r[u.__c],b=u?w?w.props.value:u.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:(v?t.__c=d=new I(y,b):(t.__c=d=new dt(y,b),d.constructor=I,d.render=Pt),w&&w.sub(d),d.state||(d.state={}),d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),v&&null==d.__s&&(d.__s=d.state),v&&null!=I.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ot({},d.__s)),ot(d.__s,I.getDerivedStateFromProps(y,d.__s))),p=d.props,f=d.state,d.__v=t,h)v&&null==I.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),v&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(v&&null==I.getDerivedStateFromProps&&y!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,b),t.__v==n.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,b)){for(t.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),A=0;A<d._sb.length;A++)d.__h.push(d._sb[A]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,b),v&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,f,g)})}if(d.context=b,d.props=y,d.__P=e,d.__e=!1,_=Ve.__r,x=0,v){for(d.state=d.__s,d.__d=!1,_&&_(t),u=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do{d.__d=!1,_&&_(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++x<25);d.state=d.__s,null!=d.getChildContext&&(r=ot(ot({},r),d.getChildContext())),v&&!h&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,f)),k=u,null!=u&&u.type===ut&&null==u.key&&(k=St(u.props.children)),a=mt(e,st(k)?k:[k],t,n,r,i,s,o,a,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),m&&(d.__E=d.__=null)}catch(e){if(t.__v=null,c||null!=s)if(e.then){for(t.__u|=c?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(S=s.length;S--;)at(s[S]);Et(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Et(t);Ve.__e(e,t,n)}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=It(n.__e,t,n,r,i,s,o,c,l);return(u=Ve.diffed)&&u(t),128&t.__u?void 0:a}function Et(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Et)}function kt(e,t,n){for(var r=0;r<n.length;r++)Tt(n[r],n[++r],n[++r]);Ve.__c&&Ve.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){Ve.__e(e,t.__v)}})}function St(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:st(e)?e.map(St):ot({},e)}function It(e,t,n,r,i,s,o,a,c){var l,u,d,h,p,f,g,m=n.props||nt,y=t.props,v=t.type;if("svg"==v?i="http://www.w3.org/2000/svg":"math"==v?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=s)for(l=0;l<s.length;l++)if((p=s[l])&&"setAttribute"in p==!!v&&(v?p.localName==v:3==p.nodeType)){e=p,s[l]=null;break}if(null==e){if(null==v)return document.createTextNode(y);e=document.createElementNS(i,v,y.is&&y),a&&(Ve.__m&&Ve.__m(t,s),a=!1),s=null}if(null==v)m===y||a&&e.data==y||(e.data=y);else{if(s=s&&He.call(e.childNodes),!a&&null!=s)for(m={},l=0;l<e.attributes.length;l++)m[(p=e.attributes[l]).name]=p.value;for(l in m)if(p=m[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=p;else if(!(l in y)){if("value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y)continue;At(e,l,null,p,i)}for(l in y)p=y[l],"children"==l?h=p:"dangerouslySetInnerHTML"==l?u=p:"value"==l?f=p:"checked"==l?g=p:a&&"function"!=typeof p||m[l]===p||At(e,l,p,m[l],i);if(u)a||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),mt("template"==t.type?e.content:e,st(h)?h:[h],t,n,r,"foreignObject"==v?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:n.__k&&ht(n,0),a,c),null!=s)for(l=s.length;l--;)at(s[l]);a||(l="value","progress"==v&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==v&&!f||"option"==v&&f!=m[l])&&At(e,l,f,m[l],i),l="checked",null!=g&&g!=e[l]&&At(e,l,g,m[l],i))}return e}function Tt(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Ve.__e(e,n)}}function Ct(e,t,n){var r,i;if(Ve.unmount&&Ve.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Tt(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Ve.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Ct(r[i],t,n||"function"!=typeof e.type);n||at(e.__e),e.__c=e.__=e.__e=void 0}function Pt(e,t,n){return this.constructor(e,n)}function Ot(e,t,n){var r,i,s,o;t==document&&(t=document.documentElement),Ve.__&&Ve.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,s=[],o=[],xt(t,e=(!r&&n||t).__k=ct(ut,null,[e]),i||nt,nt,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?He.call(t.childNodes):null,s,!r&&n?n:i?i.__e:t.firstChild,r,o),kt(s,e,o)}He=rt.slice,Ve={__e:function(e,t,n,r){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},Ge=0,dt.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ot({},this.state),"function"==typeof e&&(e=e(ot({},n),this.props)),e&&ot(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ft(this))},dt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ft(this))},dt.prototype.render=ut,Ke=[],Ze="function"==typeof Promise?Promise.prototype.then.bind(Prom
vendor: 4,349 bytes, line 2
2ise.resolve()):setTimeout,Qe=function(e,t){return e.__v.__b-t.__v.__b},gt.__r=0,Ye=/(PointerCapture)$|Capture$/i,Xe=0,$e=_t(!1),et=_t(!0);var Nt,Rt,Mt,Ut,Lt=0,Bt=[],Dt=Ve,jt=Dt.__b,Ft=Dt.__r,zt=Dt.diffed,Wt=Dt.__c,qt=Dt.unmount,Ht=Dt.__;function Vt(e,t){Dt.__h&&Dt.__h(Rt,e,Lt||t),Lt=0;var n=Rt.__H||(Rt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Gt(e){return Lt=1,function(e,t,n){var r=Vt(Nt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):$t(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Rt,!Rt.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!s||s.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),s&&s.call(this,e,t,n)||o};Rt.__f=!0;var s=Rt.shouldComponentUpdate,o=Rt.componentWillUpdate;Rt.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,i(e,t,n),s=r}o&&o.call(this,e,t,n)},Rt.shouldComponentUpdate=i}return r.__N||r.__}($t,e)}function Kt(){for(var e;e=Bt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Qt),e.__H.__h.forEach(Yt),e.__H.__h=[]}catch(t){e.__H.__h=[],Dt.__e(t,e.__v)}}Dt.__b=function(e){Rt=null,jt&&jt(e)},Dt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ht&&Ht(e,t)},Dt.__r=function(e){Ft&&Ft(e),Nt=0;var t=(Rt=e.__c).__H;t&&(Mt===Rt?(t.__h=[],Rt.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Qt),t.__h.forEach(Yt),t.__h=[],Nt=0)),Mt=Rt},Dt.diffed=function(e){zt&&zt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Bt.push(t)&&Ut===Dt.requestAnimationFrame||((Ut=Dt.requestAnimationFrame)||Zt)(Kt)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Mt=Rt=null},Dt.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Qt),e.__h=e.__h.filter(function(e){return!e.__||Yt(e)})}catch(Je){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Dt.__e(Je,e.__v)}}),Wt&&Wt(e,t)},Dt.unmount=function(e){qt&&qt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Qt(e)}catch(e){t=e}}),n.__H=void 0,t&&Dt.__e(t,n.__v))};var Jt="function"==typeof requestAnimationFrame;function Zt(e){var t,n=function(){clearTimeout(r),Jt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Jt&&(t=requestAnimationFrame(n))}function Qt(e){var t=Rt,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Rt=t}function Yt(e){var t=Rt;e.__c=e.__(),Rt=t}function Xt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function $t(e,t){return"function"==typeof t?t(e):t}class en{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=We()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&Ot(ct("div",null,ct(tn,{darkMode:this.darkMode},Array.from(this.items.entries()).map(e=>{let[t,n]=e;return ct(nn,Object.assign({},n,{key:t}))}))),this.root)}}const tn=e=>ct("div",{class:(0,tt.$)("-cbwsdk-snackbar-container")},ct("style",null,".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;
2cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"),ct("div",{class:"-cbwsdk-snackbar"},e.children)),nn=e=>{let{autoExpand:t,message:n,menuItems:r}=e;const[i,s]=Gt(!0),[o,a]=Gt(null!==t&&void 0!==t&&t);!function(e,t){var n=Vt(Nt++,3);!Dt.__s&&Xt(n.__H,t)&&(n.__=e,n.u=t,Rt.__H.__h.push(n))}(()=>{const e=[window.setTimeout(()=>{s(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{e.forEach(window.clearTimeout)}});return ct("div",{class:(0,tt.$)("-cbwsdk-snackbar-instance",i&&"-cbwsdk-snackbar-instance-hidden",o&&"-cbwsdk-snackbar-instance-expanded")},ct("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{a(!o)}},ct("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",ct("div",{class:"-cbwsdk-snackbar-instance-header-message"},n),ct("div",{class:"-gear-container"},!o&&ct("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ct("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),ct("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwu
2NTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&ct("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((e,t)=>ct("div",{class:(0,tt.$)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},ct("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ct("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),ct("span",{class:(0,tt.$)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info)))))},rn="M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z";class sn{constructor(){this.attached=!1,this.snackbar=new en}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,qe()}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:rn,defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}class on{constructor(){this.root=null,this.darkMode=We()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),qe()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(Ot(null,this.root),e&&Ot(ct(an,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const an=e=>{let{title:t,buttonText:n,darkMode:r,onButtonClick:i,onDismiss:s}=e;const o=r?"dark":"light";return ct(tn,{darkMode:r},ct("div",{class:"-cbwsdk-redirect-dialog"},ct("style",null,".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
2.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"),ct("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),ct("div",{class:(0,tt.$)("-cbwsdk-redirect-dialog-box",o)},ct("p",null,t),ct("button",{onClick:i},n))))},cn="https://keys.coinbase.com/connect",ln="https://www.walletlink.org";class un{constructor(){this.attached=!1,this.redirectDialog=new on}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL("https://go.cb-w.com/walletlink");t.searchParams.append("redirect_url",ze().href),e&&t.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=t.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class dn{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=function(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null===(e=null===window||void 0===window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)}(),this.linkedUpdated=e=>{this.isLinked=e;const t=this.storage.getItem(Ie);if(e&&(this._session.linked=e),this.isUnlinkedErrorState=!1,t){const n=t.split(" "),r="true"===this.storage.getItem("IsStandaloneSigning");""===n[0]||e||!this._session.linked||r||(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{this.chainCallbackParams.chainId===e&&this.chainCallbackParams.jsonRpcUrl===t||(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(t,Number.parseInt(e,10)))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),dn.accountRequestCallbackIds.size>0&&(Array.from(dn.accountRequestCallbackIds.values()).forEach(t=>{this.invokeCallback(t,{method:"requestEthereumAccounts",result:[e]})}),dn.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:t,ui:n,connection:r}=this.subscribe();this._session=t,this.connection=r,this.relayEventManager=new Me,this.ui=n,this.ui.attach()}subscribe(){const e=Fe.load(this.storage)||Fe.create(this.storage),{linkAPIUrl:t}=this,n=new Re({session:e,linkAPIUrl:t,listener:this}),r=this.isMobileWeb?new un:new sn;return n.connect(),{session:e,ui:r,connection:n}}resetAndReload(){this.connection.destroy().then(()=>{const e=Fe.load(this.storage);(null===e||void 0===e?void 0:e.id)===this._session.id&&A.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:Q(e.weiValue),data:J(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?Q(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?Q(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?Q(e.gasPriceInWei):null,gasLimit:e.gasLim
2it?Q(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:Q(e.weiValue),data:J(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?Q(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?Q(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?Q(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?Q(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:J(e,!0),chainId:t}})}getWalletLinkSession(){return this._session}sendRequest(e){let t=null;const n=V(8),r=r=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,r),null===t||void 0===t||t()};return new Promise((i,s)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,e=>{if(null===t||void 0===t||t(),Te(e))return s(new Error(e.errorMessage));i(e)}),this.publishWeb3RequestEvent(n,e)})}publishWeb3RequestEvent(e,t){const n={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",n,!0).then(e=>{}).catch(e=>{this.handleWeb3ResponseMessage(n.id,{method:t.method,errorMessage:e.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof un)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink()}}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,n){return this.connection.publishEvent(e,t,n)}handleWeb3ResponseMessage(e,t){if("requestEthereumAccounts"===t.method)return dn.accountRequestCallbackIds.forEach(e=>this.invokeCallback(e,t)),void dn.accountRequestCallbackIds.clear();this.invokeCallback(e,t)}handleErrorResponse(e,t,n){var r;const i=null!==(r=null===n||void 0===n?void 0:n.message)&&void 0!==r?r:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:t,errorMessage:i})}invokeCallback(e,t){const n=this.relayEventManager.callbacks.get(e);n&&(n(t),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:t}=this.metadata,n={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:t}},r=V(8);return new Promise((e,t)=>{this.relayEventManager.callbacks.set(r,n=>{if(Te(n))return t(new Error(n.errorMessage));e(n)}),dn.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,n)})}watchAsset(e,t,n,r,i,s){const o={method:"watchAsset",params:{type:e,options:{address:t,symbol:n,decimals:r,image:i},chainId:s}};let a=null;const c=V(8),l=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,o.method,e),null===a||void 0===a||a()};return a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(c,n=>{if(null===a||void 0===a||a(),Te(n))return t(new Error(n.errorMessage));e(n)}),this.publishWeb3RequestEvent(c,o)})}addEthereumChain(e,t,n,r,i,s){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:r,chainName:i,iconUrls:n,nativeCurrency:s}};let a=null;const c=V(8),l=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,o.method,e),null===a||void 0===a||a()};return a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(c,n=>{if(null===a||void 0===a||a(),Te(n))return t(new Error(n.errorMessage));e(n)}),this.publishWeb3RequestEvent(c,o)})}switchEthereumChain(e,t){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})};let r=null;const i=V(8),s=e=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,e),null===r||void 0===r||r()};return r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),new Promise((e,t)=>
2{this.relayEventManager.callbacks.set(i,n=>(null===r||void 0===r||r(),Te(n)&&n.errorCode?t(R.custom({code:n.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):Te(n)?t(new Error(n.errorMessage)):void e(n))),this.publishWeb3RequestEvent(i,n)})}}dn.accountRequestCallbackIds=new Set;const hn="DefaultChainId",pn="DefaultJsonRpcUrl";class fn{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new A("walletlink",ln),this.callback=e.callback||null;const t=this._storage.getItem(Ie);if(t){const e=t.split(" ");""!==e[0]&&(this._addresses=e.map(e=>re(e)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:n}=e.getWalletLinkSession();return{id:t,secret:n}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(pn))&&void 0!==e?e:void 0}set jsonRpcUrl(e){this._storage.setItem(pn,e)}updateProviderInfo(e,t){var n;this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(hn,t.toString(10));se(t)!==r&&(null===(n=this.callback)||void 0===n||n.call(this,"chainChanged",Y(t)))}async watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw N.invalidParams("Type is required");if("ERC20"!==(null===t||void 0===t?void 0:t.type))throw N.invalidParams("Asset of type '".concat(t.type,"' is not supported"));if(!(null===t||void 0===t?void 0:t.options))throw N.invalidParams("Options are required");if(!(null===t||void 0===t?void 0:t.options.address))throw N.invalidParams("Address is required");const n=this.getChainId(),{address:r,symbol:i,image:s,decimals:o}=t.options,a=this.initializeRelay(),c=await a.watchAsset(t.type,r,i,o,s,null===n||void 0===n?void 0:n.toString());return!Te(c)&&!!c.result}async addEthereumChain(e){var t,n;const r=e[0];if(0===(null===(t=r.rpcUrls)||void 0===t?void 0:t.length))throw N.invalidParams("please pass in at least 1 rpcUrl");if(!r.chainName||""===r.chainName.trim())throw N.invalidParams("chainName is a required field");if(!r.nativeCurrency)throw N.invalidParams("nativeCurrency is a required field");const i=Number.parseInt(r.chainId,16);if(i===this.getChainId())return!1;const s=this.initializeRelay(),{rpcUrls:o=[],blockExplorerUrls:a=[],chainName:c,iconUrls:l=[],nativeCurrency:u}=r,d=await s.addEthereumChain(i.toString(),o,l,a,c,u);if(Te(d))return!1;if(!0===(null===(n=d.result)||void 0===n?void 0:n.isApproved))return this.updateProviderInfo(o[0],i),null;throw N.internal("unable to add ethereum chain")}async switchEthereumChain(e){const t=e[0],n=Number.parseInt(t.chainId,16),r=this.initializeRelay(),i=await r.switchEthereumChain(n.toString(10),this.selectedAddress||void 0);if(Te(i))throw i;const s=i.result;return s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,n),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,t){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(e=>re(e));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,null===(n=this.callback)||void 0===n||n.call(this,"accountsChanged",r),this._storage.setItem(Ie,r.join(" ")))}async request(e){const t=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return Y(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(t);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(t);case"eth_sendTransaction":return this._eth_sendTransaction(t);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(t);case"wallet_switchEthereumChain":return this.switchEthereumChain(t);case"wallet_watchAsset":return this.watchAsset(t);default:if(!this.jsonRpcUrl)throw N.internal("No RPC URL set for chain");return we(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const t=re(e);if(!this._addresses.map(e=>re(e)).includes(t))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?re(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);return{fromAddress:t,toAddress:e.to?re(e.to):null,weiValue:null!=e.value?oe(e.value):BigInt(0),data:e.data?ie(e.data):Buffer.alloc(0),nonce:null!=e.nonce?se(e.nonce):null,gasPriceInWei:null!=e.gasPrice?oe(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?oe(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?oe(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?oe(e.gas):null,chainId:e.chainId?se(e.chainId):this.getChainId()}}async ecRecover(e){const{method:t,params:n}=e;if(!Array.isArray(n))throw N.invalidParams();const r=this.initializeRelay(),i=await r.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:Z(n[0]),signature:Z(n[1]),addPrefix:"personal_ecRecover"===t}});if(Te(i))throw i;return i.result}getChainId(){var e;return Number.parseInt(null!==(e=this._storage.getItem(hn))&&void 0!==e?e:"1",10)}async _eth_requestAccounts(){var e,t;if(this._addresses.length>0)return null===(e=this.callback)||void 0===e||e.call(this,"connect",{chainId:Y(this.getChainId())}),this._addresses;const n=this.initializeRelay(),r=await n.requestEthereumAccounts();if(Te(r))throw r;if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),null===(t=this.callback)||void 0===t||t.call(this,"connect",{chainId:Y(this.getChainId())}),this._addresses}async personalSign(e){let{params:t}=e;if(!Array.isArray(t))throw N.invalidParams();const n=t[1],r=t[0];this._ensureKnownAddress(n);const i=this.initializeRelay(),s=await i.sendRequest({method:"signEthereumMessage",params:{address:re(n),message:Z(r),addPrefix:!0,typedDataJson:null}});if(Te(s))throw s;return s.result}async _eth_signTransaction(e){const t=this._prepareTransactionParams(e[0]||{}),n=this.initializeRelay(),r=await n.signEthereumTransaction(t);
2if(Te(r))throw r;return r.result}async _eth_sendRawTransaction(e){const t=ie(e[0]),n=this.initializeRelay(),r=await n.submitEthereumTransaction(t,this.getChainId());if(Te(r))throw r;return r.result}async _eth_sendTransaction(e){const t=this._prepareTransactionParams(e[0]||{}),n=this.initializeRelay(),r=await n.signAndSubmitEthereumTransaction(t);if(Te(r))throw r;return r.result}async signTypedData(e){const{method:t,params:n}=e;if(!Array.isArray(n))throw N.invalidParams();const r=n["eth_signTypedData_v1"===t?1:0],i=n["eth_signTypedData_v1"===t?0:1];this._ensureKnownAddress(r);const s=this.initializeRelay(),o=await s.sendRequest({method:"signEthereumMessage",params:{address:re(r),message:(a=i,J({eth_signTypedData_v1:Se.hashForSignTypedDataLegacy,eth_signTypedData_v3:Se.hashForSignTypedData_v3,eth_signTypedData_v4:Se.hashForSignTypedData_v4,eth_signTypedData:Se.hashForSignTypedData_v4}[t]({data:ae(a)}),!0)),typedDataJson:JSON.stringify(i,null,2),addPrefix:!1}});var a;if(Te(o))throw o;return o.result}initializeRelay(){return this._relay||(this._relay=new dn({linkAPIUrl:ln,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const gn="SignerType",mn=new A("CBWSDK","SignerConfigurator");async function yn(e){const{communicator:t,metadata:n,handshakeRequest:r,callback:i}=e;(async function(e,t,n){await e.onMessage(e=>{let{event:t}=e;return"WalletLinkSessionRequest"===t});const r=new fn({metadata:t,callback:n});e.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})})(t,n,i).catch(()=>{});const s={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},e.preference),{handshakeRequest:r})},{data:o}=await t.postRequestAndWaitForResponse(s);return o}const{checkCrossOriginOpenerPolicy:vn,getCrossOriginOpenerPolicy:wn}=(()=>{let e;return{getCrossOriginOpenerPolicy:()=>void 0===e?"undefined":e,checkCrossOriginOpenerPolicy:async()=>{if("undefined"!==typeof window)try{const t="".concat(window.location.origin).concat(window.location.pathname),n=await fetch(t,{method:"HEAD"});if(!n.ok)throw new Error("HTTP error! status: ".concat(n.status));const r=n.headers.get("Cross-Origin-Opener-Policy");e=null!==r&&void 0!==r?r:"null","same-origin"===e&&console.error("Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.\n\nPlease see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.")}catch(t){console.error("Error checking Cross-Origin-Opener-Policy:",t.message),e="error"}else e="non-browser-env"}}})(),bn={isRed:!1,info:"Retry",svgWidth:"10",svgHeight:"11",path:rn,defaultFillRule:"evenodd",defaultClipRule:"evenodd"};let An=null;function _n(e){const t=(window.innerWidth-420)/2+window.screenX,n=(window.innerHeight-540)/2+window.screenY;function r(){const r="wallet_".concat(crypto.randomUUID()),i=window.open(e,r,"width=".concat(420,", height=").concat(540,", left=").concat(t,", top=").concat(n));return null===i||void 0===i||i.focus(),i||null}!function(e){const t={sdkName:ve,sdkVersion:ye,origin:window.location.origin,coop:wn()};for(const[n,r]of Object.entries(t))e.searchParams.append(n,r.toString())}(e);let i=r();if(!i){const e=function(){if(!An){const e=document.createElement("div");e.className="-cbwsdk-css-reset",document.body.appendChild(e),An=new en,An.attach(e)}return An}();return new Promise((t,n)=>{e.presentItem({autoExpand:!0,message:"Popup was blocked. Try again.",menuItems:[Object.assign(Object.assign({},bn),{onClick:()=>{i=r(),i?t(i):n(N.internal("Popup window was blocked")),e.clear()}})]})})}return Promise.resolve(i)}class xn{constructor(e){let{url:t=cn,metadata:n,preference:r}=e;this.popup=null,this.listeners=new Map,this.postMessage=async e=>{(await this.waitForPopupLoaded()).postMessage(e,this.url.origin)},this.postRequestAndWaitForResponse=async e=>{const t=this.onMessage(t=>{let{requestId:n}=t;return n===e.id});return this.postMessage(e),await t},this.onMessage=async e=>new Promise((t,n)=>{const r=n=>{if(n.origin!==this.url.origin)return;const i=n.data;e(i)&&(t(i),window.removeEventListener("message",r),this.listeners.delete(r))};window.addEventListener("message",r),this.listeners.set(r,{reject:n})}),this.disconnect=()=>{var e;(e=this.popup)&&!e.closed&&e.close(),this.popup=null,this.listeners.forEac
2h((e,t)=>{let{reject:n}=e;n(R.userRejectedRequest("Request rejected")),window.removeEventListener("message",t)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=await _n(this.url),this.onMessage(e=>{let{event:t}=e;return"PopupUnload"===t}).then(this.disconnect).catch(()=>{}),this.onMessage(e=>{let{event:t}=e;return"PopupLoaded"===t}).then(e=>{this.postMessage({requestId:e.id,data:{version:ye,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw N.internal();return this.popup})),this.url=new URL(t),this.metadata=n,this.preference=r}}function En(e){const t=I(function(e){var t;if("string"===typeof e)return{message:e,code:_.internal};if(Te(e)){const n=e.errorMessage,r=null!==(t=e.errorCode)&&void 0!==t?t:n.match(/(denied|rejected)/i)?x.userRejectedRequest:void 0;return Object.assign(Object.assign({},e),{message:n,code:r,data:{method:e.method}})}return e}(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return n.searchParams.set("version",ye),n.searchParams.set("code",t.code.toString()),n.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:n.href})}class kn extends m.b{}var Sn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};class In extends kn{constructor(e){var{metadata:t}=e,n=e.preference,{keysUrl:r}=n,i=Sn(n,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=t,this.preference=i,this.communicator=new xn({url:r,metadata:t,preference:i});const s=mn.getItem(gn);s&&(this.signer=this.initSigner(s))}async request(e){try{if(function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw N.invalidParams({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:n}=e;if("string"!==typeof t||0===t.length)throw N.invalidParams({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==n&&!Array.isArray(n)&&("object"!==typeof n||null===n))throw N.invalidParams({message:"'args.params' must be an object or array if provided.",data:e});switch(t){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw R.unsupportedMethod()}}(e),!this.signer)switch(e.method){case"eth_requestAccounts":{const t=await this.requestSignerSelection(e),n=this.initSigner(t);await n.handshake(e),this.signer=n,function(e){mn.setItem(gn,e)}(t);break}case"wallet_sendCalls":{const t=this.initSigner("scw");await t.handshake({method:"handshake"});const n=await t.request(e);return await t.cleanup(),n}case"wallet_getCallsStatus":return we(e,"https://rpc.wallet.coinbase.com");case"net_version":return 1;case"eth_chainId":return Y(1);default:throw R.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(t){const{code:e}=t;return e===x.unauthorized&&this.disconnect(),Promise.reject(En(t))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await(null===(e=this.signer)||void 0===e?void 0:e.cleanup()),this.signer=null,A.clearAll(),this.emit("disconnect",R.disconnected("User initiated disconnection"))}requestSignerSelection(e){return yn({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return function(e){const{signerType:t,metadata:n,communicator:r,callback:i}=e;switch(t){case"scw":return new ke({metadata:n,callback:i,communicator:r});case"walletlink":return new fn({metadata:n,callback:i})}}({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}const Tn={options:"all"};function Cn(e){var t;new A("CBWSDK").setItem("VERSION",ye),vn();const n={metadata:{appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||"",appChainIds:e.appChainIds||[]},preference:Object.assign(Tn,null!==(t=e.preference)&&void 0!==t?t:{})};!function(e){if(e){if(!["all","smartWalletOnly","eoaOnly"].includes(e.options))throw new Error("Invalid options: ".concat(e.options));if(e.attribution&&void 0!==e.attribution.auto&&void 0!==e.attribution.dataSuffix)throw new Error("Attribution cannot contain both auto and dataSuffix properties")}}(n.preference);let r=null;return{getProvider:()=>(r||(r=function(e){var t;const n={metadata:e.metadata,preference:e.preference};return null!==(t=be(n))&&void 0!==t?t:new In(n)}(n)),r)}}var Pn=n(36733),On=n(99844);function Nn(){const e=new Set;let t=[];const n=()=>function(e){if("undefined"===typeof window)return;const t=t=>e(t.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}(n=>{t.some(e=>{let{info:t}=e;return t.uuid===n.info.uuid}
2)||(t=[...t,n],e.forEach(e=>e(t,{added:[n]})))});let r=n();return{_listeners:()=>e,clear(){e.forEach(e=>e([],{removed:[...t]})),t=[]},destroy(){var t;this.clear(),e.clear(),null===(t=r)||void 0===t||t()},findProvider(e){let{rdns:n}=e;return t.find(e=>e.info.rdns===n)},getProviders:()=>t,reset(){var e;this.clear(),null===(e=r)||void 0===e||e(),r=n()},subscribe(n){let{emitImmediately:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.add(n),r&&n(t,{added:t}),()=>e.delete(n)}}}var Rn=n(2035),Mn=n(652),Un=n(10133),Ln=n(6806),Bn=n(27133),Dn=n(26833),jn=n(69523),Fn=n(15957),zn=n(66252),Wn=n(52610),qn=n(17488),Hn=n(1688),Vn=n(43157),Gn=n(72582),Kn=n(73660);function Jn(){let e=(0,a.useRef)(!1);return(0,Kn.s)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Zn=n(25087),Qn=n(39898);function Yn(){let e=function(){let e="undefined"==typeof document;return(e=>e.useSyncExternalStore)(c)(()=>()=>{},()=>!1,()=>!e)}(),[t,n]=a.useState(Qn._.isHandoffComplete);return t&&!1===Qn._.isHandoffComplete&&n(!1),a.useEffect(()=>{!0!==t&&n(!0)},[t]),a.useEffect(()=>Qn._.handoff(),[]),!e&&t}var Xn=n(6642),$n=n(5824),er=n(17766),tr=n(54088),nr=n(64284),rr=n(31445);const ir=["transition","beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"],sr=["show","appear","unmount"];function or(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!(0,rr.zv)(null!=(t=e.as)?t:hr)||1===a.Children.count(e.children)}let ar=(0,a.createContext)(null);ar.displayName="TransitionContext";var cr=(e=>(e.Visible="visible",e.Hidden="hidden",e))(cr||{});let lr=(0,a.createContext)(null);function ur(e){return"children"in e?ur(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function dr(e,t){let n=(0,Zn.Y)(e),r=(0,a.useRef)([]),i=Jn(),s=(0,Vn.L)(),o=(0,Gn._)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr.mK.Hidden,o=r.current.findIndex(t=>{let{el:n}=t;return n===e});-1!==o&&((0,nr.Y)(t,{[rr.mK.Unmount](){r.current.splice(o,1)},[rr.mK.Hidden](){r.current[o].state="hidden"}}),s.microTask(()=>{var e;!ur(r)&&i.current&&(null==(e=n.current)||e.call(n))}))}),c=(0,Gn._)(e=>{let t=r.current.find(t=>{let{el:n}=t;return n===e});return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>o(e,rr.mK.Unmount)}),l=(0,a.useRef)([]),u=(0,a.useRef)(Promise.resolve()),d=(0,a.useRef)({enter:[],leave:[]}),h=(0,Gn._)((e,n,r)=>{l.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(t=>{let[n]=t;return n!==e})),null==t||t.chains.current[n].push([e,new Promise(e=>{l.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(d.current[n].map(e=>{let[t,n]=e;return n})).then(()=>e())}
2)]),"enter"===n?u.current=u.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),p=(0,Gn._)((e,t,n)=>{Promise.all(d.current[t].splice(0).map(e=>{let[t,n]=e;return n})).then(()=>{var e;null==(e=l.current.shift())||e()}).then(()=>n(t))});return(0,a.useMemo)(()=>({children:r,register:c,unregister:o,onStart:h,onStop:p,wait:u,chains:d}),[c,o,r,h,p,d,u])}lr.displayName="NestingContext";let hr=a.Fragment,pr=rr.Ac.RenderStrategy;let fr=(0,rr.FX)(function(e,t){let{show:n,appear:r=!1,unmount:o=!0}=e,c=(0,s.A)(e,sr),l=(0,a.useRef)(null),u=or(e),d=(0,Xn.P)(...u?[l,t]:null===t?[]:[t]);Yn();let h=(0,er.O_)();if(void 0===n&&null!==h&&(n=(h&er.Uw.Open)===er.Uw.Open),void 0===n)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[p,f]=(0,a.useState)(n?"visible":"hidden"),g=dr(()=>{n||f("hidden")}),[m,y]=(0,a.useState)(!0),v=(0,a.useRef)([n]);(0,Kn.s)(()=>{!1!==m&&v.current[v.current.length-1]!==n&&(v.current.push(n),y(!1))},[v,n]);let w=(0,a.useMemo)(()=>({show:n,appear:r,initial:m}),[n,r,m]);(0,Kn.s)(()=>{n?f("visible"):!ur(g)&&null!==l.current&&f("hidden")},[n,g]);let b={unmount:o},A=(0,Gn._)(()=>{var t;m&&y(!1),null==(t=e.beforeEnter)||t.call(e)}),_=(0,Gn._)(()=>{var t;m&&y(!1),null==(t=e.beforeLeave)||t.call(e)}),x=(0,rr.Ci)();return a.createElement(lr.Provider,{value:g},a.createElement(ar.Provider,{value:w},x({ourProps:(0,i.A)((0,i.A)({},b),{},{as:a.Fragment,children:a.createElement(gr,(0,i.A)((0,i.A)((0,i.A)({ref:d},b),c),{},{beforeEnter:A,beforeLeave:_}))}),theirProps:{},defaultTag:a.Fragment,features:pr,visible:"visible"===p,name:"Transition"})))}),gr=(0,rr.FX)(function(e,t){var n,r;let{transition:o=!0,beforeEnter:c,afterEnter:l,beforeLeave:u,afterLeave:d,enter:h,enterFrom:p,enterTo:f,entered:g,leave:m,leaveFrom:y,leaveTo:v}=e,w=(0,s.A)(e,ir),[b,A]=(0,a.useState)(null),_=(0,a.useRef)(null),x=or(e),E=(0,Xn.P)(...x?[_,t,A]:null===t?[]:[t]),k=null==(n=w.unmount)||n?rr.mK.Unmount:rr.mK.Hidden,{show:S,appear:I,initial:T}=function(){let e=(0,a.useContext)(ar);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[C,P]=(0,a.useState)(S?"visible":"hidden"),O=function(){let e=(0,a.useContext)(lr);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:N,unregister:R}=O;(0,Kn.s)(()=>N(_),[N,_]),(0,Kn.s)(()=>{if(k===rr.mK.Hidden&&_.current)return S&&"visible"!==C?void P("visible"):(0,nr.Y)(C,{hidden:()=>R(_),visible:()=>N(_)})},[C,_,N,R,S,k]);let M=Yn();(0,Kn.s)(()=>{if(x&&M&&"visible"===C&&null===_.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,C,M,x]);let U=T&&!I,L=I&&S&&T,B=(0,a.useRef)(!1),D=dr(()=>{B.current||(P("hidden"),R(_))},O),j=(0,Gn._)(e=>{B.current=!0;let t=e?"enter":"leave";D.onStart(_,t,e=>{"enter"===e?null==c||c():"leave"===e&&(null==u||u())})}),F=(0,Gn._)(e=>{let t=e?"enter":"leave";B.current=!1,D.onStop(_,t,e=>{"enter"===e?null==l||l():"leave"===e&&(null==d||d())}),"leave"===t&&!ur(D)&&(P("hidden"),R(_))});(0,a.useEffect)(()=>{x&&o||(j(S),F(S))},[S,x,o]);let z=!(!o||!x||!M||U),[,W]=(0,$n.p)(z,b,S,{start:j,end:F}),q=(0,rr.oE)((0,i.A)({ref:E,className:(null==(r=(0,tr.x)(w.className,L&&h,L&&p,W.enter&&h,W.enter&&W.closed&&p,W.enter&&!W.closed&&f,W.leave&&m,W.leave&&!W.closed&&y,W.leave&&W.closed&&v,!W.transition&&S&&g))?void 0:r.trim())||void 0},(0,$n.B)(W))),H=0;"visible"===C&&(H|=er.Uw.Open),"hidden"===C&&(H|=er.Uw.Closed),S&&"hidden"===C&&(H|=er.Uw.Opening),!S&&"visible"===C&&(H|=er.Uw.Closing);let V=(0,rr.Ci)();return a.createElement(lr.Provider,{value:D},a.createElement(er.El,{value:H},V({ourProps:q,theirProps:w,defaultTag:hr,features:pr,visible:"visible"===C,name:"Transition.Child"})))}),mr=(0,rr.FX)(function(e,t){let n=null!==(0,a.useContext)(ar),r=null!==(0,er.O_)();return a.createElement(a.Fragment,null,!n&&r?a.createElement(fr,(0,i.A)({ref:t},e)):a.createElement(gr,(0,i.A)({ref:t},e)))}),yr=Object.assign(fr,{Child:mr,Root:fr});var vr=n(67775);function wr(e,t,n,r){let i=(0,Zn.Y)(n);(0,a.useEffect)(()=>{function n(e){i.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}var br=n(43470);var Ar=n(43888);var _r=n(29581),xr=n(73524),Er=n(47677);const kr=["features"];var Sr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Sr||{});let Ir=(0,rr.FX)(function(e,t){var n;let{features:r=1}=e,o=(0,s.A)(e,kr),a={ref:t,"aria-hidden":2===(2&r)||(null!=(n=o["aria-hidden"])?n:void 0),hidden:4===(4&r)||void 0,style:(0,i.A)({position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},4===(4&r)&&2!==(2&r)&&{display:"none"})};return(0,rr.Ci)()({ourProps:a,theirProps:o,slot:{},defaultTag:"span",name:"Hidden"})});var Tr=n(56973),Cr=n(95554);let Pr=(0,a.createContext)(null);function Or(e){let{children:t,node:n}=e,[r,i]=(0,a.useState)(null),s=Nr(null!=n?n:r);return a.createElement(Pr.Provider,{value:s},t,null===s&&a.createElement(Ir,{features:Sr.Hidden,ref:e=>{var t,n;if(e)for(let r of null!=(n=null==(t=(0,Cr.TW)(e))?void 0:t.querySelectorAll("html > *, body > *"))?n:[])if(r!==document.body&&r!==document.head&&Tr.vq(r)&&null!=r&&r.contains(e)){i(r);break}}}))}function Nr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;var t;return null!=(t=(0,a.useContext)(Pr))?t:e}var Rr=n(52897),Mr=n(82504);let Ur=(0,a.createContext)(()=>{});function Lr(e){let{value:t,children:n}=e;return a.createElement(Ur.Provider,{value:t},n)}var Br=n(52830),Dr=n(91866),jr=n(74324),Fr=n(66751),zr=n(73160),Wr=n(35653),qr=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(qr||{});function Hr(e,t){let n=(0,a.useRef)([]),r=(0,Gn._)(e);(0,a.useEffect)(()=>{let e=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let i=r(t,e);return n.current=t,i}},[r,...t])}var Vr=n(51145);let Gr=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){if(!Tr.Lk(e.target)||e.target===document.body||Gr[0]===e.target)return;let t=e.target;
2t=t.closest(Vr.Uo),Gr.unshift(null!=t?t:e.target),Gr=Gr.filter(e=>null!=e&&e.isConnected),Gr.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var Kr=n(44179);const Jr=["initialFocus","initialFocusFallback","containers","features"];function Zr(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)Tr.vq(n.current)&&t.add(n.current);return t}var Qr=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(Qr||{});let Yr=(0,rr.FX)(function(e,t){let n=(0,a.useRef)(null),r=(0,Xn.P)(n,t),{initialFocus:i,initialFocusFallback:o,containers:c,features:l=15}=e,u=(0,s.A)(e,Jr);Yn()||(l=0);let d=(0,Er.g)(n.current);!function(e,t){let{ownerDocument:n}=t,r=!!(8&e),i=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=(0,a.useRef)(Gr.slice());return Hr((e,n)=>{let[r]=e,[i]=n;!0===i&&!1===r&&(0,Kr._)(()=>{t.current.splice(0)}),!1===i&&!0===r&&(t.current=Gr.slice())},[e,Gr,t]),(0,Gn._)(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(r);Hr(()=>{r||(0,Cr.X7)(null==n?void 0:n.body)&&(0,Vr.pW)(i())},[r]),(0,zr.X)(()=>{r&&(0,Vr.pW)(i())})}(l,{ownerDocument:d});let h=function(e,t){let{ownerDocument:n,container:r,initialFocus:i,initialFocusFallback:s}=t,o=(0,a.useRef)(null),c=(0,br.S)(!!(1&e),"focus-trap#initial-focus"),l=Jn();return Hr(()=>{if(0===e)return;if(!c)return void(null!=s&&s.current&&(0,Vr.pW)(s.current));let t=r.current;t&&(0,Kr._)(()=>{if(!l.current)return;let r=null==n?void 0:n.activeElement;if(null!=i&&i.current){if((null==i?void 0:i.current)===r)return void(o.current=r)}else if(t.contains(r))return void(o.current=r);if(null!=i&&i.current)(0,Vr.pW)(i.current);else{if(16&e){if((0,Vr.CU)(t,Vr.BD.First|Vr.BD.AutoFocus)!==Vr.Me.Error)return}else if((0,Vr.CU)(t,Vr.BD.First)!==Vr.Me.Error)return;if(null!=s&&s.current&&((0,Vr.pW)(s.current),(null==n?void 0:n.activeElement)===s.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}o.current=null==n?void 0:n.activeElement})},[s,c,e]),o}(l,{ownerDocument:d,container:n,initialFocus:i,initialFocusFallback:o});!function(e,t){let{ownerDocument:n,container:r,containers:i,previousActiveElement:s}=t,o=Jn(),a=!!(4&e);wr(null==n?void 0:n.defaultView,"focus",e=>{if(!a||!o.current)return;let t=Zr(i);Tr.sb(r.current)&&t.add(r.current);let n=s.current;if(!n)return;let c=e.target;Tr.sb(c)?$r(t,c)?(s.current=c,(0,Vr.pW)(c)):(e.preventDefault(),e.stopPropagation(),(0,Vr.pW)(n)):(0,Vr.pW)(s.current)},!0)}(l,{ownerDocument:d,container:n,containers:c,previousActiveElement:h});let p=function(){let e=(0,a.useRef)(0);return(0,Wr.M)(!0,"keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}(),f=(0,Gn._)(e=>{if(!Tr.sb(n.current))return;let t=n.current;(0,nr.Y)(p.current,{[qr.Forwards]:()=>{(0,Vr.CU)(t,Vr.BD.First,{skipElements:[e.relatedTarget,o]})},[qr.Backwards]:()=>{(0,Vr.CU)(t,Vr.BD.Last,{skipElements:[e.relatedTarget,o]})}})}
2),g=(0,br.S)(!!(2&l),"focus-trap#tab-lock"),m=(0,Vn.L)(),y=(0,a.useRef)(!1),v={ref:r,onKeyDown(e){"Tab"==e.key&&(y.current=!0,m.requestAnimationFrame(()=>{y.current=!1}))},onBlur(e){if(!(4&l))return;let t=Zr(c);Tr.sb(n.current)&&t.add(n.current);let r=e.relatedTarget;Tr.Lk(r)&&"true"!==r.dataset.headlessuiFocusGuard&&($r(t,r)||(y.current?(0,Vr.CU)(n.current,(0,nr.Y)(p.current,{[qr.Forwards]:()=>Vr.BD.Next,[qr.Backwards]:()=>Vr.BD.Previous})|Vr.BD.WrapAround,{relativeTo:e.target}):Tr.Lk(e.target)&&(0,Vr.pW)(e.target)))}},w=(0,rr.Ci)();return a.createElement(a.Fragment,null,g&&a.createElement(Ir,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:Sr.Focusable}),w({ourProps:v,theirProps:u,defaultTag:"div",name:"FocusTrap"}),g&&a.createElement(Ir,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:Sr.Focusable}))}),Xr=Object.assign(Yr,{features:Qr});function $r(e,t){for(let n of e)if(n.contains(t))return!0;return!1}var ei=n(52177);const ti=["id","open","onClose","initialFocus","role","autoFocus","__demoMode","unmount"],ni=["transition","open"],ri=["id","transition"],ii=["transition"],si=["id"];var oi=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(oi||{}),ai=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ai||{});let ci={0:(e,t)=>e.titleId===t.id?e:(0,i.A)((0,i.A)({},e),{},{titleId:t.id})},li=(0,a.createContext)(null);function ui(e){let t=(0,a.useContext)(li);if(null===t){let t=new Error("<".concat(e," /> is missing a parent <Dialog /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,ui),t}return t}function di(e,t){return(0,nr.Y)(t.type,ci,e,t)}li.displayName="DialogContext";let hi=(0,rr.FX)(function(e,t){let n=(0,a.useId)(),{id:r="headlessui-dialog-".concat(n),open:i,onClose:o,initialFocus:c,role:l="dialog",autoFocus:u=!0,__demoMode:d=!1,unmount:h=!1}=e,p=(0,s.A)(e,ti),f=(0,a.useRef)(!1);l="dialog"===l||"alertdialog"===l?l:(f.current||(f.current=!0,console.warn("Invalid role [".concat(l,"] passed to <Dialog />. Only `dialog` and and `alertdialog` are supported. Using `dialog` instead."))),"dialog");let g=(0,er.O_)();void 0===i&&null!==g&&(i=(g&er.Uw.Open)===er.Uw.Open);let m=(0,a.useRef)(null),y=(0,Xn.P)(m,t),v=(0,Er.g)(m.current),w=i?0:1,[b,A]=(0,a.useReducer)(di,{titleId:null,descriptionId:null,panelRef:(0,a.createRef)()}),_=(0,Gn._)(()=>o(!1)),x=(0,Gn._)(e=>A({type:0,id:e})),E=!!Yn()&&0===w,[k,S]=(0,ei.k2)(),I={get current(){var e;return null!=(e=b.panelRef.current)?e:m.current}},T=Nr(),{resolveContainers:C}=function(){let{defaultContainers:e=[],portals:t,mainTreeNode:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,Gn._)(()=>{var r,i;let s=(0,Cr.TW)(n),o=[];for(let t of e)null!==t&&(Tr.vq(t)?o.push(t):"current"in t&&Tr.vq(t.current)&&o.push(t.current));if(null!=t&&t.current)for(let e of t.current)o.push(e);for(let e of null!=(r=null==s?void 0:s.querySelectorAll("html > *, body > *"))?r:[])e!==document.body&&e!==document.head&&Tr.vq(e)&&"headlessui-portal-root"!==e.id&&(n&&(e.contains(n)||e.contains(null==(i=null==n?void 0:n.getRootNode())?void 0:i.host))||o.some(t=>e.contains(t))||o.push(e));return o}
2);return{resolveContainers:r,contains:(0,Gn._)(e=>r().some(t=>t.contains(e)))}}({mainTreeNode:T,portals:k,defaultContainers:[I]}),P=null!==g&&(g&er.Uw.Closing)===er.Uw.Closing;(0,Ar.v)(!d&&!P&&E,{allowed:(0,Gn._)(()=>{var e,t;return[null!=(t=null==(e=m.current)?void 0:e.closest("[data-headlessui-portal]"))?t:null]}),disallowed:(0,Gn._)(()=>{var e;return[null!=(e=null==T?void 0:T.closest("body > *:not(#headlessui-portal-root)"))?e:null]})});let O=Dr.D.get(null);(0,Kn.s)(()=>{if(E)return O.actions.push(r),()=>O.actions.pop(r)},[O,r,E]);let N=(0,jr.y)(O,(0,a.useCallback)(e=>O.selectors.isTop(e,r),[O,r]));(0,xr.j)(N,C,e=>{e.preventDefault(),_()}),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"undefined"!=typeof document?document.defaultView:null,n=arguments.length>2?arguments[2]:void 0,r=(0,br.S)(e,"escape");wr(t,"keydown",e=>{r&&(e.defaultPrevented||e.key===vr.D.Escape&&n(e))})}(N,null==v?void 0:v.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),_()}),(0,Rr.K)(!d&&!P&&E,v,C),(0,_r.O)(E,m,_);let[R,M]=(0,Fr.rU)(),U=(0,a.useMemo)(()=>[{dialogState:w,close:_,setTitleId:x,unmount:h},b],[w,_,x,h,b]),L=(0,Mr._)({open:0===w}),B={ref:y,id:r,role:l,tabIndex:-1,"aria-modal":d?void 0:0===w||void 0,"aria-labelledby":b.titleId,"aria-describedby":R,unmount:h},D=!function(){var e;let[t]=(0,a.useState)(()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null),[n,r]=(0,a.useState)(null!=(e=null==t?void 0:t.matches)&&e);return(0,Kn.s)(()=>{if(t)return t.addEventListener("change",e),()=>t.removeEventListener("change",e);function e(e){r(e.matches)}},[t]),n}(),j=Qr.None;E&&!d&&(j|=Qr.RestoreFocus,j|=Qr.TabLock,u&&(j|=Qr.AutoFocus),D&&(j|=Qr.InitialFocus));let F=(0,rr.Ci)();return a.createElement(er.$x,null,a.createElement(Br.a,{force:!0},a.createElement(ei.ZL,null,a.createElement(li.Provider,{value:U},a.createElement(ei.Ee,{target:m},a.createElement(Br.a,{force:!1},a.createElement(M,{slot:L},a.createElement(S,null,a.createElement(Xr,{initialFocus:c,initialFocusFallback:m,containers:C,features:j},a.createElement(Lr,{value:_},F({ourProps:B,theirProps:p,slot:L,defaultTag:pi,features:fi,visible:0===w,name:"Dialog"})))))))))))}),pi="div",fi=rr.Ac.RenderStrategy|rr.Ac.Static;let gi=(0,rr.FX)(function(e,t){let{transition:n=!1,open:r}=e,o=(0,s.A)(e,ni),c=(0,er.O_)(),l=e.hasOwnProperty("open")||null!==c,u=e.hasOwnProperty("onClose");if(!l&&!u)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!l)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!u)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!c&&"boolean"!=typeof e.open)throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: ".concat(e.open));if("function"!=typeof e.onClose)throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: ".concat(e.onClose));return void 0===r&&!n||o.static?a.createElement(Or,null,a.createElement(hi,(0,i.A)({ref:t,open:r},o))):a.createElement(Or,null,a.createElement(yr,{show:r,transition:n,unmount:o.unmount},a.createElement(hi,(0,i.A)({ref:t},o))))}),mi=(0,rr.FX)(function(e,t){let n=(0,a.useId)(),{id:r="headlessui-dialog-panel-".concat(n),transition:o=!1}=e,c=(0,s.A)(e,ri),[{dialogState:l,unmount:u},d]=ui("Dialog.Panel"),h=(0,Xn.P)(t,d.panelRef),p=(0,Mr._)({open:0===l}),f=(0,Gn._)(e=>{e.stopPropagation()}),g={ref:h,id:r,onClick:f},m=o?mr:a.Fragment,y=o?{unmount:u}:{},v=(0,rr.Ci)();return a.createElement(m,(0,i.A)({},y),v({ourProps:g,theirProps:c,slot:p,defaultTag:"div",name:"Dialog.Panel"}))}),yi=((0,rr.FX)(function(e,t){let{transition:n=!1}=e,r=(0,s.A)(e,ii),[{dialogState:o,unmount:c}]=ui("Dialog.Backdrop"),l=(0,Mr._)({open:0===o}),u={ref:t,"aria-hidden":!0},d=n?mr:a.Fragment,h=n?{unmount:c}:{},p=(0,rr.Ci)();return a.createElement(d,(0,i.A)({},h),p({ourProps:u,theirProps:r,slot:l,defaultTag:"div",name:"Dialog.Backdrop"}))}),(0,rr.FX)(function(e,t){let n=(0,a.useId)(),{id:r="headlessui-dialog-title-".concat(n)}=e,i=(0,s.A)(e,si),[{dialogState:o,setTitleId:c}]=ui("Dialog.Title"),l=(0,Xn.P)(t);(0,a.useEffect)(()=>(c(r),()=>c(null)),[r,c]);let u=(0,Mr._)({open:0===o}),d={ref:l,id:r};return(0,rr.Ci)()({ourProps:d,theirProps:i,slot:u,defaultTag:"h2",name:"Dialog.Title"})})),vi=Object.assign(gi,{Panel:mi,Title:yi,Description:Fr.VY});var wi=n(69692),bi=n.n(wi),Ai=n(91376),_i=n(77628),xi=n(70121),Ei=n(50543);
2class ki extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(e=>{if(t.cause instanceof ki){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"===typeof t.cause.details?t.cause.details:null!==(e=t.cause)&&void 0!==e&&e.message?t.cause.message:t.details})(),r=t.cause instanceof ki&&t.cause.docsPath||t.docsPath,i="".concat("https://oxlib.sh").concat(null!==r&&void 0!==r?r:""),s=[e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...n||r?["",n?"Details: ".concat(n):void 0,r?"See: ".concat(i):void 0]:[]].filter(e=>"string"===typeof e).join("\n");super(s,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"ox@".concat("0.1.1")}),this.cause=t.cause,this.details=n,this.docs=i,this.docsPath=r,this.shortMessage=e}walk(e){return Si(this,e)}}function Si(e,t){return null!==t&&void 0!==t&&t(e)?e:e&&"object"===typeof e&&"cause"in e&&e.cause?Si(e.cause,t):t?null:e}function Ii(e,t){if(Di(e)>t)throw new qi({givenSize:Di(e),maxSize:t})}function Ti(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{dir:n,size:r=32}=t;if(0===r)return e;const i=e.replace("0x","");if(i.length>2*r)throw new Vi({size:Math.ceil(i.length/2),targetSize:r,type:"Hex"});return"0x".concat(i["right"===n?"padEnd":"padStart"](2*r,"0"))}const Ci="#__bigint";function Pi(e,t,n){return JSON.stringify(e,(e,n)=>"function"===typeof t?t(e,n):"bigint"===typeof n?n.toString()+Ci:n,n)}const Oi=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ni(e){return e instanceof Uint8Array?Ri(e):Array.isArray(e)?Ri(new Uint8Array(e)):e}function Ri(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="";for(let i=0;i<e.length;i++)n+=Oi[e[i]];const r="0x".concat(n);return"number"===typeof t.size?(Ii(r,t.size),Li(r,t.size)):r}function Mi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{signed:n,size:r}=t,i=BigInt(e);let s;r?s=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"===typeof e&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o="bigint"===typeof s&&n?-s-1n:0;if(s&&i>s||i<o){const t="bigint"===typeof e?"n":"";throw new Fi({max:s?"".concat(s).concat(t):void 0,min:"".concat(o).concat(t),signed:n,size:r,value:"".concat(e).concat(t)})}const a=(n&&i<0?(1n<<BigInt(8*r))+BigInt(i):i).toString(16),c="0x".concat(a);return r?Ui(c,r):c}function Ui(e,t){return Ti(e,{dir:"left",size:t})}function Li(e,t){return Ti(e,{dir:"right",size:t})}function Bi(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{strict:i}=r;!function(e,t){if("number"===typeof t&&t>0&&t>Di(e)-1)throw new Hi({offset:t,position:"start",size:Di(e)})}(e,t);const s="0x".concat(e.replace("0x","").slice(2*(null!==t&&void 0!==t?t:0),2*(null!==n&&void 0!==n?n:e.length)));return i&&function(e,t,n){if("number"===typeof t&&"number"===typeof n&&Di(e)!==n-t)throw new Hi({offset:n,position:"end",size:Di(e)})}(s,t,n),s}function Di(e){return Math.ceil((e.length-2)/2)}function ji(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{strict:n=!1}=t;try{return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{strict:n=!1}=t;if(!e)throw new zi(e);if("string"!==typeof e)throw new zi(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Wi(e);if(!e.startsWith("0x"))throw new Wi(e)}(e,{strict:n}),!0}catch(r){return!1}}class Fi extends ki{constructor(e){let{max:t,min:n,signed:r,size:i,value:s}=e;super("Number `".concat(s,"` is not in safe").concat(i?" ".concat(8*i,"-bit"):"").concat(r?" signed":" unsigned"," integer range ").concat(t?"(`".concat(n,"` to `").concat(t,"`)"):"(above `".concat(n,"`)"))),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class zi extends ki{constructor(e){super("Value `".concat("object"===typeof e?Pi(e):e,"` of type `").concat(typeof e,"` is an invali
2d hex type."),{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class Wi extends ki{constructor(e){super("Value `".concat(e,"` is an invalid hex value."),{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class qi extends ki{constructor(e){let{givenSize:t,maxSize:n}=e;super("Size cannot exceed `".concat(n,"` bytes. Given size: `").concat(t,"` bytes.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class Hi extends ki{constructor(e){let{offset:t,position:n,size:r}=e;super("Slice ".concat("start"===n?"starting":"ending"," at offset `").concat(t,"` is out-of-bounds (size: `").concat(r,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class Vi extends ki{constructor(e){let{size:t,targetSize:n,type:r}=e;super("".concat(r.charAt(0).toUpperCase()).concat(r.slice(1).toLowerCase()," size (`").concat(t,"`) exceeds padding size (`").concat(n,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function Gi(e){if(130!==e.length&&132!==e.length)throw new Ji({signature:e});const t=BigInt(Bi(e,0,32)),n=BigInt(Bi(e,32,64)),r=(()=>{const t=Number("0x".concat(e.slice(130)));if(!Number.isNaN(t))try{return Ki(t)}catch(n){throw new Zi({value:t})}})();return"undefined"===typeof r?{r:t,s:n}:{r:t,s:n,yParity:r}}function Ki(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return e%2===0?1:0;throw new Qi({value:e})}class Ji extends ki{constructor(e){let{signature:t}=e;super("Value `".concat(t,"` is an invalid signature size."),{metaMessages:["Expected: 64 bytes or 65 bytes.","Received ".concat(Di(Ni(t))," bytes.")]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Zi extends ki{constructor(e){let{value:t}=e;super("Value `".concat(t,"` is an invalid y-parity value. Y-parity must be 0 or 1.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class Qi extends ki{constructor(e){let{value:t}=e;super("Value `".concat(t,"` is an invalid v value. v must be 27, 28 or >=35.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}var Yi=n(7856);const Xi=48,$i=57,es=65,ts=70,ns=97,rs=102;function is(e){return e>=Xi&&e<=$i?e-Xi:e>=es&&e<=ts?e-(es-10):e>=ns&&e<=rs?e-(ns-10):void 0}const ss=new TextEncoder;function os(e){return e instanceof Uint8Array?e:"string"===typeof e?as(e):function(e){return e instanceof Uint8Array?e:new Uint8Array(e)}(e)}function as(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n}=t;let r=e;n&&(Ii(e,n),r=Li(e,n));let i=r.slice(2);i.length%2&&(i="0".concat(i));const s=i.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const e=is(i.charCodeAt(c++)),t=is(i.charCodeAt(c++));if(void 0===e||void 0===t)throw new ki('Invalid byte sequence ("'.concat(i[c-2]).concat(i[c-1],'" in "').concat(i,'").'));o[a]=16*e+t}return o}function cs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n}=t,r=ss.encode(e);return"number"===typeof n?(function(e,t){if(ls(e)>t)throw new hs({givenSize:ls(e),maxSize:t})}(r,n),function(e,t){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{dir:n,size:r=32}=t;if(0===r)return e;if(e.length>r)throw new ps({size:e.length,targetSize:r,type:"Bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const t="right"===n;i[t?s:r-s-1]=e[t?s:e.length-s-1]}return i}(e,{dir:"right",size:t})}(r,n)):r}function ls(e){return e.length}function us(e){try{return function(e){if(!(e instanceof Uint8Array)){if(!e)throw new ds(e);if("object"!==typeof e)throw new ds(e);if(!("BYTES_PER_ELEMENT"in e))throw new ds(e);if(1!==e.BYTES_PER_ELEMENT||"Uint8Array"!==e.constructor.name)throw new ds(e)}}(e),!0}catch(t){return!1}}class ds extends ki{constructor(e){super("Value `".concat("object"===typeof e?Pi(e):e,"` of type `").concat(typeof e,"` is an invali
2d Bytes value."),{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class hs extends ki{constructor(e){let{givenSize:t,maxSize:n}=e;super("Size cannot exceed `".concat(n,"` bytes. Given size: `").concat(t,"` bytes.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class ps extends ki{constructor(e){let{size:t,targetSize:n,type:r}=e;super("".concat(r.charAt(0).toUpperCase()).concat(r.slice(1).toLowerCase()," size (`").concat(t,"`) exceeds padding size (`").concat(n,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}class fs extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const gs={checksum:new fs(8192)},ms=gs.checksum;var ys=n(75008);function vs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{as:n=("string"===typeof e?"Hex":"Bytes")}=t,r=(0,ys.lY)(os(e));return"Bytes"===n?r:Ri(r)}function ws(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{compressed:n}=t,{prefix:r,x:i,y:s}=e;if(!1===n||"bigint"===typeof i&&"bigint"===typeof s){if(4!==r)throw new Es({prefix:r,cause:new Ss})}else{if(!0!==n&&("bigint"!==typeof i||"undefined"!==typeof s))throw new xs({publicKey:e});if(3!==r&&2!==r)throw new Es({prefix:r,cause:new ks})}}function bs(e){const t=(()=>{if(ji(e))return As(e);if(us(e))return function(e){return As(Ri(e))}(e);const{prefix:t,x:n,y:r}=e;return"bigint"===typeof n&&"bigint"===typeof r?{prefix:null!==t&&void 0!==t?t:4,x:n,y:r}:{prefix:t,x:n}})();return ws(t),t}function As(e){if(132!==e.length&&130!==e.length&&68!==e.length)throw new Is({publicKey:e});if(130===e.length){return{prefix:4,x:BigInt(Bi(e,0,32)),y:BigInt(Bi(e,32,64))}}if(132===e.length){return{prefix:Number(Bi(e,0,1)),x:BigInt(Bi(e,1,33)),y:BigInt(Bi(e,33,65))}}return{prefix:Number(Bi(e,0,1)),x:BigInt(Bi(e,1,33))}}function _s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ws(e);const{prefix:n,x:r,y:i}=e,{includePrefix:s=!0}=t,o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"0x".concat(t.reduce((e,t)=>e+t.replace("0x",""),""))}(s?Mi(n,{size:1}):"0x",Mi(r,{size:32}),"bigint"===typeof i?Mi(i,{size:32}):"0x");return o}class xs extends ki{constructor(e){let{publicKey:t}=e;super("Value `".concat(Pi(t),"` is not a valid public key."),{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class Es extends ki{constructor(e){let{prefix:t,cause:n}=e;super('Prefix "'.concat(t,'" is invalid.'),{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class ks extends ki{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class Ss extends ki{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class Is extends ki{constructor(e){let{publicKey:t}=e;super("Value `".concat(t,"` is an invalid public key size."),{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).","Received ".concat(Di(Ni(t))," bytes.")]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}const Ts=/^0x[a-fA-F0-9]{40}$/;function Cs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{strict:n=!0}=t;if(!Ts.test(e))throw new Ns({address:e,cause:new Rs});if(n){if(e.toLowerCase()===e)return;if(Ps(e)!==e)throw new Ns({address:e,cause:new Ms})}}function Ps(e){if(ms.has(e))return ms.get(e);Cs(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=vs(cs(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(15&n[s>>1])>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const i="0x".concat(r.join(""));return ms.set(e,i),i}function Os(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=vs("0x".concat(_s(e).slice(4))).substring(26);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{checksum:n=!1}=t;return Cs(e),n?Ps(e):e}("0x".concat(n),t)}class Ns extends ki{constructor(e){let{address:t,cause:n}=e;
2super('Address "'.concat(t,'" is invalid.'),{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class Rs extends ki{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Ms extends ki{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function Us(e){return Os(function(e){const{payload:t,signature:n}=e,{r:r,s:i,yParity:s}=n,o=new Yi.secp256k1.Signature(BigInt(r),BigInt(i)).addRecoveryBit(s);return bs(o.recoverPublicKey(Ni(t).substring(2)))}(e))}var Ls=n(5890),Bs=n(16447),Ds=n(90268),js=n(4750),Fs=n(89225),zs=n(23691),Ws=n(34903),qs=n(82951),Hs=n.n(qs),Vs=n(77101);const Gs="info",Ks="custom_context",Js=1024e3;var Zs=Object.defineProperty,Qs=(e,t,n)=>((e,t,n)=>t in e?Zs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Ys{constructor(e){Qs(this,"nodeValue"),Qs(this,"sizeInBytes"),Qs(this,"next"),this.nodeValue=e,this.sizeInBytes=(new TextEncoder).encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Xs{constructor(e){Qs(this,"lengthInNodes"),Qs(this,"sizeInBytes"),Qs(this,"head"),Qs(this,"tail"),Qs(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new Ys(e);if(t.size>this.maxSizeInBytes)throw new Error("[LinkedList] Value too big to insert into list: ".concat(e," with size ").concat(t.size));for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}}var $s=Object.defineProperty,eo=(e,t,n)=>((e,t,n)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class to{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Js;eo(this,"logs"),eo(this,"level"),eo(this,"levelValue"),eo(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=null!==e&&void 0!==e?e:"error",this.levelValue=qs.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new Xs(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===qs.levels.values.error?console.error(e):t===qs.levels.values.warn?console.warn(e):t===qs.levels.values.debug?console.debug(e):t===qs.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append((0,Vs.h)({timestamp:(new Date).toISOString(),log:e}));const t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new Xs(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push((0,Vs.h)({extraMetadata:e})),new Blob(t,{type:"application/json"})}}var no=Object.defineProperty,ro=(e,t,n)=>((e,t,n)=>t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class io{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Js;ro(this,"baseChunkLogger"),this.baseChunkLogger=new to(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=t,n.download="walletconnect-logs-".concat((new Date).toISOString(),".txt"),document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)}}var so=Object.defineProperty,oo=(e,t,n)=>((e,t,n)=>t in e?so(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class ao{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Js;oo(this,"baseChunkLogger"),this.baseChunkLogger=new to(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var co=Object.defineProperty,lo=Object.defineProperties,uo=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,fo=Object.prototype.propertyIsEnumerable,go=(e,t,n)=>t in e?co(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mo=(e,t)=>{for(var n in t||(t={}))po.call(t,n)&&go(e,n,t[n]);if(ho)for(var n of ho(t))fo.call(t,n)&&go(e,n,t[n]);return e},yo=(e,t)=>lo(e,uo(t));function vo(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ks]||""}function wo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ks;const r=function(e,t){const n=vo(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ks);return n.trim()?"".concat(n,"/").concat(t):t}(e,t,n);return function(e,t){return e[arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ks]=t,e}(e.child({context:r}),r,n)}function bo(e){return typeof e.loggerOverride<"u"&&"string"!=typeof e.loggerOverride?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?function(e){var t,n;const r=new io(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:Hs()(yo(mo({},e.opts),{level:"trace",browser:yo(mo({},null==(n=e.opts)?void 0:n.browser),{write:e=>r.write(e)})})),chunkLoggerController:r}}(e):function(e){var t;const n=new ao(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:Hs()(yo(mo({},e.opts),{level:"trace"}),n),chunkLoggerController:n}}(e)}const Ao=":";function _o(e){const[t,n]=e.split(Ao);return{namespace:t,reference:n}}function xo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=[];return Object.keys(e).forEach(r=>{if(t.length&&!t.includes(r))return;const i=e[r];n.push(...i.accounts)}),n}function Eo(e,t){return e.includes(":")?[e]:t.chains||[]}var ko=Object.defineProperty,So=Object.defineProperties,Io=Object.getOwnPropertyDescriptors,To=Object.getOwnPropertySymbols,Co=Object.prototype.hasOwnProperty,Po=Object.prototype.propertyIsEnumerable,Oo=(e,t,n)=>t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,No=(e,t)=>{for(var n in t||(t={}))Co.call(t,n)&&Oo(e,n,t[n]);if(To)for(var n of To(t))Po.call(t,n)&&Oo(e,n,t[n]);return e},Ro=(e,t,n)=>Oo(e,"symbol"!=typeof t?t+"":t,n);const Mo="react-native",Uo="node",Lo="browser",Bo="unknown",Do="js";function jo(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}
2function Fo(){return!(0,xi.getDocument)()&&!!(0,xi.getNavigator)()&&"ReactNative"===navigator.product}function zo(){return!jo()&&!!(0,xi.getNavigator)()&&!!(0,xi.getDocument)()}function Wo(){return Fo()?Mo:jo()?Uo:zo()?Lo:Bo}function qo(){var e;try{return Fo()&&typeof n.g<"u"&&typeof(null==n.g?void 0:n.g.Application)<"u"?null==(e=n.g.Application)?void 0:e.applicationId:void 0}catch(t){return}}function Ho(e){var t,n;const r=Vo();try{return null!=e&&e.url&&r.url&&new URL(e.url).host!==new URL(r.url).host&&(console.warn("The configured WalletConnect 'metadata.url':".concat(e.url," differs from the actual page url:").concat(r.url,". This is probably unintended and can lead to issues.")),e.url=r.url),null!=(t=null===e||void 0===e?void 0:e.icons)&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>""!==e)),((e,t)=>So(e,Io(t)))(No(No({},r),e),{url:(null===e||void 0===e?void 0:e.url)||r.url,name:(null===e||void 0===e?void 0:e.name)||r.name,description:(null===e||void 0===e?void 0:e.description)||r.description,icons:null!=(n=null===e||void 0===e?void 0:e.icons)&&n.length&&e.icons.length>0?e.icons:r.icons})}catch(i){return console.warn("Error populating app metadata",i),e||r}}function Vo(){return(0,Ei.g)()||{name:"",description:"",url:"",icons:[""]}}function Go(e,t,r){const i=function(){if(Wo()===Mo&&typeof n.g<"u"&&typeof(null==n.g?void 0:n.g.Platform)<"u"){const{OS:e,Version:t}=n.g.Platform;return[e,t].join("-")}const e=(0,Ai.o0)();if(null===e)return"unknown";const t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),s=function(){var e;const t=Wo();return t===Lo?[t,(null==(e=(0,xi.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[Do,r].join("-"),i,s].join("/")}function Ko(e){let{protocol:t,version:n,relayUrl:r,sdkVersion:i,auth:s,projectId:o,useOnCloseEvent:a,bundleId:c,packageName:l}=e;const u=r.split("?"),d={auth:s,ua:Go(t,n,i),projectId:o,useOnCloseEvent:a||void 0,packageName:l||void 0,bundleId:c||void 0},h=function(e,t){const n=new URLSearchParams(e);return Object.entries(t).sort((e,t)=>{let[n]=e,[r]=t;return n.localeCompare(r)}).forEach(e=>{let[t,r]=e;null!=r&&n.set(t,String(r))}),n.toString()}(u[1]||"",d);return u[0]+"?"+h}function Jo(e,t){return e.filter(e=>t.includes(e)).length===e.length}function Zo(e){return Object.fromEntries(e.entries())}function Qo(e){return new Map(Object.entries(e))}function Yo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_i.FIVE_MINUTES,t=arguments.length>1?arguments[1]:void 0;const n=(0,_i.toMiliseconds)(e||_i.FIVE_MINUTES);let r,i,s,o;return{resolve:e=>{s&&r&&(clearTimeout(s),r(e),o=Promise.resolve(e))},reject:e=>{s&&i&&(clearTimeout(s),i(e))},done:()=>new Promise((e,a)=>{if(o)return e(o);s=setTimeout(()=>{const e=new Error(t);o=Promise.reject(e),a(e)},n),r=e,i=a})}}function Xo(e,t,n){return new Promise(async(r,i)=>{const s=setTimeout(()=>i(new Error(n)),t);try{r(await e)}catch(o){i(o)}clearTimeout(s)})}function $o(e,t){if("string"==typeof t&&t.startsWith("".concat(e,":")))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return"topic:".concat(t)}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return"id:".concat(t)}throw new Error("Unknown expirer target type: ".concat(e))}function ea(e){const[t,n]=e.split(":"),r={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof n)r.topic=n;else{if("id"!==t||!Number.isInteger(Number(n)))throw new Error("Invalid target, expected id:number or topic:string, got ".concat(t,":").concat(n));r.id=Number(n)}return r}function ta(e,t){return(0,_i.fromMiliseconds)((t||Date.now())+(0,_i.toMiliseconds)(e))}function na(e){return Date.now()>=(0,_i.toMiliseconds)(e)}function ra(e,t){return"".concat(e).concat(t?":".concat(t):"")}function ia(){return[...new Set([...arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]])]}async function sa(e){let{id:t,topic:r,wcDeepLink:i}=e;var s;try{if(!i)return;const e="string"==typeof i?JSON.parse(i):i,o=null===e||void 0===e?void 0:e.href;if("string"!=typeof o)return;const a=function(e,t,n){const r="requestId=".concat(t,"&sessionTopic=").concat(n);e.endsWith("/")&&(e=e.slice(0,-1));let i="".concat(e);
2if(e.startsWith("https://t.me")){const t=e.includes("?")?"&startapp=":"?startapp=";i="".concat(i).concat(t).concat(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Buffer.from(e).toString("base64");return t?n.replace(/[=]/g,""):n}(r,!0))}else i="".concat(i,"/wc?").concat(r);return i}(o,t,r),c=Wo();if(c===Lo){if(null==(s=(0,xi.getDocument)())||!s.hasFocus())return void console.warn("Document does not have focus, skipping deeplink.");!function(e){let t="_self";!function(){try{return window.self!==window.top}catch(e){return!1}}()?(typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"):t="_top",window.open(e,t,"noreferrer noopener")}(a)}else c===Mo&&typeof(null==n.g?void 0:n.g.Linking)<"u"&&await n.g.Linking.openURL(a)}catch(o){console.error(o)}}function oa(e,t){if(!e.includes(t))return null;const n=e.split(/([&,?,=])/),r=n.indexOf(t);return n[r+2]}function aa(){return typeof crypto<"u"&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function ca(){return typeof process<"u"&&"true"==={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.IS_VITEST}function la(e){return Buffer.from(e,"base64").toString("utf-8")}class ua{constructor(e){let{limit:t}=e;Ro(this,"limit"),Ro(this,"set"),this.limit=t,this.set=new Set}
2add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}}const da=BigInt(2**32-1),ha=BigInt(32);function pa(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(e&da),l:Number(e>>ha&da)}:{h:0|Number(e>>ha&da),l:0|Number(e&da)}}function fa(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let s=0;s<n;s++){const{h:n,l:o}=pa(e[s],t);[r[s],i[s]]=[n,o]}return[r,i]}const ga=(e,t,n)=>e>>>n,ma=(e,t,n)=>e<<32-n|t>>>n,ya=(e,t,n)=>e>>>n|t<<32-n,va=(e,t,n)=>e<<32-n|t>>>n,wa=(e,t,n)=>e<<64-n|t>>>n-32,ba=(e,t,n)=>e>>>n-32|t<<64-n,Aa=(e,t)=>t,_a=(e,t)=>e;function xa(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}}const Ea=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),ka=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Sa=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Ia=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,Ta=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Ca=(e,t,n,r,i,s)=>t+n+r+i+s+(e/2**32|0)|0,Pa="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function Oa(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Na(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ra(e){if(!Oa(e))throw new Error("Uint8Array expected");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function Ma(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");Na(e.outputLen),Na(e.blockLen)}function Ua(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function La(e,t){Ra(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Ba(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Da(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(let r=0;r<t.length;r++)t[r].fill(0)}function ja(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Fa(e,t){return e<<32-t|e>>>t}const za=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Wa(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const qa=za?e=>e:e=>Wa(e);const Ha=za?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Wa(e[t]);return e},Va="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,Ga=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ka(e){if(Ra(e),Va)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Ga[e[n]];return t}const Ja=48,Za=57,Qa=65,Ya=70,Xa=97,$a=102;function ec(e){return e>=Ja&&e<=Za?e-Ja:e>=Qa&&e<=Ya?e-(Qa-10):e>=Xa&&e<=$a?e-(Xa-10):void 0}function tc(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(Va)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const t=ec(e.charCodeAt(s)),n=ec(e.charCodeAt(s+1));if(void 0===t||void 0===n){const t=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+s)}r[i]=16*t+n}return r}function nc(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function rc(e){return"string"==typeof e&&(e=nc(e)),Ra(e),e}function ic(){let e=0;for(let n=0;n<arguments.length;n++){const t=n<0||arguments.length<=n?void 0:arguments[n];Ra(t),e+=t.length}const t=new Uint8Array(e);for(let n=0,r=0;n<arguments.length;n++){const e=n<0||arguments.length<=n?void 0:arguments[n];t.set(e,r),r+=e.length}return t}class sc{}function oc(e){const t=t=>e().update(rc(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ac(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(Pa&&"function"==typeof Pa.getRandomValues)return Pa.getRandomValues(new Uint8Array(e));if(Pa&&"function"==typeof Pa.randomBytes)return Uint8Array.from(Pa.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const cc=BigInt(0),lc=BigInt(1),uc=BigInt(2),dc=BigInt(7),hc=BigInt(256),pc=BigInt(113),fc=[],gc=[],mc=[];for(let jk=0,Fk=lc,zk=1,Wk=0;jk<24;jk++){[zk,Wk]=[Wk,(2*zk+3*Wk)%5],fc.push(2*(5*Wk+zk)),gc.push((jk+1)*(jk+2)/2%64);let e=cc;for(let t=0;t<7;t++)Fk=(Fk<<lc^(Fk>>dc)*pc)%hc,Fk&uc&&(e^=lc<<(lc<<BigInt(t))-lc);mc.push(e)}const yc=fa(mc,!0),vc=yc[0],wc=yc[1],bc=(e,t,n)=>n>
vendor: 5,617 bytes, line 2
232?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),Ac=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class _c extends sc{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,Na(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Ba(this.state)}clone(){return this._cloneInto()}keccak(){Ha(this.state32),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const t=(r+8)%10,i=(r+2)%10,s=n[i],o=n[i+1],a=bc(s,o,1)^n[t],c=Ac(s,o,1)^n[t+1];for(let n=0;n<50;n+=10)e[r+n]^=a,e[r+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=gc[n],s=bc(t,i,r),o=Ac(t,i,r),a=fc[n];t=e[a],i=e[a+1],e[a]=s,e[a+1]=o}for(let r=0;r<50;r+=10){for(let t=0;t<10;t++)n[t]=e[r+t];for(let t=0;t<10;t++)e[r+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=vc[r],e[1]^=wc[r]}Da(n)}(this.state32,this.rounds),Ha(this.state32),this.posOut=0,this.pos=0}update(e){Ua(this),Ra(e=rc(e));const{blockLen:t,state:n}=this,r=e.length;for(let i=0;i<r;){const s=Math.min(t-this.pos,r-i);for(let t=0;t<s;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,0!==(128&t)&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Ua(this,!1),Ra(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Na(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(La(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Da(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:s}=this;return e||(e=new _c(t,n,r,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=s,e.destroyed=this.destroyed,e}}const xc=((e,t,n)=>oc(()=>new _c(t,e,n)))(1,136,32);function Ec(e,t,n){return e&t^~e&n}function kc(e,t,n){return e&t^e&n^t&n}class Sc extends sc{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=ja(this.buffer)}update(e){Ua(this),Ra(e=rc(e));const{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);if(o===r){const t=ja(e);for(;r<=i-s;s+=r)this.process(t,s);continue}n.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ua(this),La(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:i}=this;let{pos:s}=this;t[s++]=128,Da(this.buffer.subarray(s)),this.padOffset>r-s&&(this.process(n,0),s=0);for(let u=s;u<r;u++)t[u]=0;(function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,a,r)})(n,r-8,BigInt(8*this.length),i),this.process(n,0);const o=ja(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<c;u++)o.setUint32(4*u,l[u],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:i,destroyed:s,pos:o}=this;return e.destroyed=s,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const Ic=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Tc=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Cc=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Pc=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 2,059 bytes, line 2
2734187,3204031479,3329325298]),Oc=new Uint32Array(64);class Nc extends Sc{constructor(){super(64,arguments.length>0&&void 0!==arguments[0]?arguments[0]:32,8,!1),this.A=0|Ic[0],this.B=0|Ic[1],this.C=0|Ic[2],this.D=0|Ic[3],this.E=0|Ic[4],this.F=0|Ic[5],this.G=0|Ic[6],this.H=0|Ic[7]}get(){const{A:e,B:t,C:n,D:r,E:i,F:s,G:o,H:a}=this;return[e,t,n,r,i,s,o,a]}set(e,t,n,r,i,s,o,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let u=0;u<16;u++,t+=4)Oc[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const e=Oc[u-15],t=Oc[u-2],n=Fa(e,7)^Fa(e,18)^e>>>3,r=Fa(t,17)^Fa(t,19)^t>>>10;Oc[u]=r+Oc[u-7]+n+Oc[u-16]|0}let{A:n,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;for(let u=0;u<64;u++){const e=l+(Fa(o,6)^Fa(o,11)^Fa(o,25))+Ec(o,a,c)+Pc[u]+Oc[u]|0,t=(Fa(n,2)^Fa(n,13)^Fa(n,22))+kc(n,r,i)|0;l=c,c=a,a=o,o=s+e|0,s=i,i=r,r=n,n=e+t|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,s,o,a,c,l)}roundClean(){Da(Oc)}destroy(){this.set(0,0,0,0,0,0,0,0),Da(this.buffer)}}const Rc=fa(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
25771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Mc=Rc[0],Uc=Rc[1],Lc=new Uint32Array(80),Bc=new Uint32Array(80);class Dc extends Sc{constructor(){super(128,arguments.length>0&&void 0!==arguments[0]?arguments[0]:64,16,!1),this.Ah=0|Cc[0],this.Al=0|Cc[1],this.Bh=0|Cc[2],this.Bl=0|Cc[3],this.Ch=0|Cc[4],this.Cl=0|Cc[5],this.Dh=0|Cc[6],this.Dl=0|Cc[7],this.Eh=0|Cc[8],this.El=0|Cc[9],this.Fh=0|Cc[10],this.Fl=0|Cc[11],this.Gh=0|Cc[12],this.Gl=0|Cc[13],this.Hh=0|Cc[14],this.Hl=0|Cc[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:s,Dh:o,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g]}set(e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|s,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let v=0;v<16;v++,t+=4)Lc[v]=e.getUint32(t),Bc[v]=e.getUint32(t+=4);for(let v=16;v<80;v++){const e=0|Lc[v-15],t=0|Bc[v-15],n=ya(e,t,1)^ya(e,t,8)^ga(e,0,7),r=va(e,t,1)^va(e,t,8)^ma(e,t,7),i=0|Lc[v-2],s=0|Bc[v-2],o=ya(i,s,19)^wa(i,s,61)^ga(i,0,6),a=va(i,s,19)^ba(i,s,61)^ma(i,s,6),c=Sa(r,a,Bc[v-7],Bc[v-16]),l=Ia(c,n,o,Lc[v-7],Lc[v-16]);Lc[v]=0|l,Bc[v]=0|c}let{Ah:n,Al:r,Bh:i,Bl:s,Ch:o,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:p,Gh:f,Gl:g,Hh:m,Hl:y}=this;for(let v=0;v<80;v++){const e=ya(u,d,14)^ya(u,d,18)^wa(u,d,41),t=va(u,d,14)^va(u,d,18)^ba(u,d,41),w=u&h^~u&f,b=Ta(y,t,d&p^~d&g,Uc[v],Bc[v]),A=Ca(b,m,e,w,Mc[v],Lc[v]),_=0|b,x=ya(n,r,28)^wa(n,r,34)^wa(n,r,39),E=va(n,r,28)^ba(n,r,34)^ba(n,r,39),k=n&i^n&o^i&o,S=r&s^r&a^s&a;m=0|f,y=0|g,f=0|h,g=0|p,h=0|u,p=0|d,({h:u,l:d}=xa(0|c,0|l,0|A,0|_)),c=0|o,l=0|a,o=0|i,a=0|s,i=0|n,s=0|r;const I=Ea(_,E,S);n=ka(I,A,x,k),r=0|I}({h:n,l:r}=xa(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:s}=xa(0|this.Bh,0|this.Bl,0|i,0|s)),({h:o,l:a}=xa(0|this.Ch,0|this.Cl,0|o,0|a)),({h:c,l:l}=xa(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=xa(0|this.Eh,0|this.El,0|u,0|d)),({h:h,l:p}=xa(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:g}=xa(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:y}=xa(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(n,r,i,s,o,a,c,l,u,d,h,p,f,g,m,y)}roundClean(){Da(Lc,Bc)}destroy(){Da(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class jc extends Dc{constructor(){super(48),this.Ah=0|Tc[0],this.Al=0|Tc[1],this.Bh=0|Tc[2],this.Bl=0|Tc[3],this.Ch=0|Tc[4],this.Cl=0|Tc[5],this.Dh=0|Tc[6],this.Dl=0|Tc[7],this.Eh=0|Tc[8],this.El=0|Tc[9],this.Fh=0|Tc[10],this.Fl=0|Tc[11],this.Gh=0|Tc[12],this.Gl=0|Tc[13],this.Hh=0|Tc[14],this.Hl=0|Tc[15]}}const Fc=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class zc extends Dc{constructor(){super(32),this.Ah=0|Fc[0],this.Al=0|Fc[1],this.Bh=0|Fc[2],this.Bl=0|Fc[3],this.Ch=0|Fc[4],this.Cl=0|Fc[5],this.Dh=0|Fc[6],this.Dl=0|Fc[7],this.Eh=0|Fc[8],this.El=0|Fc[9],this.Fh=0|Fc[10],this.Fl=0|Fc[11],this.Gh=0|Fc[12],this.Gl=0|Fc[13],this.Hh=0|Fc[14],this.Hl=0|Fc[15]}}const Wc=oc(()=>new Nc),qc=oc(()=>new Dc),Hc=oc(()=>new jc),Vc=oc(()=>new zc),Gc=Uint8Array.from([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]),Kc=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Jc=new Uint32Array(32);function Zc(e,t,n,r,i,s){const o=i[s],a=i[s+1];let c=Jc[2*e],l=Jc[2*e+1],u=Jc[2*t],d=Jc[2*t+1],h=Jc[2*n],p=Jc[2*n+1],f=Jc[2*r],g=Jc[2*r+1],m=Ea(c,u,o);l=ka(m,l,d,a),c=0|m,({Dh:g,Dl:f}={Dh:g^l,Dl:f^c}),({Dh:g,Dl:f}={Dh:Aa(0,f),Dl:_a(g)}),({h:p,l:h}=xa(p,h,g,f)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^h}),({Bh:d,Bl:u}={Bh:ya(d,u,24),Bl:va(d,u,24)}),Jc[2*e]=c,Jc[2*e+1]=l,Jc[2*t]=u,Jc[2*t+1]=d,Jc[2*n]=h,Jc[2*n+1]=p,Jc[2*r]=f,Jc[2*r+1]=g}function Qc(e,t,n,r,i,s){const o=i[s],a=i[s+1];let c=Jc[2*e],l=Jc[2*e+1],u=Jc[2*t],d=Jc[2*t+1],h=Jc[2*n],p=Jc[2*n+1],f=Jc[2*r],g=Jc[2*r+1],m=Ea(c,u,o);l=ka(m,l,d,a),c=0|m,({Dh:g,Dl:f}={Dh:g^l,Dl:f^c}),({Dh:g,Dl:f}={Dh:ya(g,f,16),Dl:va(g,f,16)}),({h:p,l:h}=xa(p,h,g,f)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^h}),({Bh:d,Bl:u}={Bh:wa(d,u,63),Bl:ba(d,u,63)}),Jc[2*e]=c,Jc[2*e+1]=l,Jc[2*t]=u,Jc[2*t+1]=d,Jc[2*n]=h,Jc[2*n+1]=p,Jc[2*r]=f,Jc[2*r+1]=g}class Yc extends sc{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,Na(e),Na(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=Ba(this.buffer)}update(e){Ua(this),Ra(e=rc(e));const{blockLen:t,buffer:n,buffer32:r}=this,i=e.length,s=e.byteOffset,o=e.buffer;for(let a=0;a<i;){this.pos===t&&(Ha(r),this.compress(r,0,!1),Ha(r),this.pos=0);const c=Math.min(t-this.pos,i-a),l=s+a;if(c===t&&!(l%4)&&a+c<i){const e=new Uint32Array(o,l,Math.floor((i-a)/4));Ha(e);for(let n=0;a+t<i;n+=r.length,a+=t)this.length+=t,this.compress(e,n,!1);Ha(e);continue}n.set(e.subarray(a,a+c),this.pos),this.pos+=c,this.length+=c,a+=c}return this}digestInto(e){Ua(this),La(e,this);const{pos:t,buffer32:n}=this;this.finished=!0,Da(this.buffer.subarray(t)),Ha(n),this.compress(n,0,!0),Ha(n);const r=Ba(e);
2this.get().forEach((e,t)=>r[t]=qa(e))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){const{buffer:t,length:n,finished:r,destroyed:i,outputLen:s,pos:o}=this;return e||(e=new this.constructor({dkLen:s})),e.set(...this.get()),e.buffer.set(t),e.destroyed=i,e.finished=r,e.length=n,e.pos=o,e.outputLen=s,e}clone(){return this._cloneInto()}}class Xc extends Yc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|Kc[0],this.v0h=0|Kc[1],this.v1l=0|Kc[2],this.v1h=0|Kc[3],this.v2l=0|Kc[4],this.v2h=0|Kc[5],this.v3l=0|Kc[6],this.v3h=0|Kc[7],this.v4l=0|Kc[8],this.v4h=0|Kc[9],this.v5l=0|Kc[10],this.v5h=0|Kc[11],this.v6l=0|Kc[12],this.v6h=0|Kc[13],this.v7l=0|Kc[14],this.v7h=0|Kc[15],function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(Na(n),e<0||e>n)throw new Error("outputLen bigger than keyLen");const{key:s,salt:o,personalization:a}=t;if(void 0!==s&&(s.length<1||s.length>n))throw new Error("key length must be undefined or 1.."+n);if(void 0!==o&&o.length!==r)throw new Error("salt must be undefined or "+r);if(void 0!==a&&a.length!==i)throw new Error("personalization must be undefined or "+i)}(t,e,64,16,16);let{key:n,personalization:r,salt:i}=e,s=0;if(void 0!==n&&(n=rc(n),s=n.length),this.v0l^=this.outputLen|s<<8|65536|1<<24,void 0!==i){i=rc(i);const e=Ba(i);this.v4l^=qa(e[0]),this.v4h^=qa(e[1]),this.v5l^=qa(e[2]),this.v5h^=qa(e[3])}if(void 0!==r){r=rc(r);const e=Ba(r);this.v6l^=qa(e[0]),this.v6h^=qa(e[1]),this.v7l^=qa(e[2]),this.v7h^=qa(e[3])}if(void 0!==n){const e=new Uint8Array(this.blockLen);e.set(n),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:i,v2h:s,v3l:o,v3h:a,v4l:c,v4h:l,v5l:u,v5h:d,v6l:h,v6h:p,v7l:f,v7h:g}=this;return[e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g]}set(e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g){this.v0l=0|e,this.v0h=0|t,this.v1l=0|n,this.v1h=0|r,this.v2l=0|i,this.v2h=0|s,this.v3l=0|o,this.v3h=0|a,this.v4l=0|c,this.v4h=0|l,this.v5l=0|u,this.v5h=0|d,this.v6l=0|h,this.v6h=0|p,this.v7l=0|f,this.v7h=0|g}compress(e,t,n){this.get().forEach((e,t)=>Jc[t]=e),Jc.set(Kc,16);let{h:r,l:i}=pa(BigInt(this.length));Jc[24]=Kc[8]^i,Jc[25]=Kc[9]^r,n&&(Jc[28]=~Jc[28],Jc[29]=~Jc[29]);let s=0;const o=Gc;for(let a=0;a<12;a++)Zc(0,4,8,12,e,t+2*o[s++]),Qc(0,4,8,12,e,t+2*o[s++]),Zc(1,5,9,13,e,t+2*o[s++]),Qc(1,5,9,13,e,t+2*o[s++]),Zc(2,6,10,14,e,t+2*o[s++]),Qc(2,6,10,14,e,t+2*o[s++]),Zc(3,7,11,15,e,t+2*o[s++]),Qc(3,7,11,15,e,t+2*o[s++]),Zc(0,5,10,15,e,t+2*o[s++]),Qc(0,5,10,15,e,t+2*o[s++]),Zc(1,6,11,12,e,t+2*o[s++]),Qc(1,6,11,12,e,t+2*o[s++]),Zc(2,7,8,13,e,t+2*o[s++]),Qc(2,7,8,13,e,t+2*o[s++]),Zc(3,4,9,14,e,t+2*o[s++]),Qc(3,4,9,14,e,t+2*o[s++]);this.v0l^=Jc[0]^Jc[16],this.v0h^=Jc[1]^Jc[17],this.v1l^=Jc[2]^Jc[18],this.v1h^=Jc[3]^Jc[19],this.v2l^=Jc[4]^Jc[20],this.v2h^=Jc[5]^Jc[21],this.v3l^=Jc[6]^Jc[22],this.v3h^=Jc[7]^Jc[23],this.v4l^=Jc[8]^Jc[24],this.v4h^=Jc[9]^Jc[25],this.v5l^=Jc[10]^Jc[26],this.v5h^=Jc[11]^Jc[27],this.v6l^=Jc[12]^Jc[28],this.v6h^=Jc[13]^Jc[29],this.v7l^=Jc[14]^Jc[30],this.v7h^=Jc[15]^Jc[31],Da(Jc)}destroy(){this.destroyed=!0,Da(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const $c=function(e){const t=(t,n)=>e(n).update(rc(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}(e=>new Xc(e)),el="https://rpc.walletconnect.org/v1";function tl(e){const t="\x19Ethereum Signed Message:\n".concat(e.length),n=(new TextEncoder).encode(t+e);return"0x"+Buffer.from(xc(n)).toString("hex")}async function nl(e,t,n,r,i,s){switch(n.t){case"eip191":return await function(e,t,n){const r=Gi(n);return Us({payload:tl(t),signature:r}).toLowerCase()===e.toLowerCase()}(e,t,n.s);case"eip1271":return await async function(e,t,n,r,i,s){const o=_o(r);if(!o.namespace||!o.reference)throw new Error("isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ".concat(r));try{const o="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",c=n.substring(2),l=(c.length/2).toString(16).padStart(64,"0"),u=o+(t.startsWith("0x")?t:tl(t)).substring(2)+a+l+c,d=await fetch("".concat(s||el,"/?chainId=").concat(r,"&projectId=").concat(i),{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:rl(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:u},"latest"]})}),{result:h}=await d.json();return!!h&&h.slice(0,o.length).toLowerCase()===o.toLowerCase()}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}(e,t,n.s,r,i,s);default:throw new Error("verifySignature failed: Attempted to verify CacaoSignature with unknown type: ".concat(n.t))}}function rl(){return Date.now()+Math.floor(1e3*Math.random())}function il(e){const t=new Uint8Array(Buffer.from(e,"base64")),n=Array.from("TransactionData::").map(e=>
2e.charCodeAt(0)),r=new Uint8Array(n.length+t.length);r.set(n),r.set(t,n.length);const i=$c(r,{dkLen:32});return Ls.A.encode(i)}function sl(e){const t=new Uint8Array(Wc(function(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if("object"==typeof e&&null!=e&&e.data)return new Uint8Array(Object.values(e.data));if("object"==typeof e&&e)return new Uint8Array(Object.values(e));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}(e)));return Ls.A.encode(t)}function ol(e){const t=Buffer.from(e,"base64"),n=(0,Bs.D)(t).txn;if(!n)throw new Error("Invalid signed transaction: missing 'txn' field");const r=(0,Ds.l)(n),i=Buffer.from("TX"),s=Buffer.concat([i,Buffer.from(r)]),o=Vc(s);return Fn.RG.encode(o).replace(/=+$/,"")}function al(e){const t=[];let n=BigInt(e);for(;n>=BigInt(128);)t.push(Number(n&BigInt(127)|BigInt(128))),n>>=BigInt(7);return t.push(Number(n)),Buffer.from(t)}function cl(e){const t=Buffer.from(e.signed.bodyBytes,"base64"),n=Buffer.from(e.signed.authInfoBytes,"base64"),r=Buffer.from(e.signature.signature,"base64"),i=[];i.push(Buffer.from([10])),i.push(al(t.length)),i.push(t),i.push(Buffer.from([18])),i.push(al(n.length)),i.push(n),i.push(Buffer.from([26])),i.push(al(r.length)),i.push(r);const s=Buffer.concat(i),o=Wc(s);return Buffer.from(o).toString("hex").toUpperCase()}var ll=Object.defineProperty,ul=Object.defineProperties,dl=Object.getOwnPropertyDescriptors,hl=Object.getOwnPropertySymbols,pl=Object.prototype.hasOwnProperty,fl=Object.prototype.propertyIsEnumerable,gl=(e,t,n)=>t in e?ll(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ml=(e,t)=>{for(var n in t||(t={}))pl.call(t,n)&&gl(e,n,t[n]);if(hl)for(var n of hl(t))fl.call(t,n)&&gl(e,n,t[n]);return e},yl=(e,t)=>ul(e,dl(t));const vl=e=>null===e||void 0===e?void 0:e.split(":"),wl=e=>{const t=e&&vl(e);if(t)return t[2]+":"+t[3]},bl=e=>{const t=e&&vl(e);if(t)return t.pop()};async function Al(e){const{cacao:t,projectId:n}=e,{s:r,p:i}=t,s=_l(i,i.iss),o=bl(i.iss);return await nl(o,s,r,wl(i.iss),n)}const _l=(e,t)=>{const n="".concat(e.domain," wants you to sign in with your Ethereum account:"),r=bl(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=e.statement||void 0;const s="URI: ".concat(e.aud||e.uri),o="Version: ".concat(e.version),a="Chain ID: ".concat((e=>{const t=e&&vl(e);if(t)return e.includes("did:pkh:")?t[3]:t[1]})(t)),c="Nonce: ".concat(e.nonce),l="Issued At: ".concat(e.iat),u=e.exp?"Expiration Time: ".concat(e.exp):void 0,d=e.nbf?"Not Before: ".concat(e.nbf):void 0,h=e.requestId?"Request ID: ".concat(e.requestId):void 0,p=e.resources?"Resources:".concat(e.resources.map(e=>"\n- ".concat(e)).join("")):void 0,f=Rl(e.resources);if(f){i=Pl(i,Sl(f))}return[n,r,"",i,"",s,o,a,c,l,u,d,h,p].filter(e=>null!=e).join("\n")};function xl(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");const t=Object.keys(e.att);if(null==t||!t.length)throw new Error("No resources found in `att` property");t.forEach(t=>{const n=e.att[t];if(Array.isArray(n))throw new Error("Resource must be an object: ".concat(t));if("object"!=typeof n)throw new Error("Resource must be an object: ".concat(t));if(!Object.keys(n).length)throw new Error("Resource object is empty: ".concat(t));Object.keys(n).forEach(e=>{const t=n[e];if(!Array.isArray(t))throw new Error("Ability limits ".concat(e," must be an array of objects, found: ").concat(t));if(!t.length)throw new Error("Value of ".concat(e," is empty array, must be an array with objects"));t.forEach(t=>{if("object"!=typeof t)throw new Error("Ability limits (".concat(e,") must be an array of objects, found: ").concat(t))})})})}function El(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(t=null===(n=t)||void 0===n?void 0:n.sort((e,t)=>e.localeCompare(t))).map(t=>({["".concat(e,"/").concat(t)]:[r]}));return Object.assign({},...i)}function kl(e){return xl(e),"urn:recap:".concat(function(e){return Buffer.from(JSON.stringify(e)).toString("base64")}(e).replace(/=/g,""))}function Sl(e){const t=function(e){return JSON.parse(Buffer.from(e,"base64").toString("utf-8"))}(e.replace("urn:recap:",""));return xl(t),t}function Il(e,t,n){const r=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return null!==n&&void 0!==n&&n.sort((e,t)=>
2e.localeCompare(t)),{att:{[e]:El(t,n,r)}}}(e,t,n);return kl(r)}function Tl(e){return e&&e.includes("urn:recap:")}function Cl(e,t){const n=function(e,t){xl(e),xl(t);const n=Object.keys(e.att).concat(Object.keys(t.att)).sort((e,t)=>e.localeCompare(t)),r={att:{}};return n.forEach(n=>{var i,s;Object.keys((null==(i=e.att)?void 0:i[n])||{}).concat(Object.keys((null==(s=t.att)?void 0:s[n])||{})).sort((e,t)=>e.localeCompare(t)).forEach(i=>{var s,o;r.att[n]=yl(ml({},r.att[n]),{[i]:(null==(s=e.att[n])?void 0:s[i])||(null==(o=t.att[n])?void 0:o[i])})})}),r}(Sl(e),Sl(t));return kl(n)}function Pl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;xl(t);const n="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(n))return e;const r=[];let i=0;Object.keys(t.att).forEach(e=>{const n=Object.keys(t.att[e]).map(e=>({ability:e.split("/")[0],action:e.split("/")[1]}));n.sort((e,t)=>e.action.localeCompare(t.action));const s={};n.forEach(e=>{s[e.ability]||(s[e.ability]=[]),s[e.ability].push(e.action)});const o=Object.keys(s).map(t=>(i++,"(".concat(i,") '").concat(t,"': '").concat(s[t].join("', '"),"' for '").concat(e,"'.")));r.push(o.join(", ").replace(".,","."))});const s=r.join(" "),o="".concat(n).concat(s);return"".concat(e?e+" ":"").concat(o)}function Ol(e){var t;const n=Sl(e);xl(n);const r=null==(t=n.att)?void 0:t.eip155;return r?Object.keys(r).map(e=>e.split("/")[1]):[]}function Nl(e){const t=Sl(e);xl(t);const n=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;null!=(t=null===e||void 0===e?void 0:e[0])&&t.chains&&n.push(e[0].chains)})}),[...new Set(n.flat())]}function Rl(e){if(!e)return;const t=null===e||void 0===e?void 0:e[e.length-1];return Tl(t)?t:void 0}function Ml(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Ul(e){if("boolean"!=typeof e)throw new Error("boolean expected, not ".concat(e))}function Ll(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Bl(e){if(!Ml(e))throw new Error("Uint8Array expected");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(n.length>0&&!n.includes(e.length))throw new Error("Uint8Array expected of length "+n+", got length="+e.length)}function Dl(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function jl(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Fl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(let r=0;r<t.length;r++)t[r].fill(0)}const zl=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Wl(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!Ml(e))throw new Error("Uint8Array expected, got "+typeof e);e=Gl(e)}return e}function ql(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(n&&!function(e){return e.byteOffset%4===0}(t))throw new Error("invalid output, must be aligned");return t}function Hl(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,a,r)}function Vl(e,t,n){Ul(n);const r=new Uint8Array(16),i=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}(r);return Hl(i,0,BigInt(t),n),Hl(i,8,BigInt(e),n),r}function Gl(e){return Uint8Array.from(e)}const Kl=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),Jl=Kl("expand 16-byte k"),Zl=Kl("expand 32-byte k"),Ql=jl(Jl),Yl=jl(Zl);function Xl(e,t){return e<<t|e>>>32-t}function $l(e){return e.byteOffset%4===0}const eu=2**32-1,tu=new Uint32Array;const nu=(e,t)=>255&e[t++]|(255&e[t++])<<8;class ru{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,Bl(e=Wl(e),32);const t=nu(e,0),n=nu(e,2),r=nu(e,4),i=nu(e,6),s=nu(e,8),o=nu(e,10),a=nu(e,12),c=nu(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|n<<3),this.r[2]=7939&(n>>>10|r<<6),this.r[3]=8191&(r>>>7|i<<9),this.r[4]=255&(i>>>4|s<<12),this.r[5]=s>>>1&8190,this.r[6]=8191&(s>>>14|o<<2),this.r[7]=8065&(o>>>11|a<<5),this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127;for(let l=0;l<8;l++)this.pad[l]=nu(e,16+2*l)}process(e,t){const n=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?0:2048,{h:r,r:i}=this,s=i[0],o=i[1],a=i[2],c=i[3],l=i[4],u=i[5],d=i[6],h=i[7],p=i[8],f=i[9],g=nu(e,t+0),m=nu(e,t+2),y=nu(e,t+4),v=nu(e,t+6),w=nu(e,t+8),b=nu(e,t+10),A=nu(e,t+12),_=nu(e,t+14);let x=r[0]+(8191&g),E=r[1]+(8191&(g>>>13|m<<3)),k=r[2]+(8191&(m>>>10|y<<6)),S=r[3]+(8191&(y>>>7|v<<9)),I=r[4]+(8191&(v>>>4|w<<12)),T=r[5]+(w>>>1&8191),C=r[6]+(8191&(w>>>14|b<<2)),P=r[7]+(8191&(b>>>11|A<<5)),O=r[8]+(8191&(A>>>8|_<<8)),N=r[9]+(_>>>5|n),R=0,M=R+x*s+E*(5*f)+k*(5*p)+S*(5*h)+I*(5*d);R=M>>>13,M&=8191,M+=T*(5*u)+C*(5*l)+P*(5*c)+O*(5*a)+N*(5*o),R+=M>>>13,M&=8191;let U=R+x*o+E*s+k*(5*f)+S*(5*p)+I*(5*h);R=U>>>13,U&=8191,U+=T*(5*d)+C*(5*u)+P*(5*l)+O*(5*c)+N*(5*a),R+=U>>>13,U&=8191;let L=R+x*a+E*o+k*s+S*(5*f)+I*(5*p);R=L>
2>>13,L&=8191,L+=T*(5*h)+C*(5*d)+P*(5*u)+O*(5*l)+N*(5*c),R+=L>>>13,L&=8191;let B=R+x*c+E*a+k*o+S*s+I*(5*f);R=B>>>13,B&=8191,B+=T*(5*p)+C*(5*h)+P*(5*d)+O*(5*u)+N*(5*l),R+=B>>>13,B&=8191;let D=R+x*l+E*c+k*a+S*o+I*s;R=D>>>13,D&=8191,D+=T*(5*f)+C*(5*p)+P*(5*h)+O*(5*d)+N*(5*u),R+=D>>>13,D&=8191;let j=R+x*u+E*l+k*c+S*a+I*o;R=j>>>13,j&=8191,j+=T*s+C*(5*f)+P*(5*p)+O*(5*h)+N*(5*d),R+=j>>>13,j&=8191;let F=R+x*d+E*u+k*l+S*c+I*a;R=F>>>13,F&=8191,F+=T*o+C*s+P*(5*f)+O*(5*p)+N*(5*h),R+=F>>>13,F&=8191;let z=R+x*h+E*d+k*u+S*l+I*c;R=z>>>13,z&=8191,z+=T*a+C*o+P*s+O*(5*f)+N*(5*p),R+=z>>>13,z&=8191;let W=R+x*p+E*h+k*d+S*u+I*l;R=W>>>13,W&=8191,W+=T*c+C*a+P*o+O*s+N*(5*f),R+=W>>>13,W&=8191;let q=R+x*f+E*p+k*h+S*d+I*u;R=q>>>13,q&=8191,q+=T*l+C*c+P*a+O*o+N*s,R+=q>>>13,q&=8191,R=(R<<2)+R|0,R=R+M|0,M=8191&R,R>>>=13,U+=R,r[0]=M,r[1]=U,r[2]=L,r[3]=B,r[4]=D,r[5]=j,r[6]=F,r[7]=z,r[8]=W,r[9]=q}finalize(){const{h:e,pad:t}=this,n=new Uint16Array(10);let r=e[1]>>>13;e[1]&=8191;for(let o=2;o<10;o++)e[o]+=r,r=e[o]>>>13,e[o]&=8191;e[0]+=5*r,r=e[0]>>>13,e[0]&=8191,e[1]+=r,r=e[1]>>>13,e[1]&=8191,e[2]+=r,n[0]=e[0]+5,r=n[0]>>>13,n[0]&=8191;for(let o=1;o<10;o++)n[o]=e[o]+r,r=n[o]>>>13,n[o]&=8191;n[9]-=8192;let i=(1^r)-1;for(let o=0;o<10;o++)n[o]&=i;i=~i;for(let o=0;o<10;o++)e[o]=e[o]&i|n[o];e[0]=65535&(e[0]|e[1]<<13),e[1]=65535&(e[1]>>>3|e[2]<<10),e[2]=65535&(e[2]>>>6|e[3]<<7),e[3]=65535&(e[3]>>>9|e[4]<<4),e[4]=65535&(e[4]>>>12|e[5]<<1|e[6]<<14),e[5]=65535&(e[6]>>>2|e[7]<<11),e[6]=65535&(e[7]>>>5|e[8]<<8),e[7]=65535&(e[8]>>>8|e[9]<<5);let s=e[0]+t[0];e[0]=65535&s;for(let o=1;o<8;o++)s=(e[o]+t[o]|0)+(s>>>16)|0,e[o]=65535&s;Fl(n)}update(e){Dl(this),Bl(e=Wl(e));const{buffer:t,blockLen:n}=this,r=e.length;for(let i=0;i<r;){const s=Math.min(n-this.pos,r-i);if(s!==n)t.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0,!1),this.pos=0);else for(;n<=r-i;i+=n)this.process(e,i)}return this}destroy(){Fl(this.h,this.r,this.buffer,this.pad)}digestInto(e){Dl(this),function(e,t){Bl(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(e,this),this.finished=!0;const{buffer:t,h:n}=this;let{pos:r}=this;if(r){for(t[r++]=1;r<16;r++)t[r]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let s=0;s<8;s++)e[i++]=n[s]>>>0,e[i++]=n[s]>>>8;return e}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}}const iu=function(e){const t=(t,n)=>e(n).update(Wl(t)).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}(e=>new ru(e));const su=function(e,t){const{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:s,rounds:o}=function(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw new Error("core must be a function");return Ll(i),Ll(o),Ul(s),Ul(n),function(t,a,c,l){let u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;Bl(t),Bl(a),Bl(c);const d=c.length;if(void 0===l&&(l=new Uint8Array(d)),Bl(l),Ll(u),u<0||u>=eu)throw new Error("arx: counter overflow");if(l.length<d)throw new Error("arx: output (".concat(l.length,") is shorter than data (").concat(d,")"));const h=[];let p,f,g=t.length;if(32===g)h.push(p=Gl(t)),f=Yl;else{if(16!==g||!n)throw new Error("arx: invalid 32-byte key, got length=".concat(g));p=new Uint8Array(32),p.set(t),p.set(t,16),f=Ql,h.push(p)}$l(a)||h.push(a=Gl(a));const m=jl(p);if(r){if(24!==a.length)throw new Error("arx: extended nonce must be 24 bytes");r(f,m,jl(a.subarray(0,16)),m),a=a.subarray(16)}const y=16-i;if(y!==a.length)throw new Error("arx: nonce must be ".concat(y," or 16 bytes"));if(12!==y){const e=new Uint8Array(12);e.set(a,s?0:12-a.length),a=e,h.push(a)}const v=jl(a);return function(e,t,n,r,i,s,o,a){const c=i.length,l=new Uint8Array(64),u=jl(l),d=$l(i)&&$l(s),h=d?jl(i):tu,p=d?jl(s):tu;for(let f=0;f<c;o++){if(e(t,n,r,u,o,a),o>=eu)throw new Error("arx: counter overflow");const g=Math.min(64,c-f);if(d&&64===g){const e=f/4;
2if(f%4!==0)throw new Error("arx: invalid block position");for(let t,n=0;n<16;n++)t=e+n,p[t]=h[t]^u[n];f+=64;continue}for(let e,t=0;t<g;t++)e=f+t,s[e]=i[e]^l[t];f+=g}}(e,f,m,v,c,l,u,o),Fl(...h),l}}(function(e,t,n,r,i){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,o=e[0],a=e[1],c=e[2],l=e[3],u=t[0],d=t[1],h=t[2],p=t[3],f=t[4],g=t[5],m=t[6],y=t[7],v=i,w=n[0],b=n[1],A=n[2],_=o,x=a,E=c,k=l,S=u,I=d,T=h,C=p,P=f,O=g,N=m,R=y,M=v,U=w,L=b,B=A;for(let j=0;j<s;j+=2)_=_+S|0,M=Xl(M^_,16),P=P+M|0,S=Xl(S^P,12),_=_+S|0,M=Xl(M^_,8),P=P+M|0,S=Xl(S^P,7),x=x+I|0,U=Xl(U^x,16),O=O+U|0,I=Xl(I^O,12),x=x+I|0,U=Xl(U^x,8),O=O+U|0,I=Xl(I^O,7),E=E+T|0,L=Xl(L^E,16),N=N+L|0,T=Xl(T^N,12),E=E+T|0,L=Xl(L^E,8),N=N+L|0,T=Xl(T^N,7),k=k+C|0,B=Xl(B^k,16),R=R+B|0,C=Xl(C^R,12),k=k+C|0,B=Xl(B^k,8),R=R+B|0,C=Xl(C^R,7),_=_+I|0,B=Xl(B^_,16),N=N+B|0,I=Xl(I^N,12),_=_+I|0,B=Xl(B^_,8),N=N+B|0,I=Xl(I^N,7),x=x+T|0,M=Xl(M^x,16),R=R+M|0,T=Xl(T^R,12),x=x+T|0,M=Xl(M^x,8),R=R+M|0,T=Xl(T^R,7),E=E+C|0,U=Xl(U^E,16),P=P+U|0,C=Xl(C^P,12),E=E+C|0,U=Xl(U^E,8),P=P+U|0,C=Xl(C^P,7),k=k+S|0,L=Xl(L^k,16),O=O+L|0,S=Xl(S^O,12),k=k+S|0,L=Xl(L^k,8),O=O+L|0,S=Xl(S^O,7);let D=0;r[D++]=o+_|0,r[D++]=a+x|0,r[D++]=c+E|0,r[D++]=l+k|0,r[D++]=u+S|0,r[D++]=d+I|0,r[D++]=h+T|0,r[D++]=p+C|0,r[D++]=f+P|0,r[D++]=g+O|0,r[D++]=m+N|0,r[D++]=y+R|0,r[D++]=v+M|0,r[D++]=w+U|0,r[D++]=b+L|0,r[D++]=A+B|0},{counterRight:!1,counterLength:4,allowShortKeys:!1}),ou=new Uint8Array(16),au=(e,t)=>{e.update(t);const n=t.length%16;n&&e.update(ou.subarray(n))},cu=new Uint8Array(32);function lu(e,t,n,r,i){const s=e(t,n,cu),o=iu.create(s);i&&au(o,i),au(o,r);const a=Vl(r.length,i?i.length:0,!0);o.update(a);const c=o.digest();return Fl(s,a),c}const uu=((e,t)=>
2{function n(n){if(Bl(n),!zl)throw new Error("Non little-endian hardware is not yet supported");for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];if(void 0!==e.nonceLength){const t=i[0];if(!t)throw new Error("nonce / iv required");e.varSizeNonce?Bl(t):Bl(t,e.nonceLength)}const o=e.tagLength;o&&void 0!==i[1]&&Bl(i[1]);const a=t(n,...i),c=(e,t)=>{if(void 0!==t){if(2!==e)throw new Error("cipher output not supported");Bl(t)}};let l=!1;return{encrypt(e,t){if(l)throw new Error("cannot encrypt() twice with same key + nonce");return l=!0,Bl(e),c(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(Bl(e),o&&e.length<o)throw new Error("invalid ciphertext length: smaller than tagLength="+o);return c(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(n,e),n})({blockSize:64,nonceLength:12,tagLength:16},(e=>(t,n,r)=>({encrypt(i,s){const o=i.length;(s=ql(o+16,s,!1)).set(i);const a=s.subarray(0,-16);e(t,n,a,a,1);const c=lu(e,t,n,a,r);return s.set(c,o),Fl(c),s},decrypt(i,s){s=ql(i.length-16,s,!1);const o=i.subarray(0,-16),a=i.subarray(-16),c=lu(e,t,n,o,r);if(!function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n}(a,c))throw new Error("invalid tag");return s.set(i.subarray(0,-16)),e(t,n,s,s,1),Fl(c),s}}))(su));class du extends sc{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Ma(e);const n=rc(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let s=0;s<i.length;s++)i[s]^=54;this.iHash.update(i),this.oHash=e.create();for(let s=0;s<i.length;s++)i[s]^=106;this.oHash.update(i),Da(i)}update(e){return Ua(this),this.iHash.update(e),this}digestInto(e){Ua(this),Ra(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:s,outputLen:o}=this;return e.finished=r,e.destroyed=i,e.blockLen=s,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const hu=(e,t,n)=>new du(e,t).update(n).digest();hu.create=(e,t)=>new du(e,t);const pu=Uint8Array.from([0]),fu=Uint8Array.of();const gu=(e,t,n,r,i)=>function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32;Ma(e),Na(r);const i=e.outputLen;if(r>255*i)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(r/i);void 0===n&&(n=fu);const o=new Uint8Array(s*i),a=hu.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;u<s;u++)pu[0]=u+1,c.update(0===u?fu:l).update(n).update(pu).digestInto(l),o.set(l,i*u),a._cloneInto(c);return a.destroy(),c.destroy(),Da(l,pu),o.slice(0,r)}(e,function(e,t,n){return Ma(e),void 0===n&&(n=new Uint8Array(e.outputLen)),hu(e,rc(n),rc(t))}(e,t,n),r,i),mu=Wc,yu=BigInt(0),vu=BigInt(1);function wu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("boolean"!=typeof e){const n=t&&'"'.concat(t,'"');throw new Error(n+"expected boolean, got type="+typeof e)}return e}function bu(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=Oa(e),i=null===e||void 0===e?void 0:e.length,s=void 0!==t;if(!r||s&&i!==t){const o=n&&'"'.concat(n,'" '),a=s?" of length ".concat(t):"",c=r?"length=".concat(i):"type=".concat(typeof e);throw new Error(o+"expected Uint8Array"+a+", got "+c)}return e}function Au(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function _u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?yu:BigInt("0x"+e)}function xu(e){return _u(Ka(e))}function Eu(e){return Ra(e),_u(Ka(Uint8Array.from(e).reverse()))}function ku(e,t){return tc(e.toString(16).padStart(2*t,"0"))}function Su(e,t){return ku(e,t).reverse()}function Iu(e,t,n){let r;if("string"==typeof t)try{r=tc(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else{if(!Oa(t))throw new Error(e+" must be hex string or Uint8Array");r=Uint8Array.from(t)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(e+" of length "+n+" expected, got "+i);return r}const Tu=e=>"bigint"==typeof e&&yu<=e;function Cu(e,t,n,r){if(!function(e,t,n){return Tu(e)&&Tu(t)&&Tu(n)&&t<=e&&e<n}(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function Pu(e){let t;for(t=0;e>yu;e>>=vu,t+=1);return t}const Ou=e=>(vu<<BigInt(e))-vu;function Nu(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||"object"!=typeof e)throw new Error("expected valid options object");function r(t,n,r){const i=e[t];if(r&&void 0===i)return;const s=typeof i;if(s!==n||null===i)throw new Error('param "'.concat(t,'" is invali
2d: expected ').concat(n,", got ").concat(s))}Object.entries(t).forEach(e=>{let[t,n]=e;return r(t,n,!1)}),Object.entries(n).forEach(e=>{let[t,n]=e;return r(t,n,!0)})}function Ru(e){const t=new WeakMap;return function(n){const r=t.get(n);if(void 0!==r)return r;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];const a=e(n,...s);return t.set(n,a),a}}const Mu=BigInt(0),Uu=BigInt(1),Lu=BigInt(2),Bu=BigInt(3),Du=BigInt(4),ju=BigInt(5),Fu=BigInt(7),zu=BigInt(8),Wu=BigInt(9),qu=BigInt(16);function Hu(e,t){const n=e%t;return n>=Mu?n:t+n}function Vu(e,t,n){let r=e;for(;t-- >Mu;)r*=r,r%=n;return r}function Gu(e,t){if(e===Mu)throw new Error("invert: expected non-zero number");if(t<=Mu)throw new Error("invert: expected positive modulus, got "+t);let n=Hu(e,t),r=t,i=Mu,s=Uu;for(;n!==Mu;){const e=r%n,t=i-s*(r/n);r=n,n=e,i=s,s=t}if(r!==Uu)throw new Error("invert: does not exist");return Hu(i,t)}function Ku(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function Ju(e,t){const n=(e.ORDER+Uu)/Du,r=e.pow(t,n);return Ku(e,r,t),r}function Zu(e,t){const n=(e.ORDER-ju)/zu,r=e.mul(t,Lu),i=e.pow(r,n),s=e.mul(t,i),o=e.mul(e.mul(s,Lu),i),a=e.mul(s,e.sub(o,e.ONE));return Ku(e,a,t),a}function Qu(e){if(e<Bu)throw new Error("sqrt is not defined for small field");let t=e-Uu,n=0;for(;t%Lu===Mu;)t/=Lu,n++;let r=Lu;const i=nd(e);for(;1===ed(i,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return Ju;let s=i.pow(r,t);const o=(t+Uu)/Lu;return function(e,r){if(e.is0(r))return r;if(1!==ed(e,r))throw new Error("Cannot find square root");let i=n,a=e.mul(e.ONE,s),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw new Error("Cannot find square root");const r=Uu<<BigInt(i-t-1),s=e.pow(a,r);i=t,a=e.sqr(s),c=e.mul(c,a),l=e.mul(l,s)}return l}}function Yu(e){return e%Du===Bu?Ju:e%zu===ju?Zu:e%qu===Wu?function(e){const t=nd(e),n=Qu(e),r=n(t,t.neg(t.ONE)),i=n(t,r),s=n(t,t.neg(r)),o=(e+Fu)/qu;return(e,t)=>{let n=e.pow(t,o),a=e.mul(n,r);const c=e.mul(n,i),l=e.mul(n,s),u=e.eql(e.sqr(a),t),d=e.eql(e.sqr(c),t);n=e.cmov(n,a,u),a=e.cmov(l,c,d);const h=e.eql(e.sqr(a),t),p=e.cmov(n,a,h);return Ku(e,p,t),p}}(e):Qu(e)}const Xu=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function $u(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=new Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),s=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),s),r}function ed(e,t){const n=(e.ORDER-Uu)/Lu,r=e.pow(t,n),i=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function td(e,t){void 0!==t&&Na(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function nd(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e<=Mu)throw new Error("invalid field: expected ORDER > 0, got "+e);let i,s,o,a=!1;if("object"==typeof t&&null!=t){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(i=e.BITS),e.sqrt&&(s=e.sqrt),"boolean"==typeof e.isLE&&(n=e.isLE),"boolean"==typeof e.modFromBytes&&(a=e.modFromBytes),o=e.allowedLengths}else"number"==typeof t&&(i=t),r.sqrt&&(s=r.sqrt);const{nBitLength:c,nByteLength:l}=td(e,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:l,MASK:Ou(c),ZERO:Mu,ONE:Uu,allowedLengths:o,create:t=>Hu(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return Mu<=t&&t<e},is0:e=>e===Mu,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&Uu)===Uu,neg:t=>Hu(-t,e),eql:(e,t)=>e===t,sqr:t=>Hu(t*t,e),add:(t,n)=>Hu(t+n,e),sub:(t,n)=>Hu(t-n,e),mul:(t,n)=>Hu(t*n,e),pow:(e,t)=>function(e,t,n){if(n<Mu)throw new Error("invalid exponent, negatives unsupported");if(n===Mu)return e.ONE;if(n===Uu)return t;let r=e.ONE,i=t;for(;n>Mu;)n&Uu&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Uu;return r}(d,e,t),div:(t,n)=>Hu(t*Gu(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Gu(t,e),sqrt:s||(t=>(u||(u=Yu(e)),u(d,t))),toBytes:e=>n?Su(e,l):ku(e,l),fromBytes:function(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(o){if(!o.includes(t.length)||t.length>l)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+t.length);const e=new Uint8Array(l);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);let i=n?Eu(t):xu(t);
2if(a&&(i=Hu(i,e)),!r&&!d.isValid(i))throw new Error("invalid field element: outside of range 0..ORDER");return i},invertBatch:e=>$u(d,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(d)}function rd(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function id(e){const t=rd(e);return t+Math.ceil(t/2)}const sd=BigInt(0),od=BigInt(1);function ad(e,t){const n=t.negate();return e?n:t}function cd(e,t){const n=$u(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function ld(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ud(e,t){ld(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:Ou(e),maxNumber:n,shiftBy:BigInt(e)}}function dd(e,t,n){const{windowSize:r,mask:i,maxNumber:s,shiftBy:o}=n;let a=Number(e&i),c=e>>o;a>r&&(a-=s,c+=od);const l=t*r;return{nextN:c,offset:l+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!==0,offsetF:l}}const hd=new WeakMap,pd=new WeakMap;function fd(e){return pd.get(e)||1}function gd(e){if(e!==sd)throw new Error("invalid wNAF")}class md{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.ZERO,r=e;for(;t>sd;)t&od&&(n=n.add(r)),r=r.double(),t>>=od;return n}precomputeWindow(e,t){const{windows:n,windowSize:r}=ud(t,this.bits),i=[];let s=e,o=s;for(let a=0;a<n;a++){o=s,i.push(o);for(let e=1;e<r;e++)o=o.add(s),i.push(o);s=o.double()}return i}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let r=this.ZERO,i=this.BASE;const s=ud(e,this.bits);for(let o=0;o<s.windows;o++){const{nextN:e,offset:a,isZero:c,isNeg:l,isNegF:u,offsetF:d}=dd(n,o,s);n=e,c?i=i.add(ad(u,t[d])):r=r.add(ad(l,t[a]))}return gd(n),{p:r,f:i}}wNAFUnsafe(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.ZERO;const i=ud(e,this.bits);for(let s=0;s<i.windows&&n!==sd;s++){const{nextN:e,offset:o,isZero:a,isNeg:c}=dd(n,s,i);if(n=e,!a){const e=t[o];r=r.add(c?e.negate():e)}}return gd(n),r}
2getPrecomputes(e,t,n){let r=hd.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&("function"==typeof n&&(r=n(r)),hd.set(t,r))),r}cached(e,t,n){const r=fd(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){const i=fd(e);return 1===i?this._unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)}createCache(e,t){ld(t,this.bits),pd.set(e,t),hd.delete(e)}hasCache(e){return 1!==fd(e)}}function yd(e,t,n,r){(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})})(n,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}(r,t);const i=n.length,s=r.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,a=Pu(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=Ou(c),u=new Array(Number(l)+1).fill(o);let d=o;for(let h=Math.floor((t.BITS-1)/c)*c;h>=0;h-=c){u.fill(o);for(let t=0;t<s;t++){const e=r[t],i=Number(e>>BigInt(h)&l);u[i]=u[i].add(n[t])}let e=o;for(let t=u.length-1,n=o;t>0;t--)n=n.add(u[t]),e=e.add(n);if(d=d.add(e),0!==h)for(let t=0;t<c;t++)d=d.double()}return d}function vd(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){const t=Xu.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});Nu(e,t)}(t),t}return nd(e,{isLE:n})}BigInt(0),BigInt(1),BigInt(2),BigInt(8),nc("HashToScalar-");const wd=BigInt(0),bd=BigInt(1),Ad=BigInt(2);function _d(e){const t=function(e){return Nu(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze((0,i.A)({},e))}(e),{P:n,type:r,adjustScalarBytes:s,powPminus2:o,randomBytes:a}=t,c="x25519"===r;if(!c&&"x448"!==r)throw new Error("invalid type");const l=a||ac,u=c?255:448,d=c?32:56,h=BigInt(c?9:5),p=BigInt(c?121665:39081),f=c?Ad**BigInt(254):Ad**BigInt(447),g=c?BigInt(8)*Ad**BigInt(251)-bd:BigInt(4)*Ad**BigInt(445)-bd,m=f+g+bd,y=e=>Hu(e,n),v=w(h);function w(e){return Su(y(e),d)}function b(e,t){const r=function(e,t){Cu("u",e,wd,n),Cu("scalar",t,f,m);const r=t,i=e;let s=bd,a=wd,c=e,l=bd,d=wd;for(let n=BigInt(u-1);n>=wd;n--){const e=r>>n&bd;d^=e,({x_2:s,x_3:c}=_(d,s,c)),({x_2:a,x_3:l}=_(d,a,l)),d=e;const t=s+a,o=y(t*t),u=s-a,h=y(u*u),f=o-h,g=c+l,m=y((c-l)*t),v=y(g*u),w=m+v,b=m-v;c=y(w*w),l=y(i*y(b*b)),s=y(o*h),a=y(f*(o+y(p*f)))}({x_2:s,x_3:c}=_(d,s,c)),({x_2:a,x_3:l}=_(d,a,l));const h=o(a);return y(s*h)}(function(e){const t=Iu("u coordinate",e,d);return c&&(t[31]&=127),y(Eu(t))}(t),function(e){return Eu(s(Iu("scalar",e,d)))}(e));if(r===wd)throw new Error("invalid private or public key received");return w(r)}function A(e){return b(e,v)}function _(e,t,n){const r=y(e*(t-n));return{x_2:t=y(t-r),x_3:n=y(n+r)}}const x={secretKey:d,publicKey:d,seed:d},E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l(d);return Ra(e,x.seed),e};return{keygen:function(e){const t=E(e);return{secretKey:t,publicKey:A(t)}},getSharedSecret:(e,t)=>b(e,t),getPublicKey:e=>A(e),scalarMult:b,scalarMultBase:A,utils:{randomSecretKey:E,randomPrivateKey:E},GuBytes:v.slice(),lengths:x}}const xd=BigInt(1),Ed=BigInt(2),kd=BigInt(3),Sd=BigInt(5),Id=BigInt(8),Td=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");function Cd(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const Pd=nd({p:Td,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:Id,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")}.p,{isLE:!0}),Od=(()=>{const e=Pd.ORDER;return _d({P:e,type:"x25519",powPminus2:t=>{const{pow_p_5_8:n,b2:r}=function(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=Td,o=e*e%s*e%s,a=Vu(o,Ed,s)*o%s,c=Vu(a,xd,s)*e%s,l=Vu(c,Sd,s)*c%s,u=Vu(l,t,s)*l%s,d=Vu(u,n,s)*u%s,h=Vu(d,r,s)*d%s,p=Vu(h,i,s)*h%s,f=Vu(p,i,s)*h%s,g=Vu(f,t,s)*l%s;return{pow_p_5_8:Vu(g,Ed,s)*e%s,b2:o}}(t);return Hu(Vu(n,kd,e)*r,e)},adjustScalarBytes:Cd})})(),Nd=(e,t)=>(e+(e>=0?t:-t)/jd)/t;function Rd(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function Md(e,t){const n={};for(let r of Object.keys(t))n[r]=void 0===e[r]?t[r]:e[r];return wu(n.lowS,"lowS"),wu(n.prehash,"prehash"),void 0!==n.format&&Rd(n.format),n}
2class Ud extends Error{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}}const Ld={Err:Ud,_tlv:{encode:(e,t)=>{const{Err:n}=Ld;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(1&t.length)throw new n("tlv.encode: unpadded data");const r=t.length/2,i=Au(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Au(i.length/2|128):"";return Au(e)+s+i+t},decode(e,t){const{Err:n}=Ld;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const i=t[r++];let s=0;if(!!(128&i)){const e=127&i;if(!e)throw new n("tlv.decode(long): indefinite length not supported");if(e>4)throw new n("tlv.decode(long): byte length is too big");const o=t.subarray(r,r+e);if(o.length!==e)throw new n("tlv.decode: length bytes not complete");if(0===o[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of o)s=s<<8|t;if(r+=e,s<128)throw new n("tlv.decode(long): not minimal encoding")}else s=i;const o=t.subarray(r,r+s);if(o.length!==s)throw new n("tlv.decode: wrong value length");return{v:o,l:t.subarray(r+s)}}},_int:{encode(e){const{Err:t}=Ld;if(e<Bd)throw new t("integer: negative integers are not allowed");let n=Au(e);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Ld;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return xu(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Ld,i=Iu("signature",e),{v:s,l:o}=r.decode(48,i);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:l,l:u}=r.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=Ld,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}},Bd=BigInt(0),Dd=BigInt(1),jd=BigInt(2),Fd=BigInt(3),zd=BigInt(4);function Wd(e,t){const{BYTES:n}=e;let r;if("bigint"==typeof t)r=t;else{let s=Iu("private key",t);try{r=e.fromBytes(s)}catch(i){throw new Error("invalid private key: expected ui8a of size ".concat(n,", got ").concat(typeof t))}}if(!e.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function qd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(void 0===r&&(r="edwards"===e),!t||"object"!=typeof t)throw new Error("expected valid ".concat(e," CURVE object"));for(const a of["p","n","h"]){const e=t[a];if(!("bigint"==typeof e&&e>sd))throw new Error("CURVE.".concat(a," must be positive bigint"))}const i=vd(t.p,n.Fp,r),s=vd(t.n,n.Fn,r),o=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const a of o)if(!i.isValid(t[a]))throw new Error("CURVE.".concat(a," must be valid field element of CURVE.Fp"));return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:i,Fn:s}}("weierstrass",e,t),{Fp:r,Fn:i}=n;let s=n.CURVE;const{h:o,n:a}=s;Nu(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=t;if(c&&(!r.is0(s.a)||"bigint"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=Vd(r,i);function u(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const d=t.toBytes||function(e,t,n){const{x:i,y:s}=t.toAffine(),o=r.toBytes(i);if(wu(n,"isCompressed"),n){u();return ic(Hd(!r.isOdd(s)),o)}return ic(Uint8Array.of(4),o,r.toBytes(s))},h=t.fromBytes||function(e){bu(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:n}=l,i=e.length,s=e[0],o=e.subarray(1);if(i!==t||2!==s&&3!==s){if(i===n&&4===s){const e=r.BYTES,t=r.fromBytes(o.subarray(0,e)),n=r.fromBytes(o.subarray(e,2*e));if(!f(t,n))throw new Error("bad point: is not on curve");return{x:t,y:n}}throw new Error("bad point: got length ".concat(i,", expected compressed=").concat(t," or uncompressed=").concat(n))}{const e=r.fromBytes(o);if(!r.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=p(e);let n;try{n=r.sqrt(t)}catch(Ct){const t=Ct instanceof Error?": "+Ct.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}u();return 1===(1&s)!==r.isOdd(n)&&(n=r.neg(n)),{x:e,y:n}}};function p(e){const t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,s.a)),s.b)}function f(e,t){const n=r.sqr(t),i=p(e);return r.eql(n,i)}if(!f(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const g=r.mul(r.pow(s.a,Fd),zd),m=r.mul(r.sqr(s.b),BigInt(27));if(r.is0(r.add(g,m)))throw new Error("bad curve params: a or b");function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r.isValid(t)||n&&r.is0(t))throw new Error("bad point coordinate ".concat(e));return t}function v(e){if(!(e instanceof x))throw new Error("ProjectivePoint expected")}function w(e){if(!c||!c.basises)throw new Error("no endo");return function(e,t,n){const[[r,i],[s,o]]=t,a=Nd(o*e,n),c=Nd(-i*e,n);let l=e-a*r-c*s,u=-a*i-c*o;const d=l<Bd,h=u<Bd;d&&(l=-l),h&&(u=-u);const p=Ou(Math.ceil(Pu(n)/2))+Dd;if(l<Bd||l>=p||u<Bd||u>=p)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:d,k1:l,k2neg:h,k2:u}}(e,c.basises,i.ORDER)}const b=Ru((e,t)=>
2{const{X:n,Y:i,Z:s}=e;if(r.eql(s,r.ONE))return{x:n,y:i};const o=e.is0();null==t&&(t=o?r.ONE:r.inv(s));const a=r.mul(n,t),c=r.mul(i,t),l=r.mul(s,t);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),A=Ru(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw new Error("bad point: x or y not field elements");if(!f(n,i))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function _(e,t,n,i,s){return n=new x(r.mul(n.X,e),n.Y,n.Z),t=ad(i,t),n=ad(s,n),t.add(n)}class x{constructor(e,t,n){this.X=y("x",e),this.Y=y("y",t,!0),this.Z=y("z",n),Object.freeze(this)}static CURVE(){return s}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof x)throw new Error("projective point not allowed");return r.is0(t)&&r.is0(n)?x.ZERO:new x(t,n,r.ONE)}static fromBytes(e){const t=x.fromAffine(h(bu(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return x.fromBytes(Iu("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return k.createCache(this,e),t||this.multiply(Fd),this}assertValidity(){A(this)}hasEvenY(){const{y:e}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(e)}equals(e){v(e);const{X:t,Y:n,Z:i}=this,{X:s,Y:o,Z:a}=e,c=r.eql(r.mul(t,a),r.mul(s,i)),l=r.eql(r.mul(n,a),r.mul(o,i));return c&&l}negate(){return new x(this.X,r.neg(this.Y),this.Z)}double(){const{a:e,b:t}=s,n=r.mul(t,Fd),{X:i,Y:o,Z:a}=this;let c=r.ZERO,l=r.ZERO,u=r.ZERO,d=r.mul(i,i),h=r.mul(o,o),p=r.mul(a,a),f=r.mul(i,o);return f=r.add(f,f),u=r.mul(i,a),u=r.add(u,u),c=r.mul(e,u),l=r.mul(n,p),l=r.add(c,l),c=r.sub(h,l),l=r.add(h,l),l=r.mul(c,l),c=r.mul(f,c),u=r.mul(n,u),p=r.mul(e,p),f=r.sub(d,p),f=r.mul(e,f),f=r.add(f,u),u=r.add(d,d),d=r.add(u,d),d=r.add(d,p),d=r.mul(d,f),l=r.add(l,d),p=r.mul(o,a),p=r.add(p,p),d=r.mul(p,f),c=r.sub(c,d),u=r.mul(p,h),u=r.add(u,u),u=r.add(u,u),new x(c,l,u)}add(e){v(e);const{X:t,Y:n,Z:i}=this,{X:o,Y:a,Z:c}=e;let l=r.ZERO,u=r.ZERO,d=r.ZERO;const h=s.a,p=r.mul(s.b,Fd);let f=r.mul(t,o),g=r.mul(n,a),m=r.mul(i,c),y=r.add(t,n),w=r.add(o,a);y=r.mul(y,w),w=r.add(f,g),y=r.sub(y,w),w=r.add(t,i);let b=r.add(o,c);return w=r.mul(w,b),b=r.add(f,m),w=r.sub(w,b),b=r.add(n,i),l=r.add(a,c),b=r.mul(b,l),l=r.add(g,m),b=r.sub(b,l),d=r.mul(h,w),l=r.mul(p,m),d=r.add(l,d),l=r.sub(g,d),d=r.add(g,d),u=r.mul(l,d),g=r.add(f,f),g=r.add(g,f),m=r.mul(h,m),w=r.mul(p,w),g=r.add(g,m),m=r.sub(f,m),m=r.mul(h,m),w=r.add(w,m),f=r.mul(g,w),u=r.add(u,f),f=r.mul(b,w),l=r.mul(y,l),l=r.sub(l,f),f=r.mul(y,g),d=r.mul(b,d),d=r.add(d,f),new x(l,u,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}multiply(e){const{endo:n}=t;if(!i.isValidNot0(e))throw new Error("invalid scalar: out of range");let r,s;const o=e=>k.cached(this,e,e=>cd(x,e));if(n){const{k1neg:t,k1:i,k2neg:a,k2:c}=w(e),{p:l,f:u}=o(i),{p:d,f:h}=o(c);s=u.add(h),r=_(n.beta,l,d,t,a)}else{const{p:t,f:n}=o(e);r=t,s=n}return cd(x,[r,s])[0]}multiplyUnsafe(e){const{endo:n}=t,r=this;if(!i.isValid(e))throw new Error("invalid scalar: out of range");if(e===Bd||r.is0())return x.ZERO;if(e===Dd)return r;if(k.hasCache(this))return this.multiply(e);if(n){const{k1neg:t,k1:i,k2neg:s,k2:o}=w(e),{p1:a,p2:c}=function(e,t,n,r){let i=t,s=e.ZERO,o=e.ZERO;for(;n>sd||r>sd;)n&od&&(s=s.add(i)),r&od&&(o=o.add(i)),i=i.double(),n>>=od,r>>=od;return{p1:s,p2:o}}(x,r,i,o);return _(n.beta,a,c,t,s)}return k.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){const r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return b(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return o===Dd||(e?e(x,this):k.unsafe(this,a).is0())}clearCofactor(){const{clearCofactor:e}=t;return o===Dd?this:e?e(x,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return wu(e,"isCompressed"),this.assertValidity(),d(x,this,e)}toHex(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Ka(this.toBytes(e))}toString(){return"<Point ".concat(this.is0()?"ZERO":this.toHex(),">")}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.toBytes(e)}
2_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return cd(x,e)}static msm(e,t){return yd(x,i,e,t)}static fromPrivateKey(e){return x.BASE.multiply(Wd(i,e))}}x.BASE=new x(s.Gx,s.Gy,r.ONE),x.ZERO=new x(r.ZERO,r.ONE,r.ZERO),x.Fp=r,x.Fn=i;const E=i.BITS,k=new md(x,t.endo?Math.ceil(E/2):E);return x.BASE.precompute(8),x}function Hd(e){return Uint8Array.of(e?2:3)}function Vd(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Gd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{Fn:n}=e,r=t.randomBytes||ac,i=Object.assign(Vd(e.Fp,n),{seed:id(n.ORDER)});function s(e){try{return!!Wd(n,e)}catch(t){return!1}}function o(){return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.length,i=rd(t),s=id(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=Hu(n?Eu(e):xu(e),t-Uu)+Uu;return n?Su(o,i):ku(o,i)}(bu(arguments.length>0&&void 0!==arguments[0]?arguments[0]:r(i.seed),i.seed,"seed"),n.ORDER)}function a(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.BASE.multiply(Wd(n,t)).toBytes(r)}function c(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:r,publicKey:s,publicKeyUncompressed:o}=i;if(n.allowedLengths||r===s)return;const a=Iu("key",t).length;return a===s||a===o}return Object.freeze({getPublicKey:a,getSharedSecret:function(t,r){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!0===c(t))throw new Error("first arg must be private key");if(!1===c(r))throw new Error("second arg must be public key");const s=Wd(n,t);return e.fromHex(r).multiply(s).toBytes(i)},keygen:function(e){const t=o(e);return{secretKey:t,publicKey:a(t)}},Point:e,utils:{isValidSecretKey:s,isValidPublicKey:function(t,n){const{publicKey:r,publicKeyUncompressed:s}=i;try{const i=t.length;return!(!0===n&&i!==r||!1===n&&i!==s)&&!!e.fromBytes(t)}catch(o){return!1}},randomSecretKey:o,isValidPrivateKey:s,randomPrivateKey:o,normPrivateKeyToScalar:e=>Wd(n,e),precompute(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.BASE).precompute(t,!1)}},lengths:i})}function Kd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Ma(t),Nu(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||ac,i=n.hmac||function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return hu(t,e,ic(...r))},{Fp:s,Fn:o}=e,{ORDER:a,BITS:c}=o,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:h,lengths:p}=Gd(e,n),f={prehash:!1,lowS:"boolean"==typeof n.lowS&&n.lowS,format:void 0,extraEntropy:!1},g="compact";function m(e){return e>a>>Dd}function y(e,t){if(!o.isValidNot0(t))throw new Error("invalid signature ".concat(e,": out of range 1..Point.Fn.ORDER"));return t}class v{constructor(e,t,n){this.r=y("r",e),this.s=y("s",t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;if(function(e,t){Rd(t);const n=p.signature;bu(e,"compact"===t?n:"recovered"===t?n+1:void 0,"".concat(t," signature"))}(e,n),"der"===n){const{r:t,s:n}=Ld.toSig(bu(e));return new v(t,n)}"recovered"===n&&(t=e[0],n="compact",e=e.subarray(1));const r=o.BYTES,i=e.subarray(0,r),s=e.subarray(r,2*r);return new v(o.fromBytes(i),o.fromBytes(s),t)}static fromHex(e,t){return this.fromBytes(tc(e),t)}addRecoveryBit(e){return new v(this.r,this.s,e)}recoverPublicKey(t){const n=s.ORDER,{r:r,s:i,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(a*jd<n&&c>1)throw new Error("recovery id is ambiguous for h>1 curve");const l=2===c||3===c?r+a:r;if(!s.isValid(l))throw new Error("recovery id 2 or 3 invalid");const u=s.toBytes(l),d=e.fromBytes(ic(Hd(0===(1&c)),u)),h=o.inv(l),p=b(Iu("msgHash",t)),f=o.create(-p*h),g=o.create(i*h),m=e.BASE.multiplyUnsafe(f).add(d.multiplyUnsafe(g));if(m.is0())throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return m(this.s)}toBytes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;if(Rd(e),"der"===e)return tc(Ld.hexFromSig(this));const t=o.toBytes(this.r),n=o.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return ic(Uint8Array.of(this.recovery),t,n)}return ic(t,n)}toHex(e){return Ka(this.toBytes(e))}assertValidity(){}static fromCompact(e){return v.fromBytes(Iu("sig",e),"compact")}static fromDER(e){return v.fromBytes(Iu("sig",e),"der")}normalizeS(){return this.hasHighS()?new v(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Ka(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Ka(this.toBytes("compact"))}}const w=n.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=xu(e),n=8*e.length-c;return n>0?t>>BigInt(n):t},b=n.bits2int_modN||function(e){return o.create(w(e))},A=Ou(c);function _(e){return Cu("num < 2^"+c,e,Bd,A),o.toBytes(e)}function x(e,n){return bu(e,void 0,"message"),n?bu(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:h,lengths:p,Point:e,sign:function(n,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=Iu("message",n);const{seed:c,k2sig:l}=function(t,n,i){if(["recovered","canonical"].some(e=>e in i))throw new Error("sign() legacy options not supported");const{lowS:s,prehash:a,extraEntropy:c}=Md(i,f);t=x(t,a);const l=b(t),u=Wd(o,n),d=[_(u),_(l)];if(null!=c&&!1!==c){const e=!0===c?r(p.secretKey):c;d.push(Iu("extraEntropy",e))}const h=ic(...d),g=l;return{seed:h,k2sig:function(t){const n=w(t);if(!o.isValidNot0(n))return;const r=o.inv(n),i=e.BASE.multiply(n).toAffine(),a=o.create(i.x);if(a===Bd)return;const c=o.create(r*o.create(g+a*u));if(c===Bd)return;let l=(i.x===a?0:2)|Number(i.y&Dd),d=c;return s&&m(c)&&(d=o.neg(c),l^=1),new v(a,d,l)}}}(n,s,a);return function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const r=e=>new Uint8Array(e),i=e=>Uint8Array.of(e);let s=r(e),o=r(e),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},l=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n(o,s,...t)},u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r(0);o=l(i(0),e),s=l(),0!==e.length&&(o=l(i(1),e),s=l())},d=()=>
2{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){s=l();const t=s.slice();n.push(t),e+=s.length}return ic(...n)};return(e,t)=>{let n;for(c(),u(e);!(n=t(d()));)u();return c(),n}}(t.outputLen,o.BYTES,i)(c,l)},verify:function(t,n,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{lowS:s,prehash:a,format:c}=Md(i,f);if(r=Iu("publicKey",r),n=x(Iu("message",n),a),"strict"in i)throw new Error("options.strict was renamed to lowS");const l=void 0===c?function(e){let t;const n="string"==typeof e||Oa(e),r=!n&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!n&&!r)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(r)t=new v(e.r,e.s);else if(n){try{t=v.fromBytes(Iu("sig",e),"der")}catch(s){if(!(s instanceof Ld.Err))throw s}if(!t)try{t=v.fromBytes(Iu("sig",e),"compact")}catch(i){return!1}}return t||!1}(t):v.fromBytes(Iu("sig",t),c);if(!1===l)return!1;try{const t=e.fromBytes(r);if(s&&l.hasHighS())return!1;const{r:i,s:a}=l,c=b(n),u=o.inv(a),d=o.create(c*u),h=o.create(i*u),p=e.BASE.multiplyUnsafe(d).add(t.multiplyUnsafe(h));return!p.is0()&&o.create(p.x)===i}catch(u){return!1}},recoverPublicKey:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{prehash:r}=Md(n,f);return t=x(t,r),v.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:v,hash:t})}function Jd(e){const{CURVE:t,curveOpts:n}=function(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:nd(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}function Zd(e){const{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:i}=Jd(e);return function(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,td(n.Fn.ORDER,n.Fn.BITS))})}(e,Kd(qd(t,n),r,i))}function Qd(e,t){const n=t=>Zd((0,i.A)((0,i.A)({},e),{},{hash:t}));return(0,i.A)((0,i.A)({},n(t)),{},{create:n})}const Yd={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},Xd={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},$d={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},eh=nd(Yd.p),th=nd(Xd.p),nh=nd($d.p),rh=Qd((0,i.A)((0,i.A)({},Yd),{}
2,{Fp:eh,lowS:!1}),Wc);Qd((0,i.A)((0,i.A)({},Xd),{},{Fp:th,lowS:!1}),Hc),Qd((0,i.A)((0,i.A)({},$d),{},{Fp:nh,lowS:!1,allowedPrivateKeyLengths:[130,131,132]}),qc);const ih=rh,sh="base10",oh="base16",ah="base64pad",ch="base64url",lh="utf8";function uh(){const e=ac(32);return(0,Fs.dI)(e,oh)}function dh(e){const t=mu((0,Fs.sH)(e,oh));return(0,Fs.dI)(t,oh)}function hh(e){const t=mu((0,Fs.sH)(e,lh));return(0,Fs.dI)(t,oh)}function ph(e){return(0,Fs.sH)("".concat(e),sh)}function fh(e){return Number((0,Fs.dI)(e,sh))}function gh(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mh(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4;return t+"=".repeat(n)}function yh(e){if(2===fh(e.type))return(0,Fs.dI)((0,Fs.xW)([e.type,e.sealed]),ah);if(1===fh(e.type)){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return(0,Fs.dI)((0,Fs.xW)([e.type,e.senderPublicKey,e.iv,e.sealed]),ah)}return(0,Fs.dI)((0,Fs.xW)([e.type,e.iv,e.sealed]),ah)}function vh(e){const t=(e.encoding||ah)===ch?mh(e.encoded):e.encoded,n=(0,Fs.sH)(t,ah),r=n.slice(0,1);if(1===fh(r)){const e=33,t=e+12,i=n.slice(1,e),s=n.slice(e,t);return{type:r,sealed:n.slice(t),iv:s,senderPublicKey:i}}if(2===fh(r)){return{type:r,sealed:n.slice(1),iv:ac(12)}}const i=n.slice(1,13);return{type:r,sealed:n.slice(13),iv:i}}function wh(e){const t=(null===e||void 0===e?void 0:e.type)||0;if(1===t){if(typeof(null===e||void 0===e?void 0:e.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(null===e||void 0===e?void 0:e.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:null===e||void 0===e?void 0:e.senderPublicKey,receiverPublicKey:null===e||void 0===e?void 0:e.receiverPublicKey}}function bh(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function Ah(e){return 2===e.type}function _h(e,t){const[n,r,i]=e.split("."),s=Buffer.from(mh(i),"base64");if(64!==s.length)throw new Error("Invalid signature length");const o=s.slice(0,32),a=s.slice(32,64),c="".concat(n,".").concat(r),l=mu(c),u=function(e){const t=Buffer.from(e.x,"base64"),n=Buffer.from(e.y,"base64");return(0,Fs.xW)([new Uint8Array([4]),t,n])}(t);if(!ih.verify((0,Fs.xW)([o,a]),l,u))throw new Error("Invalid signature");return(0,js.Cq)(e).payload}function xh(e){return(null===e||void 0===e?void 0:e.relay)||{protocol:"irn"}}function Eh(e){const t=zs.CG[e];if(typeof t>"u")throw new Error("Relay Protocol not supported: ".concat(e));return t}var kh=Object.defineProperty,Sh=Object.defineProperties,Ih=Object.getOwnPropertyDescriptors,Th=Object.getOwnPropertySymbols,Ch=Object.prototype.hasOwnProperty,Ph=Object.prototype.propertyIsEnumerable,Oh=(e,t,n)=>t in e?kh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nh=(e,t)=>{for(var n in t||(t={}))Ch.call(t,n)&&Oh(e,n,t[n]);if(Th)for(var n of Th(t))Ph.call(t,n)&&Oh(e,n,t[n]);return e};function Rh(e){const t={},n="relay"+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-");return Object.keys(e).forEach(r=>{if(r.startsWith(n)){const i=r.replace(n,""),s=e[r];t[i]=s}}),t}function Mh(e){if(!e.includes("wc:")){const t=la(e);null!=t&&t.includes("wc:")&&(e=t)}const t=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=e.substring(t+1,n).split("@"),s=typeof n<"u"?e.substring(n):"",o=new URLSearchParams(s),a=Object.fromEntries(o.entries()),c="string"==typeof a.methods?a.methods.split(","):void 0;return{protocol:r,topic:Uh(i[0]),version:parseInt(i[1],10),symKey:a.symKey,relay:Rh(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function Uh(e){return e.startsWith("//")?e.substring(2):e}function Lh(e){const t=new URLSearchParams,n=Nh(Nh(((e,t)=>Sh(e,Ih(t)))(Nh({},function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";const n={};return Object.keys(e).forEach(r=>{const i=r,s="relay"+t+i;e[i]&&(n[s]=e[i])}),n}(e.relay)),{symKey:e.symKey}),e.expiryTimestamp&&{expiryTimestamp:e.expiryTimestamp.toString()}),e.methods&&{methods:e.methods.join(",")});return Object.entries(n).sort((e,t)=>
2{let[n]=e,[r]=t;return n.localeCompare(r)}).forEach(e=>{let[n,r]=e;void 0!==r&&t.append(n,String(r))}),"".concat(e.protocol,":").concat(e.topic,"@").concat(e.version,"?").concat(t)}function Bh(e,t,n){return"".concat(e,"?wc_ev=").concat(n,"&topic=").concat(t)}var Dh=Object.defineProperty,jh=Object.defineProperties,Fh=Object.getOwnPropertyDescriptors,zh=Object.getOwnPropertySymbols,Wh=Object.prototype.hasOwnProperty,qh=Object.prototype.propertyIsEnumerable,Hh=(e,t,n)=>t in e?Dh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vh=(e,t)=>{for(var n in t||(t={}))Wh.call(t,n)&&Hh(e,n,t[n]);if(zh)for(var n of zh(t))qh.call(t,n)&&Hh(e,n,t[n]);return e},Gh=(e,t)=>jh(e,Fh(t));function Kh(e){const t=[];return e.forEach(e=>{const[n,r]=e.split(":");t.push("".concat(n,":").concat(r))}),t}function Jh(e){return e.includes(":")}function Zh(e){return Jh(e)?e.split(":")[0]:e}function Qh(e){var t,n,r;const i={};if(!rp(e))return i;for(const[s,o]of Object.entries(e)){const e=Jh(s)?[s]:o.chains,a=o.methods||[],c=o.events||[],l=Zh(s);i[l]=Gh(Vh({},i[l]),{chains:ia(e,null==(t=i[l])?void 0:t.chains),methods:ia(a,null==(n=i[l])?void 0:n.methods),events:ia(c,null==(r=i[l])?void 0:r.events)})}return i}function Yh(e,t){t=t.map(e=>e.replace("did:pkh:",""));const n=function(e){const t={};return null!==e&&void 0!==e&&e.forEach(e=>{var n;const[r,i]=e.split(":");t[r]||(t[r]={accounts:[],chains:[],events:[],methods:[]}),t[r].accounts.push(e),null==(n=t[r].chains)||n.push("".concat(r,":").concat(i))}),t}(t);for(const[r,i]of Object.entries(n))i.methods?i.methods=ia(i.methods,e):i.methods=e,i.events=["chainChanged","accountsChanged"];return n}const Xh={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},$h={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ep(e,t){const{message:n,code:r}=$h[e];return{message:t?"".concat(n," ").concat(t):n,code:r}}function tp(e,t){const{message:n,code:r}=Xh[e];return{message:t?"".concat(n," ").concat(t):n,code:r}}function np(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function rp(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function ip(e){return typeof e>"u"}function sp(e,t){return!(!t||!ip(e))||"string"==typeof e&&!!e.trim().length}function op(e,t){return!(!t||!ip(e))||"number"==typeof e&&!isNaN(e)}function ap(e){return!(!sp(e,!1)||!e.includes(":"))&&2===e.split(":").length}function cp(e){let t=!0;return np(e)?e.length&&(t=e.every(e=>sp(e,!1))):t=!1,t}function lp(e,t,n){let r=null;
2return Object.entries(e).forEach(e=>{let[i,s]=e;if(r)return;const o=function(e,t,n){let r=null;return np(t)&&t.length?t.forEach(e=>{r||ap(e)||(r=tp("UNSUPPORTED_CHAINS","".concat(n,", chain ").concat(e,' should be a string and conform to "namespace:chainId" format')))}):ap(e)||(r=tp("UNSUPPORTED_CHAINS","".concat(n,', chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }'))),r}(i,Eo(i,s),"".concat(t," ").concat(n));o&&(r=o)}),r}function up(e,t){let n=null;return np(e)?e.forEach(e=>{n||function(e){if(sp(e,!1)&&e.includes(":")){const t=e.split(":");if(3===t.length){const e=t[0]+":"+t[1];return!!t[2]&&ap(e)}}return!1}(e)||(n=tp("UNSUPPORTED_ACCOUNTS","".concat(t,", account ").concat(e,' should be a string and conform to "namespace:chainId:address" format')))}):n=tp("UNSUPPORTED_ACCOUNTS","".concat(t,', accounts should be an array of strings conforming to "namespace:chainId:address" format')),n}function dp(e,t){let n=null;return Object.values(e).forEach(e=>{if(n)return;const r=function(e,t){let n=null;return cp(null===e||void 0===e?void 0:e.methods)?cp(null===e||void 0===e?void 0:e.events)||(n=tp("UNSUPPORTED_EVENTS","".concat(t,", events should be an array of strings or empty array for no events"))):n=tp("UNSUPPORTED_METHODS","".concat(t,", methods should be an array of strings or empty array for no methods")),n}(e,"".concat(t,", namespace"));r&&(n=r)}),n}function hp(e,t){let n=null;if(e&&rp(e)){const r=dp(e,t);r&&(n=r);const i=function(e,t){let n=null;return Object.values(e).forEach(e=>{if(n)return;const r=up(null===e||void 0===e?void 0:e.accounts,"".concat(t," namespace"));r&&(n=r)}),n}(e,t);i&&(n=i)}else n=ep("MISSING_OR_INVALID","".concat(t,", namespaces should be an object with data"));return n}function pp(e){return sp(e.protocol,!0)}function fp(e){return typeof e<"u"&&null!==typeof e}function gp(e,t){return!(!ap(t)||!function(e){const t=[];return Object.values(e).forEach(e=>{t.push(...Kh(e.accounts))}),t}(e).includes(t))}function mp(e,t,n){return!!sp(n,!1)&&function(e,t){const n=[];return Object.values(e).forEach(e=>{Kh(e.accounts).includes(t)&&n.push(...e.methods)}),n}(e,t).includes(n)}function yp(e,t,n){return!!sp(n,!1)&&function(e,t){const n=[];return Object.values(e).forEach(e=>{Kh(e.accounts).includes(t)&&n.push(...e.events)}),n}(e,t).includes(n)}function vp(e,t,n){let r=null;const i=function(e){const t={};return Object.keys(e).forEach(n=>{var r;n.includes(":")?t[n]=e[n]:null==(r=e[n].chains)||r.forEach(r=>{t[r]={methods:e[n].methods,events:e[n].events}})}),t}(e),s=function(e){const t={};return Object.keys(e).forEach(n=>{if(n.includes(":"))t[n]=e[n];else{const r=Kh(e[n].accounts);null===r||void 0===r||r.forEach(r=>{t[r]={accounts:e[n].accounts.filter(e=>e.includes("".concat(r,":"))),methods:e[n].methods,events:e[n].events}})}}),t}(t),o=Object.keys(i),a=Object.keys(s),c=wp(Object.keys(e)),l=wp(Object.keys(t)),u=c.filter(e=>!l.includes(e));return u.length&&(r=ep("NON_CONFORMING_NAMESPACES","".concat(n," namespaces keys don't satisfy requiredNamespaces.\n Required: ").concat(u.toString(),"\n Received: ").concat(Object.keys(t).toString()))),Jo(o,a)||(r=ep("NON_CONFORMING_NAMESPACES","".concat(n," namespaces chains don't satisfy required namespaces.\n Required: ").concat(o.toString(),"\n Approved: ").concat(a.toString()))),Object.keys(t).forEach(e=>{if(!e.includes(":")||r)return;const i=Kh(t[e].accounts);i.includes(e)||(r=ep("NON_CONFORMING_NAMESPACES","".concat(n," namespaces accounts don't satisfy namespace accounts for ").concat(e,"\n Required: ").concat(e,"\n Approved: ").concat(i.toString())))}),o.forEach(e=>{r||(Jo(i[e].methods,s[e].methods)?Jo(i[e].events,s[e].events)||(r=ep("NON_CONFORMING_NAMESPACES","".concat(n," namespaces events don't satisfy namespace events for ").concat(e))):r=ep("NON_CONFORMING_NAMESPACES","".concat(n," namespaces methods don't satisfy namespace methods for ").concat(e)))}),r}function wp(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function bp(){const e=Wo();return new Promise(t=>{switch(e){case Lo:t(function(){var e;return zo()&&(null===(e=navigator)||void 0===e?void 0:e.onLine)}());break;case Mo:t(async function(){if(Fo()&&typeof n.g<"u"&&null!=n.g&&n.g.NetInfo){const e=await(null==n.g?void 0:n.g.NetInfo.fetch());return null===e||void 0===e?void 0:e.isConnected}return!0}());break;default:t(!0)}})}function Ap(e){switch(Wo()){case Lo:!function(e){!Fo()&&zo()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}(e);break;case Mo:!function(e){var t;Fo()&&typeof n.g<"u"&&null!=n.g&&n.g.NetInfo&&(null===(t=n.g)||void 0===t||t.NetInfo.addEventListener(t=>e(null===t||void 0===t?void 0:t.isConnected)))}(e)}}const _p={};class xp{static get(e){return _p[e]}static set(e,t){_p[e]=t}static delete(e){delete _p[e]}}function Ep(e){let{publicKey:t,signature:n,payload:r}=e;var i;const s=kp(r.method),o=128|parseInt((null==(i=r.version)?void 0:i.toString())||"4"),a=function(e){const t=Ls.A.decode(e)[0];return 42===t?0:60===t?2:1}(r.address),c="00"===r.era?new Uint8Array([0]):kp(r.era);if(1!==c.length&&2!==c.length)throw new Error("Invalid era length");const l=parseInt(r.nonce,16),u=new Uint8Array([255&l,l>>8&255]),d=BigInt("0x".concat(function(e){return e.startsWith("0x")?e.slice(2):e}(r.tip))),h=function(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){const t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}if(e<BigInt(1)<<BigInt(30)){const t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}throw new Error("BigInt compact encoding not supported > 2^30")}(d),p=new Uint8Array([0,...t,a,...n,...c,...u,...h,...s]),f=function(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){const t=e<<2|1;return new Uint8Array([255&t,t>>8&255])}if(e<1<<30){const t=e<<2|2;return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}throw new Error("Compact encoding > 2^30 not supported")}(p.length+1);return new Uint8Array([...f,o,...p])}function kp(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function Sp(e){const t=Uint8Array.from(Buffer.from(e.signature,"hex")),n=function(e){const t=Ls.A.decode(e);if(t.length<33)throw new Error("Too short to contain a public key");return t.slice(1,33)}(e.transaction.address),r=Ep({publicKey:n,signature:t,payload:e.transaction});return function(e){const t=kp(e),n=(0,Ws.blake2b)(t,void 0,32);return"0x"+Buffer.from(n).toString("hex")}(Buffer.from(r).toString("hex"))}function Ip(e){let{logger:t,name:n}=e;const r="string"==typeof t?bo({opts:{level:t,name:n}}).logger:t;return r.level="string"==typeof t?t:t.level,r}var Tp=n(89557),Cp=n(30349),Pp=n(46455),Op=Object.defineProperty,Np=(e,t,n)=>((e,t,n)=>t in e?Op(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Rp extends Pp.H{constructor(e){super(),this.opts=e,Np(this,"protocol","wc"),Np(this,"version",2)}}var Mp=Object.defineProperty,Up=(e,t,n)=>((e,t,n)=>t in e?Mp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Lp extends Pp.H{constructor(e,t){super(),this.core=e,this.logger=t,Up(this,"records",new Map)}}class Bp{constructor(e,t){this.logger=e,this.core=t}}class Dp extends Pp.H{constructor(e,t){super(),this.relayer=e,this.logger=t}}class jp extends Pp.H{constructor(e){super()}}class Fp{constructor(e,t,n,r){this.core=e,this.logger=t,this.name=n}}Object.defineProperty;class zp extends Pp.H{constructor(e,t){super(),this.relayer=e,this.logger=t}}class Wp extends Pp.H{constructor(e,t){super(),this.core=e,this.logger=t}}class qp{constructor(e,t,n){this.core=e,this.logger=t,this.store=n}}class Hp{constructor(e,t){this.projectId=e,this.logger=t}}class Vp{constructor(e,t,n){this.core=e,this.logger=t,this.telemetryEnabled=n}}var Gp=Object.defineProperty,Kp=(e,t,n)=>((e,t,n)=>t in e?Gp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);bi();class Jp{constructor(e){this.opts=e,Kp(this,"protocol","wc"),Kp(this,"version",2)}}wi.EventEmitter;class Zp{constructor(e){this.client=e}}var Qp=n(19168),Yp=n(64655),Xp=n(8776);const $p="core",ef="".concat("wc","@2:").concat($p,":"),tf="error",nf={database:":memory:"},rf="client_ed25519_seed",sf=_i.ONE_DAY,of=_i.SIX_HOURS,af="wss://relay.walletconnect.org",cf="relayer_message",lf="relayer_message_ack",uf="relayer_connect",df="relayer_disconnect",hf="relayer_error",pf="relayer_connection_stalled",ff="relayer_publish",gf="payload",mf="connect",yf="disconnect",vf="error",wf="2.22.4",bf={link_mode:"link_mode",relay:"relay"},Af="inbound",_f="outbound",xf="WALLETCONNECT_LINK_MODE_APPS",Ef="subscription_created",kf="subscription_deleted",Sf="subscription_sync",If="subscription_resubscribed",Tf=(_i.FIVE_SECONDS,{wc_pairingDelete:{req:{ttl:_i.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:_i.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:_i.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:_i.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:_i.ONE_DAY,prompt:!1,tag:0},res:{ttl:_i.ONE_DAY,prompt:!1,tag:0}}}),Cf="pairing_create",Pf="pairing_expire",Of="pairing_delete",Nf="pairing_ping",Rf="history_created",Mf="history_updated",Uf="history_deleted",Lf="history_sync",Bf="expirer_created",Df="expirer_deleted",jf="expirer_expired",Ff="expirer_sync",zf="https://verify.walletconnect.org",Wf=zf,qf="".concat(Wf,"/v3"),Hf=["https://verify.walletconnect.com",zf],Vf="pairing_started",Gf="pairing_uri_validation_success",Kf="pairing_uri_not_expired",Jf="store_new_pairing",Zf="subscribing_pairing_topic",Qf="subscribe_pairing_topic_success",Yf="existing_pairing",Xf="pairing_not_expired",$f="emit_inactive_pairing",eg="emit_session_proposal",tg="no_internet_connection",ng="malformed_pairing_uri",rg="active_pairing_already_exists",ig="subscribe_pairing_topic_failure",sg="pairing_expired",og="proposal_listener_not_found",ag="session_approve_started",cg="session_namespaces_validation_success",lg="subscribing_session_topic",ug="subscribe_session_topic_success",dg="session_approve_publish_success",hg="store_session",pg="session_request_response_started",fg="session_request_response_validation_success",gg="session_request_response_publish_started",mg="no_internet_connection",yg="proposal_expired",vg="subscribe_session_topic_failure",wg="session_approve_namespace_validation_failure",bg="proposal_not_found",Ag="session_request_response_validation_failure",_g="session_request_response_publish_failure",xg="authenticated_session_approve_started",Eg="create_authenticated_session_topic",kg="cacaos_verified",Sg="store_authenticated_session",Ig="subscribing_authenticated_session_topic",Tg="subscribe_authenticated_session_topic_success",Cg="publishing_authenticated_session_approve",Pg="no_internet_connection",Og="invalid_cacao",Ng="subscribe_authenticated_session_topic_failure",Rg="authenticated_session_approve_publish_failure",Mg="authenticated_session_pending_request_not_found";var Ug=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(255!==n[o])throw new TypeError(s+" is ambiguous");n[o]=i}
2var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var s=(e.length-t)*l+1>>>0,o=new Uint8Array(s);e[t];){var u=n[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=s-1;(0!==u||d<i)&&-1!==h;h--,d++)u+=a*o[h]>>>0,o[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var p=s-i;p!==s&&0===o[p];)p++;for(var f=new Uint8Array(r+(s-p)),g=r;p!==s;)f[g++]=o[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,s=t.length;i!==s&&0===t[i];)i++,n++;for(var o=(s-i)*u+1>>>0,l=new Uint8Array(o);i!==s;){for(var d=t[i],h=0,p=o-1;(0!==d||h<r)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=o-r;f!==o&&0===l[f];)f++;for(var g=c.repeat(n);f<o;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:d,decode:function(e){var n=d(e);if(n)return n;throw new Error("Non-".concat(t," character"))}}},Lg=Ug;const Bg=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")};class Dg{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(e));throw Error("Unknown type, must be binary type")}}class jg{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(e),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix));return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return zg(this,e)}}class Fg{constructor(e){this.decoders=e}or(e){return zg(this,e)}decode(e){const t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(e),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}const zg=(e,t)=>new Fg((0,i.A)((0,i.A)({},e.decoders||{[e.prefix]:e}),t.decoders||{[t.prefix]:t}));class Wg{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new Dg(e,t,n),this.decoder=new jg(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const qg=e=>{let{name:t,prefix:n,encode:r,decode:i}=e;return new Wg(t,n,r,i)},Hg=e=>{let{prefix:t,name:n,alphabet:r}=e;const{encode:i,decode:s}=Lg(r,n);return qg({prefix:t,name:n,encode:i,decode:e=>Bg(s(e))})},Vg=e=>{let{name:t,prefix:n,bitsPerChar:r,alphabet:i}=e;return qg({prefix:n,name:t,encode:e=>((e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let s="",o=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],o+=8;o>n;)o-=n,s+=t[i&a>>o];if(o&&(s+=t[i&a<<n-o]),r)for(;s.length*n&7;)s+="=";return s})(e,i,r),decode:e=>((e,t,n,r)=>{const i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let s=e.length;for(;"="===e[s-1];)--s;const o=new Uint8Array(s*n/8|0);let a=0,c=0,l=0;for(let u=0;u<s;++u){const t=i[e[u]];if(void 0===t)throw new SyntaxError("Non-".concat(r," character"));c=c<<n|t,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o})(e,i,r,t)})},Gg=qg({prefix:"\0",name:"identity",encode:e=>(e=>(new TextDecoder).decode(e))(e),decode:e=>(e=>(new TextEncoder).encode(e))(e)});var Kg=Object.freeze({__proto__:null,identity:Gg});const Jg=Vg({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Zg=Object.freeze({__proto__:null,base2:Jg});const Qg=Vg({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Yg=Object.freeze({__proto__:null,base8:Qg});const Xg=Hg({prefix:"9",name:"base10",alphabet:"0123456789"});var $g=Object.freeze({__proto__:null,base10:Xg});const em=Vg({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),tm=Vg({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var nm=Object.freeze({__proto__:null,base16:em,base16upper:tm});const rm=Vg({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),im=Vg({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),sm=Vg({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),om=Vg({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),am=Vg({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),cm=Vg({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),lm=Vg({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),um=Vg({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),dm=Vg({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var hm=Object.freeze({__proto__:null,base32:rm,base32upper:im,base32pad:sm,base32padupper:om,base32hex:am,base32hexupper:cm,base32hexpad:lm,base32hexpadupper:um,base32z:dm});const pm=Hg({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),fm=Hg({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var gm=Object.freeze({__proto__:null,base36:pm,base36upper:fm});const mm=Hg({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ym=Hg({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var vm=Object.freeze({__proto__:null,base58btc:mm,base58flickr:ym});const wm=Vg({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2+/",bitsPerChar:6}),bm=Vg({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Am=Vg({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),_m=Vg({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var xm=Object.freeze({__proto__:null,base64:wm,base64pad:bm,base64url:Am,base64urlpad:_m});const Em=Array.from("\ud83d\ude80\ud83e\ude90\u2604\ud83d\udef0\ud83c\udf0c\ud83c\udf11\ud83c\udf12\ud83c\udf13\ud83c\udf14\ud83c\udf15\ud83c\udf16\ud83c\udf17\ud83c\udf18\ud83c\udf0d\ud83c\udf0f\ud83c\udf0e\ud83d\udc09\u2600\ud83d\udcbb\ud83d\udda5\ud83d\udcbe\ud83d\udcbf\ud83d\ude02\u2764\ud83d\ude0d\ud83e\udd23\ud83d\ude0a\ud83d\ude4f\ud83d\udc95\ud83d\ude2d\ud83d\ude18\ud83d\udc4d\ud83d\ude05\ud83d\udc4f\ud83d\ude01\ud83d\udd25\ud83e\udd70\ud83d\udc94\ud83d\udc96\ud83d\udc99\ud83d\ude22\ud83e\udd14\ud83d\ude06\ud83d\ude44\ud83d\udcaa\ud83d\ude09\u263a\ud83d\udc4c\ud83e\udd17\ud83d\udc9c\ud83d\ude14\ud83d\ude0e\ud83d\ude07\ud83c\udf39\ud83e\udd26\ud83c\udf89\ud83d\udc9e\u270c\u2728\ud83e\udd37\ud83d\ude31\ud83d\ude0c\ud83c\udf38\ud83d\ude4c\ud83d\ude0b\ud83d\udc97\ud83d\udc9a\ud83d\ude0f\ud83d\udc9b\ud83d\ude42\ud83d\udc93\ud83e\udd29\ud83d\ude04\ud83d\ude00\ud83d\udda4\ud83d\ude03\ud83d\udcaf\ud83d\ude48\ud83d\udc47\ud83c\udfb6\ud83d\ude12\ud83e\udd2d\u2763\ud83d\ude1c\ud83d\udc8b\ud83d\udc40\ud83d\ude2a\ud83d\ude11\ud83d\udca5\ud83d\ude4b\ud83d\ude1e\ud83d\ude29\ud83d\ude21\ud83e\udd2a\ud83d\udc4a\ud83e\udd73\ud83d\ude25\ud83e\udd24\ud83d\udc49\ud83d\udc83\ud83d\ude33\u270b\ud83d\ude1a\ud83d\ude1d\ud83d\ude34\ud83c\udf1f\ud83d\ude2c\ud83d\ude43\ud83c\udf40\ud83c\udf37\ud83d\ude3b\ud83d\ude13\u2b50\u2705\ud83e\udd7a\ud83c\udf08\ud83d\ude08\ud83e\udd18\ud83d\udca6\u2714\ud83d\ude23\ud83c\udfc3\ud83d\udc90\u2639\ud83c\udf8a\ud83d\udc98\ud83d\ude20\u261d\ud83d\ude15\ud83c\udf3a\ud83c\udf82\ud83c\udf3b\ud83d\ude10\ud83d\udd95\ud83d\udc9d\ud83d\ude4a\ud83d\ude39\ud83d\udde3\ud83d\udcab\ud83d\udc80\ud83d\udc51\ud83c\udfb5\ud83e\udd1e\ud83d\ude1b\ud83d\udd34\ud83d\ude24\ud83c\udf3c\ud83d\ude2b\u26bd\ud83e\udd19\u2615\ud83c\udfc6\ud83e\udd2b\ud83d\udc48\ud83d\ude2e\ud83d\ude46\ud83c\udf7b\ud83c\udf43\ud83d\udc36\ud83d\udc81\ud83d\ude32\ud83c\udf3f\ud83e\udde1\ud83c\udf81\u26a1\ud83c\udf1e\ud83c\udf88\u274c\u270a\ud83d\udc4b\ud83d\ude30\ud83e\udd28\ud83d\ude36\ud83e\udd1d\ud83d\udeb6\ud83d\udcb0\ud83c\udf53\ud83d\udca2\ud83e\udd1f\ud83d\ude41\ud83d\udea8\ud83d\udca8\ud83e\udd2c\u2708\ud83c\udf80\ud83c\udf7a\ud83e\udd13\ud83d\ude19\ud83d\udc9f\ud83c\udf31\ud83d\ude16\ud83d\udc76\ud83e\udd74\u25b6\u27a1\u2753\ud83d\udc8e\ud83d\udcb8\u2b07\ud83d\ude28\ud83c\udf1a\ud83e\udd8b\ud83d\ude37\ud83d\udd7a\u26a0\ud83d\ude45\ud83d\ude1f\ud83d\ude35\ud83d\udc4e\ud83e\udd32\ud83e\udd20\ud83e\udd27\ud83d\udccc\ud83d\udd35\ud83d\udc85\ud83e\uddd0\ud83d\udc3e\ud83c\udf52\ud83d\ude17\ud83e\udd11\ud83c\udf0a\ud83e\udd2f\ud83d\udc37\u260e\ud83d\udca7\ud83d\ude2f\ud83d\udc86\ud83d\udc46\ud83c\udfa4\ud83d\ude47\ud83c\udf51\u2744\ud83c\udf34\ud83d\udca3\ud83d\udc38\ud83d\udc8c\ud83d\udccd\ud83e\udd40\ud83e\udd22\ud83d\udc45\ud83d\udca1\ud83d\udca9\ud83d\udc50\ud83d\udcf8\ud83d\udc7b\ud83e\udd10\ud83e\udd2e\ud83c\udfbc\ud83e\udd75\ud83d\udea9\ud83c\udf4e\ud83c\udf4a\ud83d\udc7c\ud83d\udc8d\ud83d\udce3\ud83e\udd42"),km=Em.reduce((e,t,n)=>(e[n]=t,e),[]),Sm=Em.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);const Im=qg({prefix:"\ud83d\ude80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=km[t],"")},decode:function(e){const t=[];for(const n of e){const e=Sm[n.codePointAt(0)];if(void 0===e)throw new Error("Non-base256emoji character: ".concat(n));t.push(e)}return new Uint8Array(t)}});var Tm=Object.freeze({__proto__:null,base256emoji:Im}),Cm=function e(t,n,r){n=n||[];for(var i=r=r||0;t>=Nm;)n[r++]=255&t|Pm,t/=128;for(;t&Om;)n[r++]=255&t|Pm,t>>>=7;return n[r]=0|t,e.bytes=r-i+1,n},Pm=128,Om=-128,Nm=Math.pow(2,31);
2var Rm=function e(t,n){var r,i=0,s=0,o=n=n||0,a=t.length;do{if(o>=a)throw e.bytes=0,new RangeError("Could not decode varint");r=t[o++],i+=s<28?(r&Um)<<s:(r&Um)*Math.pow(2,s),s+=7}while(r>=Mm);return e.bytes=o-n,i},Mm=128,Um=127;var Lm=Math.pow(2,7),Bm=Math.pow(2,14),Dm=Math.pow(2,21),jm=Math.pow(2,28),Fm=Math.pow(2,35),zm=Math.pow(2,42),Wm=Math.pow(2,49),qm=Math.pow(2,56),Hm=Math.pow(2,63),Vm={encode:Cm,decode:Rm,encodingLength:function(e){return e<Lm?1:e<Bm?2:e<Dm?3:e<jm?4:e<Fm?5:e<zm?6:e<Wm?7:e<qm?8:e<Hm?9:10}},Gm=Vm;const Km=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Gm.encode(e,t,n),t},Jm=e=>Gm.encodingLength(e),Zm=(e,t)=>{const n=t.byteLength,r=Jm(e),i=r+Jm(n),s=new Uint8Array(i+n);return Km(e,s,0),Km(n,s,r),s.set(t,i),new Qm(e,n,t,s)};class Qm{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const Ym=e=>{let{name:t,code:n,encode:r}=e;return new Xm(t,n,r)};class Xm{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Zm(this.code,t):t.then(e=>Zm(this.code,e))}throw Error("Unknown type, must be binary type")}}const $m=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ey=Ym({name:"sha2-256",code:18,encode:$m("SHA-256")}),ty=Ym({name:"sha2-512",code:19,encode:$m("SHA-512")});var ny=Object.freeze({__proto__:null,sha256:ey,sha512:ty});const ry=Bg,iy={code:0,name:"identity",encode:ry,digest:e=>Zm(0,ry(e))};var sy=Object.freeze({__proto__:null,identity:iy});new TextEncoder,new TextDecoder;const oy=(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},Kg),Zg),Yg),$g),nm),hm),gm),vm),xm),Tm);function ay(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function cy(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}(0,i.A)((0,i.A)({},ny),sy);const ly=cy("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>(new TextEncoder).encode(e.substring(1))),uy=cy("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{const t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?ay(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),dy=(0,i.A)({utf8:ly,"utf-8":ly,hex:oy.base16,latin1:uy,ascii:uy,binary:uy},oy);var hy=Object.defineProperty,py=(e,t,n)=>((e,t,n)=>t in e?hy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class fy{constructor(e,t){this.core=e,this.logger=t,py(this,"keychain",new Map),py(this,"name","keychain"),py(this,"version","0.3"),py(this,"initialized",!1),py(this,"storagePrefix",ef),py(this,"init",async()=>{if(!this.initialized){const e=await this.getKeyChain();typeof e<"u"&&(this.keychain=e),this.initialized=!0}}),py(this,"has",e=>(this.isInitialized(),this.keychain.has(e))),py(this,"set",async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()}),py(this,"get",e=>{this.isInitialized();const t=this.keychain.get(e);if(typeof t>"u"){const{message:t}=ep("NO_MATCHING_KEY","".concat(this.name,": ").concat(e));throw new Error(t)}return t}),py(this,"del",async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()}),this.core=e,this.logger=wo(t,this.name)}get context(){return vo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Zo(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Qo(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}}var gy=Object.defineProperty,my=(e,t,n)=>((e,t,n)=>t in e?gy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class yy{constructor(e,t,n){this.core=e,this.logger=t,my(this,"name","crypto"),my(this,"keychain"),my(this,"randomSessionIdentifier",uh()),my(this,"initialized",!1),my(this,"clientId"),my(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),my(this,"hasKeys",e=>(this.isInitialized(),this.keychain.has(e))),my(this,"getClientId",async()=>
2{if(this.isInitialized(),this.clientId)return this.clientId;const e=await this.getClientSeed(),t=js.TZ(e),n=js.UF(t.publicKey);return this.clientId=n,n}),my(this,"generateKeyPair",()=>{this.isInitialized();const e=function(){const e=Od.utils.randomPrivateKey(),t=Od.getPublicKey(e);return{privateKey:(0,Fs.dI)(e,oh),publicKey:(0,Fs.dI)(t,oh)}}();return this.setPrivateKey(e.publicKey,e.privateKey)}),my(this,"signJWT",async e=>{this.isInitialized();const t=await this.getClientSeed(),n=js.TZ(t),r=this.randomSessionIdentifier,i=sf;return await js.FA(r,e,i,n)}),my(this,"generateSharedKey",(e,t,n)=>{this.isInitialized();const r=function(e,t){const n=Od.getSharedSecret((0,Fs.sH)(e,oh),(0,Fs.sH)(t,oh)),r=gu(mu,n,void 0,void 0,32);return(0,Fs.dI)(r,oh)}(this.getPrivateKey(e),t);return this.setSymKey(r,n)}),my(this,"setSymKey",async(e,t)=>{this.isInitialized();const n=t||dh(e);return await this.keychain.set(n,e),n}),my(this,"deleteKeyPair",async e=>{this.isInitialized(),await this.keychain.del(e)}),my(this,"deleteSymKey",async e=>{this.isInitialized(),await this.keychain.del(e)}),my(this,"encode",async(e,t,n)=>{this.isInitialized();const r=wh(n),i=(0,Vs.h)(t);if(Ah(r))return function(e,t){const n=ph(2),r=ac(12),i=yh({type:n,sealed:(0,Fs.sH)(e,lh),iv:r});return t===ch?gh(i):i}(i,null===n||void 0===n?void 0:n.encoding);if(bh(r)){const t=r.senderPublicKey,n=r.receiverPublicKey;e=await this.generateSharedKey(t,n)}const s=this.getSymKey(e),{type:o,senderPublicKey:a}=r;return function(e){const t=ph(typeof e.type<"u"?e.type:0);if(1===fh(t)&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const n=typeof e.senderPublicKey<"u"?(0,Fs.sH)(e.senderPublicKey,oh):void 0,r=typeof e.iv<"u"?(0,Fs.sH)(e.iv,oh):ac(12),i=(0,Fs.sH)(e.symKey,oh),s=yh({type:t,sealed:uu(i,r).encrypt((0,Fs.sH)(e.message,lh)),iv:r,senderPublicKey:n});return e.encoding===ch?gh(s):s}({type:o,symKey:s,message:i,senderPublicKey:a,encoding:null===n||void 0===n?void 0:n.encoding})}),my(this,"decode",async(e,t,n)=>{this.isInitialized();const r=function(e,t){const n=vh({encoded:e,encoding:null===t||void 0===t?void 0:t.encoding});return wh({type:fh(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?(0,Fs.dI)(n.senderPublicKey,oh):void 0,receiverPublicKey:null===t||void 0===t?void 0:t.receiverPublicKey})}(t,n);if(Ah(r)){const e=function(e,t){const{sealed:n}=vh({encoded:e,encoding:t});return(0,Fs.dI)(n,lh)}(t,null===n||void 0===n?void 0:n.encoding);return(0,Vs.j)(e)}if(bh(r)){const t=r.receiverPublicKey,n=r.senderPublicKey;e=await this.generateSharedKey(t,n)}try{const r=function(e){const t=(0,Fs.sH)(e.symKey,oh),{sealed:n,iv:r}=vh({encoded:e.encoded,encoding:e.encoding}),i=uu(t,r).decrypt(n);if(null===i)throw new Error("Failed to decrypt");return(0,Fs.dI)(i,lh)}({symKey:this.getSymKey(e),encoded:t,encoding:null===n||void 0===n?void 0:n.encoding});return(0,Vs.j)(r)}catch(i){this.logger.error("Failed to decode message from topic: '".concat(e,"', clientId: '").concat(await this.getClientId(),"'")),this.logger.error(i)}}),my(this,"getPayloadType",function(e){return fh(vh({encoded:e,encoding:arguments.length>1&&void 0!==arguments[1]?arguments[1]:ah}).type)}),my(this,"getPayloadSenderPublicKey",function(e){const t=vh({encoded:e,encoding:arguments.length>1&&void 0!==arguments[1]?arguments[1]:ah});return t.senderPublicKey?(0,Fs.dI)(t.senderPublicKey,oh):void 0}),this.core=e,this.logger=wo(t,this.name),this.keychain=n||new fy(this.core,this.logger)}get context(){return vo(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(rf)}catch(t){e=uh(),await this.keychain.set(rf,e)}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const n=dy[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode("".concat(n.prefix).concat(e)):ay(globalThis.Buffer.from(e,"utf-8"))}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}}var vy=Object.defineProperty,wy=Object.defineProperties,by=Object.getOwnPropertyDescriptors,Ay=Object.getOwnPropertySymbols,_y=Object.prototype.hasOwnProperty,xy=Object.prototype.propertyIsEnumerable,Ey=(e,t,n)=>t in e?vy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ky=(e,t,n)=>Ey(e,"symbol"!=typeof t?t+"":t,n);class Sy extends Bp{constructor(e,t){super(e,t),this.logger=e,this.core=t,ky(this,"messages",new Map),ky(this,"messagesWithoutClientAck",new Map),ky(this,"name","messages"),ky(this,"version","0.3"),ky(this,"initialized",!1),ky(this,"storagePrefix",ef),ky(this,"init",async()=>
2{if(!this.initialized){this.logger.trace("Initialized");try{const e=await this.getRelayerMessages();typeof e<"u"&&(this.messages=e);const t=await this.getRelayerMessagesWithoutClientAck();typeof t<"u"&&(this.messagesWithoutClientAck=t),this.logger.debug("Successfully Restored records for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug("Failed to Restore records for ".concat(this.name)),this.logger.error(e)}finally{this.initialized=!0}}}),ky(this,"set",async(e,t,n)=>{this.isInitialized();const r=hh(t);let i=this.messages.get(e);if(typeof i>"u"&&(i={}),typeof i[r]<"u")return r;if(i[r]=t,this.messages.set(e,i),n===Af){const n=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,((e,t)=>wy(e,by(t)))(((e,t)=>{for(var n in t||(t={}))_y.call(t,n)&&Ey(e,n,t[n]);if(Ay)for(var n of Ay(t))xy.call(t,n)&&Ey(e,n,t[n]);return e})({},n),{[r]:t}))}return await this.persist(),r}),ky(this,"get",e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t}),ky(this,"getWithoutAck",e=>{this.isInitialized();const t={};for(const n of e){const e=this.messagesWithoutClientAck.get(n)||{};t[n]=Object.values(e)}return t}),ky(this,"has",(e,t)=>{this.isInitialized();return typeof this.get(e)[hh(t)]<"u"}),ky(this,"ack",async(e,t)=>{this.isInitialized();const n=this.messagesWithoutClientAck.get(e);if(typeof n>"u")return;delete n[hh(t)],0===Object.keys(n).length?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,n),await this.persist()}),ky(this,"del",async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()}),this.logger=wo(e,this.name),this.core=t}get context(){return vo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Zo(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,Zo(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Qo(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?Qo(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Iy=Object.defineProperty,Ty=Object.defineProperties,Cy=Object.getOwnPropertyDescriptors,Py=Object.getOwnPropertySymbols,Oy=Object.prototype.hasOwnProperty,Ny=Object.prototype.propertyIsEnumerable,Ry=(e,t,n)=>t in e?Iy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,My=(e,t)=>{for(var n in t||(t={}))Oy.call(t,n)&&Ry(e,n,t[n]);if(Py)for(var n of Py(t))Ny.call(t,n)&&Ry(e,n,t[n]);return e},Uy=(e,t)=>Ty(e,Cy(t)),Ly=(e,t,n)=>Ry(e,"symbol"!=typeof t?t+"":t,n);class By extends Dp{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,Ly(this,"events",new wi.EventEmitter),Ly(this,"name","publisher"),Ly(this,"queue",new Map),Ly(this,"publishTimeout",(0,_i.toMiliseconds)(_i.ONE_MINUTE)),Ly(this,"initialPublishTimeout",(0,_i.toMiliseconds)(15*_i.ONE_SECOND)),Ly(this,"needsTransportRestart",!1),Ly(this,"publish",async(e,t,n)=>{var r,i,s,o,a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:n}});const c=(null===n||void 0===n?void 0:n.ttl)||of,l=(null===n||void 0===n?void 0:n.prompt)||!1,u=(null===n||void 0===n?void 0:n.tag)||0,d=(null===n||void 0===n?void 0:n.id)||(0,Yp.getBigIntRpcId)().toString(),h=Eh(xh().protocol),p={id:d,method:(null===n||void 0===n?void 0:n.publishMethod)||h.publish,params:My({topic:e,message:t,ttl:c,prompt:l,tag:u,attestation:null===n||void 0===n?void 0:n.attestation},null===n||void 0===n?void 0:n.tvf)},f="Failed to publish payload, please try again. id:".concat(d," tag:").concat(u);try{ip(null==(r=p.params)?void 0:r.prompt)&&(null==(i=p.params)||delete i.prompt),ip(null==(s=p.params)?void 0:s.tag)&&(null==(o=p.params)||delete o.tag);const a=new Promise(async e=>{const t=n=>{let{id:r}=n;var i;(null==(i=p.id)?void 0:i.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(ff,t),e())};this.relayer.events.on(ff,t);const r=Xo(new Promise((e,t)=>
2{this.rpcPublish(p,n).then(e).catch(e=>{this.logger.warn(e,null===e||void 0===e?void 0:e.message),t(e)})}),this.initialPublishTimeout,"Failed initial publish, retrying.... id:".concat(d," tag:").concat(u));try{await r,this.events.removeListener(ff,t)}catch(i){this.queue.set(d,{request:p,opts:n,attempt:1}),this.logger.warn(i,null===i||void 0===i?void 0:i.message)}});this.logger.trace({type:"method",method:"publish",params:{id:d,topic:e,message:t,opts:n}}),await Xo(a,this.publishTimeout,f)}catch(g){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(g),null!=(a=null===n||void 0===n?void 0:n.internal)&&a.throwOnFailedPublish)throw g}finally{this.queue.delete(d)}}),Ly(this,"publishCustom",async e=>{var t,n,r,i,s;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:e});const{payload:o,opts:a={}}=e,{attestation:c,tvf:l,publishMethod:u,prompt:d,tag:h,ttl:p=_i.FIVE_MINUTES}=a,f=a.id||(0,Yp.getBigIntRpcId)().toString(),g=Eh(xh().protocol),m=u||g.publish,y={id:f,method:m,params:My(Uy(My({},o),{ttl:p,prompt:d,tag:h,attestation:c}),l)},v="Failed to publish custom payload, please try again. id:".concat(f," tag:").concat(h);try{ip(null==(t=y.params)?void 0:t.prompt)&&(null==(n=y.params)||delete n.prompt),ip(null==(r=y.params)?void 0:r.tag)&&(null==(i=y.params)||delete i.tag);const e=new Promise(async e=>{const t=n=>{let{id:r}=n;var i;(null==(i=y.id)?void 0:i.toString())===r.toString()&&(this.removeRequestFromQueue(r),this.relayer.events.removeListener(ff,t),e())};this.relayer.events.on(ff,t);const n=Xo(new Promise((e,t)=>{this.rpcPublish(y,a).then(e).catch(e=>{this.logger.warn(e,null===e||void 0===e?void 0:e.message),t(e)})}),this.initialPublishTimeout,"Failed initial custom payload publish, retrying.... method:".concat(m," id:").concat(f," tag:").concat(h));try{await n,this.events.removeListener(ff,t)}catch(Ww){this.queue.set(f,{request:y,opts:a,attempt:1}),this.logger.warn(Ww,null===Ww||void 0===Ww?void 0:Ww.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,payload:o,opts:a}}),await Xo(e,this.publishTimeout,v)}catch(w){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(w),null!=(s=null===a||void 0===a?void 0:a.internal)&&s.throwOnFailedPublish)throw w}finally{this.queue.delete(f)}}),Ly(this,"on",(e,t)=>{this.events.on(e,t)}),Ly(this,"once",(e,t)=>{this.events.once(e,t)}),Ly(this,"off",(e,t)=>{this.events.off(e,t)}),Ly(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.relayer=e,this.logger=wo(t,this.name),this.registerEventListeners()}get context(){return vo(this.logger)}async rpcPublish(e,t){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});const n=await this.relayer.request(e);return this.relayer.events.emit(ff,My(My({},e),t)),this.logger.debug("Successfully Published Payload"),n}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{var n;const r=e.attempt+1;this.queue.set(t,Uy(My({},e),{attempt:r})),this.logger.warn({},"Publisher: queue->publishing: ".concat(e.request.id,", tag: ").concat(null==(n=e.request.params)?void 0:n.tag,", attempt: ").concat(r)),await this.rpcPublish(e.request,e.opts),this.logger.warn({},"Publisher: queue->published: ".concat(e.request.id))})}registerEventListeners(){this.relayer.core.heartbeat.on(Tp.li.pulse,()=>{if(this.needsTransportRestart)return this.needsTransportRestart=!1,void this.relayer.events.emit(pf);this.checkQueue()}),this.relayer.on(lf,e=>{this.removeRequestFromQueue(e.id.toString())})}}var Dy=Object.defineProperty,jy=(e,t,n)=>((e,t,n)=>t in e?Dy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Fy{constructor(){jy(this,"map",new Map),jy(this,"set",(e,t)=>{const n=this.get(e);this.exists(e,t)||this.map.set(e,[...n,t])}),jy(this,"get",e=>this.map.get(e)||[]),jy(this,"exists",(e,t)=>this.get(e).includes(t)),jy(this,"delete",(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,t))return;const r=n.filter(e=>e!==t);r.length?this.map.set(e,r):this.map.delete(e)}),jy(this,"clear",()=>{this.map.clear()})}
2get topics(){return Array.from(this.map.keys())}}var zy=Object.defineProperty,Wy=Object.defineProperties,qy=Object.getOwnPropertyDescriptors,Hy=Object.getOwnPropertySymbols,Vy=Object.prototype.hasOwnProperty,Gy=Object.prototype.propertyIsEnumerable,Ky=(e,t,n)=>t in e?zy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jy=(e,t)=>{for(var n in t||(t={}))Vy.call(t,n)&&Ky(e,n,t[n]);if(Hy)for(var n of Hy(t))Gy.call(t,n)&&Ky(e,n,t[n]);return e},Zy=(e,t)=>Wy(e,qy(t)),Qy=(e,t,n)=>Ky(e,"symbol"!=typeof t?t+"":t,n);class Yy extends zp{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,Qy(this,"subscriptions",new Map),Qy(this,"topicMap",new Fy),Qy(this,"events",new wi.EventEmitter),Qy(this,"name","subscription"),Qy(this,"version","0.3"),Qy(this,"pending",new Map),Qy(this,"cached",[]),Qy(this,"initialized",!1),Qy(this,"storagePrefix",ef),Qy(this,"subscribeTimeout",(0,_i.toMiliseconds)(_i.ONE_MINUTE)),Qy(this,"initialSubscribeTimeout",(0,_i.toMiliseconds)(15*_i.ONE_SECOND)),Qy(this,"clientId"),Qy(this,"batchSubscribeTopicsLimit",500),Qy(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),Qy(this,"subscribe",async(e,t)=>{var n;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{const r=xh(t),i={topic:e,relay:r,transportType:null===t||void 0===t?void 0:t.transportType};null!=(n=null===t||void 0===t?void 0:t.internal)&&n.skipSubscribe||this.pending.set(e,i);const s=await this.rpcSubscribe(e,r,t);return"string"==typeof s&&(this.onSubscribe(s,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),s}catch(r){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(r),r}}),Qy(this,"unsubscribe",async(e,t)=>{this.isInitialized(),typeof(null===t||void 0===t?void 0:t.id)<"u"?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)}),Qy(this,"isSubscribed",e=>new Promise(t=>{t(this.topicMap.topics.includes(e))})),Qy(this,"isKnownTopic",e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))})),Qy(this,"on",(e,t)=>{this.events.on(e,t)}),Qy(this,"once",(e,t)=>{this.events.once(e,t)}),Qy(this,"off",(e,t)=>{this.events.off(e,t)}),Qy(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),Qy(this,"start",async()=>{await this.onConnect()}),Qy(this,"stop",async()=>{await this.onDisconnect()}),Qy(this,"restart",async()=>{await this.restore(),await this.onRestart()}),Qy(this,"checkPending",async()=>{if(0===this.pending.size&&(!this.initialized||!this.relayer.connected))return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}),Qy(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(Tp.li.pulse,async()=>{await this.checkPending()}),this.events.on(Ef,async e=>{const t=Ef;this.logger.info("Emitting ".concat(t)),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(kf,async e=>{const t=kf;this.logger.info("Emitting ".concat(t)),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}),this.relayer=e,this.logger=wo(t,this.name),this.clientId=""}get context(){return vo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let n=!1;try{n=this.getSubscription(e).topic===t}catch(r){}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const n=this.topicMap.get(e);await Promise.all(n.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}});try{const r=xh(n);await this.restartToComplete({topic:e,id:t,relay:r}),await this.rpcUnsubscribe(e,t,r);const i=tp("USER_DISCONNECTED","".concat(this.name,", ").concat(e));await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:n}})}catch(r){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(r),r}}async rpcSubscribe(e,t,n){var r,i;
2const s=await this.getSubscriptionId(e);if(null!=(r=null===n||void 0===n?void 0:n.internal)&&r.skipSubscribe)return s;(!n||(null===n||void 0===n?void 0:n.transportType)===bf.relay)&&await this.restartToComplete({topic:e,id:e,relay:t});const o={method:Eh(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o});const a=null==(i=null===n||void 0===n?void 0:n.internal)?void 0:i.throwOnFailedPublish;try{if((null===n||void 0===n?void 0:n.transportType)===bf.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(o).catch(e=>this.logger.warn(e))},(0,_i.toMiliseconds)(_i.ONE_SECOND)),s;const t=new Promise(async t=>{const n=r=>{r.topic===e&&(this.events.removeListener(Ef,n),t(r.id))};this.events.on(Ef,n);try{const r=await Xo(new Promise((e,t)=>{this.relayer.request(o).catch(e=>{this.logger.warn(e,null===e||void 0===e?void 0:e.message),t(e)}).then(e)}),this.initialSubscribeTimeout,"Subscribing to ".concat(e," failed, please try again"));this.events.removeListener(Ef,n),t(r)}catch(r){}}),r=await Xo(t,this.subscribeTimeout,"Subscribing to ".concat(e," failed, please try again"));if(!r&&a)throw new Error("Subscribing to ".concat(e," failed, please try again"));return r?s:null}catch(c){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(pf),a)throw c}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t={method:Eh(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{await await Xo(new Promise(e=>{this.relayer.request(t).catch(e=>this.logger.warn(e)).then(e)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch(n){this.relayer.events.emit(pf)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t={method:Eh(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};let n;this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{n=await await Xo(new Promise((e,n)=>{this.relayer.request(t).catch(e=>{this.logger.warn(e),n(e)}).then(e)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch(r){this.relayer.events.emit(pf)}return n}rpcUnsubscribe(e,t,n){const r={method:Eh(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,Zy(Jy({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,Jy({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,n){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,Jy({},t)),this.topicMap.set(t.topic,e),this.events.emit(Ef,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:t}=ep("NO_MATCHING_KEY","".concat(this.name,": ").concat(e));throw new Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(kf,Zy(Jy({},n),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Sf)}
2async onRestart(){if(this.cached.length){const e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<t;n++){const t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(If)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(e=>{var t;return e.topic===(null==(t=this.subscriptions.get(e.id))?void 0:t.topic)})){const{message:e}=ep("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error("".concat(this.name,": ").concat(JSON.stringify(this.values))),new Error(e)}this.cached=e,this.logger.debug("Successfully Restored subscriptions for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(Qe){this.logger.debug("Failed to Restore subscriptions for ".concat(this.name)),this.logger.error(Qe)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async e=>Zy(Jy({}
2,e),{id:await this.getSubscriptionId(e.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace("Fetching batch messages for ".concat(e.length," subscriptions"));const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await function(e){return new Promise(t=>setTimeout(t,e))}((0,_i.toMiliseconds)(_i.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return hh(e+await this.getClientId())}}var Xy=Object.defineProperty,$y=Object.getOwnPropertySymbols,ev=Object.prototype.hasOwnProperty,tv=Object.prototype.propertyIsEnumerable,nv=(e,t,n)=>t in e?Xy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rv=(e,t)=>{for(var n in t||(t={}))ev.call(t,n)&&nv(e,n,t[n]);if($y)for(var n of $y(t))tv.call(t,n)&&nv(e,n,t[n]);return e},iv=(e,t,n)=>nv(e,"symbol"!=typeof t?t+"":t,n);class sv extends jp{constructor(e){var t;super(e),iv(this,"protocol","wc"),iv(this,"version",2),iv(this,"core"),iv(this,"logger"),iv(this,"events",new wi.EventEmitter),iv(this,"provider"),iv(this,"messages"),iv(this,"subscriber"),iv(this,"publisher"),iv(this,"name","relayer"),iv(this,"transportExplicitlyClosed",!1),iv(this,"initialized",!1),iv(this,"connectionAttemptInProgress",!1),iv(this,"relayUrl"),iv(this,"projectId"),iv(this,"packageName"),iv(this,"bundleId"),iv(this,"hasExperiencedNetworkDisruption",!1),iv(this,"pingTimeout"),iv(this,"heartBeatTimeout",(0,_i.toMiliseconds)(_i.THIRTY_SECONDS+_i.FIVE_SECONDS)),iv(this,"reconnectTimeout"),iv(this,"connectPromise"),iv(this,"reconnectInProgress",!1),iv(this,"requestsInFlight",[]),iv(this,"connectTimeout",(0,_i.toMiliseconds)(15*_i.ONE_SECOND)),iv(this,"request",async e=>{var t,n;this.logger.debug("Publishing Request Payload");const r=e.id||(0,Yp.getBigIntRpcId)().toString();await this.toEstablishConnection();try{this.logger.trace({id:r,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - publishing...");const i="".concat(r,":").concat((null==(n=e.params)?void 0:n.tag)||"");this.requestsInFlight.push(i);const s=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==i),s}catch(i){throw this.logger.debug("Failed to Publish Request: ".concat(r)),i}}),iv(this,"resetPingTimeout",()=>{jo()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,n,r;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),null==(r=null==(n=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:n.terminate)||r.call(n)}catch(i){this.logger.warn(i,null===i||void 0===i?void 0:i.message)}},this.heartBeatTimeout))}),iv(this,"onPayloadHandler",e=>{this.onProviderPayload(e),this.resetPingTimeout()}),iv(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected \ud83d\udedc"),this.startPingTimeout(),this.events.emit(uf)}),iv(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected \ud83d\uded1"),this.requestsInFlight=[],this.onProviderDisconnect()}),iv(this,"onProviderErrorHandler",e=>{this.logger.fatal("Fatal socket error: ".concat(e.message)),this.events.emit(hf,e),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),iv(this,"registerProviderListeners",()=>{this.provider.on(gf,this.onPayloadHandler),this.provider.on(mf,this.onConnectHandler),this.provider.on(yf,this.onDisconnectHandler),this.provider.on(vf,this.onProviderErrorHandler)}),this.core=e.core,this.logger=Ip({logger:null!=(t=e.logger)?t:"error",name:this.name}),this.messages=new Sy(this.logger,e.core),this.subscriber=new Yy(this,this.logger),this.publisher=new By(this,this.logger),this.projectId=null===e||void 0===e?void 0:e.projectId,this.relayUrl=(null===e||void 0===e?void 0:e.relayUrl)||af,Fo()&&typeof n.g<"u"&&typeof(null==n.g?void 0:n.g.Platform)<"u"&&"android"===(null==n.g?void 0:n.g.Platform.OS)?this.packageName=qo():Fo()&&typeof n.g<"u"&&typeof(null==n.g?void 0:n.g.Platform)<"u"&&"ios"===(null==n.g?void 0:n.g.Platform.OS)&&(this.bundleId=qo()),this.provider={}}
2async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,null===e||void 0===e?void 0:e.message))}get context(){return vo(this.logger)}get connected(){var e,t,n;return 1===(null==(n=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:n.readyState)||!1}get connecting(){var e,t,n;return 0===(null==(n=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:n.readyState)||void 0!==this.connectPromise||!1}async publish(e,t,n){this.isInitialized(),await this.publisher.publish(e,t,n),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:bf.relay},_f)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){var n,r,i;this.isInitialized(),(null==t||!t.transportType||"relay"===(null===t||void 0===t?void 0:t.transportType))&&await this.toEstablishConnection();const s=typeof(null==(n=null===t||void 0===t?void 0:t.internal)?void 0:n.throwOnFailedPublish)>"u"||(null==(r=null===t||void 0===t?void 0:t.internal)?void 0:r.throwOnFailedPublish);let o,a=(null==(i=this.subscriber.topicMap.get(e))?void 0:i[0])||"";const c=t=>{t.topic===e&&(this.subscriber.off(Ef,c),o())};return await Promise.all([new Promise(e=>{o=e,this.subscriber.on(Ef,c)}),new Promise(async(n,r)=>{a=await this.subscriber.subscribe(e,rv({internal:{throwOnFailedPublish:s}},t)).catch(e=>{s&&r(e)})||a,n()})]),a}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Xo(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(this.subscriber.hasAnyTopics){if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(t,n)=>{await this.connect(e).then(t).catch(n).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error("Couldn't establish socket connection to the relay server: ".concat(this.relayUrl))}else this.logger.info("Starting WS connection skipped because the client has no topics to work with.")}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await bp())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(0===(null===e||void 0===e?void 0:e.length))return void this.logger.trace("Batch message events is empty. Ignoring...");const t=e.sort((e,t)=>e.publishedAt-t.publishedAt);this.logger.debug("Batch of ".concat(t.length," message events sorted"));for(const r of t)try{await this.onMessageEvent(r)}catch(n){this.logger.warn(n,"Error while processing batch message event: "+(null===n||void 0===n?void 0:n.message))}this.logger.trace("Batch of ".concat(t.length," message events processed"))}async onLinkMessageEvent(e,t){const{topic:n}=e;if(!t.sessionExists){const e={topic:n,expiry:ta(_i.FIVE_MINUTES),relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,e)}this.events.emit(cf,e),await this.recordMessageEvent(e,Af)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},"Connecting to ".concat(this.relayUrl,", attempt: ").concat(t,"...")),await this.createProvider(),await new Promise(async(e,t)=>{const n=()=>
2{t(new Error("Connection interrupted while trying to connect"))};this.provider.once(yf,n),await Xo(new Promise((e,t)=>{this.provider.connect().then(e).catch(t)}),this.connectTimeout,"Socket stalled when trying to connect to ".concat(this.relayUrl)).catch(e=>{t(e)}).finally(()=>{this.provider.off(yf,n),clearTimeout(this.reconnectTimeout)}),await new Promise(async(e,n)=>{const r=()=>{t(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(yf,r),await this.subscriber.start().then(e).catch(n).finally(()=>{this.provider.off(yf,r)})}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(n){await this.subscriber.stop();const e=n;this.logger.warn({},e.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},"Connected to ".concat(this.relayUrl," successfully on attempt: ").concat(t));break}await new Promise(e=>setTimeout(e,(0,_i.toMiliseconds)(1*t))),t++}}startPingTimeout(){var e,t,n,r,i;if(jo())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(i=null==(r=null==(n=this.provider)?void 0:n.connection)?void 0:r.socket)||i.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(s){this.logger.warn(s,null===s||void 0===s?void 0:s.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Qp.F(new Xp.A(Ko({sdkVersion:wf,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){const{topic:n,message:r}=e;await this.messages.set(n,r,t)}async shouldIgnoreMessageEvent(e){const{topic:t,message:n}=e;if(!n||0===n.length)return this.logger.warn("Ignoring invalid/empty message: ".concat(n)),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn("Ignoring message for unknown topic ".concat(t)),!0;const r=this.messages.has(t,n);return r&&this.logger.warn("Ignoring duplicate message: ".concat(n)),r}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),(0,Yp.isJsonRpcRequest)(e)){if(!e.method.endsWith("_subscription"))return;const t=e.params,{topic:n,message:r,publishedAt:i,attestation:s}=t.data,o={topic:n,message:r,publishedAt:i,transportType:bf.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(rv({type:"event",event:t.id},o)),this.events.emit(t.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else(0,Yp.isJsonRpcResponse)(e)&&this.events.emit(lf,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,Af),this.events.emit(cf,e))}async acknowledgePayload(e){const t=(0,Yp.formatJsonRpcResult)(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(gf,this.onPayloadHandler),this.provider.off(mf,this.onConnectHandler),this.provider.off(yf,this.onDisconnectHandler),this.provider.off(vf,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await bp();Ap(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,null===e||void 0===e?void 0:e.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(Tp.li.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&function(){var e;return!zo()||!(0,xi.getDocument)()||"visible"===(null==(e=(0,xi.getDocument)())?void 0:e.visibilityState)}())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,null===e||void 0===e?void 0:e.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(df),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,null===e||void 0===e?void 0:e.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,_i.toMiliseconds)(.1)))))}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise)return void await this.connectPromise;await this.connect()}}}function ov(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}
2function av(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const cv="[object Arguments]",lv="[object Object]";function uv(){}function dv(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function hv(e,t,n,r,i,s,o){const a=o(e,t,n,r,i,s);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t);case"object":return pv(e,t,s,o)}return pv(e,t,s,o)}function pv(e,t,n,r){if(Object.is(e,t))return!0;let i=av(e),s=av(t);if(i===cv&&(i=lv),s===cv&&(s=lv),i!==s)return!1;switch(i){case"[object String]":return e.toString()===t.toString();case"[object Number]":return function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}(e.valueOf(),t.valueOf());case"[object Boolean]":case"[object Date]":case"[object Symbol]":return Object.is(e.valueOf(),t.valueOf());case"[object RegExp]":return e.source===t.source&&e.flags===t.flags;case"[object Function]":return e===t}const o=(n=null!==n&&void 0!==n?n:new Map).get(e),a=n.get(t);if(null!=o&&null!=a)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case"[object Map]":if(e.size!==t.size)return!1;for(const[i,s]of e.entries())if(!t.has(i)||!hv(s,t.get(i),i,e,t,n,r))return!1;return!0;case"[object Set]":{if(e.size!==t.size)return!1;const i=Array.from(e.values()),s=Array.from(t.values());for(let o=0;o<i.length;o++){const a=i[o],c=s.findIndex(i=>hv(a,i,void 0,e,t,n,r));if(-1===c)return!1;s.splice(c,1)}return!0}case"[object Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":case"[object BigUint64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object BigInt64Array]":case"[object Float32Array]":case"[object Float64Array]":if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!hv(e[i],t[i],i,e,t,n,r))return!1;return!0;case"[object ArrayBuffer]":return e.byteLength===t.byteLength&&pv(new Uint8Array(e),new Uint8Array(t),n,r);case"[object DataView]":return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&pv(new Uint8Array(e),new Uint8Array(t),n,r);case"[object Error]":return e.name===t.name&&e.message===t.message;case lv:{if(!(pv(e.constructor,t.constructor,n,r)||dv(e)&&dv(t)))return!1;const i=[...Object.keys(e),...ov(e)],s=[...Object.keys(t),...ov(t)];if(i.length!==s.length)return!1;for(let o=0;o<i.length;o++){const s=i[o],a=e[s];if(!Object.hasOwn(t,s))return!1;if(!hv(a,t[s],s,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function fv(e,t){return function(e,t,n){return hv(e,t,void 0,void 0,void 0,void 0,n)}(e,t,uv)}var gv=Object.defineProperty,mv=Object.getOwnPropertySymbols,yv=Object.prototype.hasOwnProperty,vv=Object.prototype.propertyIsEnumerable,wv=(e,t,n)=>t in e?gv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bv=(e,t)=>{for(var n in t||(t={}))yv.call(t,n)&&wv(e,n,t[n]);if(mv)for(var n of mv(t))vv.call(t,n)&&wv(e,n,t[n]);return e},Av=(e,t,n)=>wv(e,"symbol"!=typeof t?t+"":t,n);class _v extends Fp{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ef,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;super(e,t,n,r),this.core=e,this.logger=t,this.name=n,Av(this,"map",new Map),Av(this,"version","0.3"),Av(this,"cached",[]),Av(this,"initialized",!1),Av(this,"getKey"),Av(this,"storagePrefix",ef),Av(this,"recentlyDeleted",[]),Av(this,"recentlyDeletedLimit",200),Av(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!ip(e)?this.map.set(this.getKey(e),e):function(e){var t;return null==(t=null===e||void 0===e?void 0:e.proposer)?void 0:t.publicKey}(e)?this.map.set(e.id,e):function(e){return null===e||void 0===e?void 0:e.topic}(e)&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)}),Av(this,"set",async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())}),Av(this,"get",e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e))),Av(this,"getAll",e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(n=>fv(t[n],e[n]))):this.values)),Av(this,"update",async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});const n=bv(bv({},this.getData(e)),t);this.map.set(e,n),await this.persist()}),Av(this,"delete",async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",ke
2y:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())}),this.logger=wo(t,this.name),this.storagePrefix=r,this.getKey=i}get context(){return vo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:t}=ep("MISSING_OR_INVALID","Record was recently deleted - ".concat(this.name,": ").concat(e));throw this.logger.error(t),new Error(t)}const{message:t}=ep("NO_MATCHING_KEY","".concat(this.name,": ").concat(e));throw this.logger.error(t),new Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:e}=ep("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug("Successfully Restored value for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(Qe){this.logger.debug("Failed to Restore value for ".concat(this.name)),this.logger.error(Qe)}}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}}var xv=Object.defineProperty,Ev=(e,t,n)=>((e,t,n)=>t in e?xv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class kv{constructor(e,t){this.core=e,this.logger=t,Ev(this,"name","pairing"),Ev(this,"version","0.3"),Ev(this,"events",new wi),Ev(this,"pairings"),Ev(this,"initialized",!1),Ev(this,"storagePrefix",ef),Ev(this,"ignoredPayloadTypes",[1]),Ev(this,"registeredMethods",[]),Ev(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),Ev(this,"register",e=>{let{methods:t}=e;this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...t])]}),Ev(this,"create",async e=>{this.isInitialized();const t=uh(),n=await this.core.crypto.setSymKey(t),r=ta(_i.FIVE_MINUTES),i={protocol:"irn"},s={topic:n,expiry:r,relay:i,active:!1,methods:null===e||void 0===e?void 0:e.methods},o=Lh({protocol:this.core.protocol,version:this.core.version,topic:n,symKey:t,relay:i,expiryTimestamp:r,methods:null===e||void 0===e?void 0:e.methods});return this.events.emit(Cf,s),this.core.expirer.set(n,r),await this.pairings.set(n,s),await this.core.relayer.subscribe(n,{transportType:null===e||void 0===e?void 0:e.transportType,internal:null===e||void 0===e?void 0:e.internal}),{topic:n,uri:o}}),Ev(this,"pair",async e=>{this.isInitialized();const t=this.core.eventClient.createEvent({properties:{topic:null===e||void 0===e?void 0:e.uri,trace:[Vf]}});this.isValidPair(e,t);const{topic:n,symKey:r,relay:i,expiryTimestamp:s,methods:o}=Mh(e.uri);let a;if(t.props.properties.topic=n,t.addTrace(Gf),t.addTrace(Kf),this.pairings.keys.includes(n)){if(a=this.pairings.get(n),t.addTrace(Yf),a.active)throw t.setError(rg),new Error("Pairing already exists: ".concat(n,". Please try again with a new connection URI."));t.addTrace(Xf)}const c=s||ta(_i.FIVE_MINUTES),l={topic:n,relay:i,expiry:c,active:!1,methods:o};this.core.expirer.set(n,c),await this.pairings.set(n,l),t.addTrace(Jf),e.activatePairing&&await this.activate({topic:n}),this.events.emit(Cf,l),t.addTrace($f),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(r,n),t.addTrace(Zf);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch(u){t.setError(tg)}try{await this.core.relayer.subscribe(n,{relay:i})}catch(d){throw t.setError(ig),d}return t.addTrace(Qf),l}),Ev(this,"activate",async e=>{let{topic:t}=e;this.isInitialized();const n=ta(_i.FIVE_MINUTES);this.core.expirer.set(t,n),await this.pairings.update(t,{active:!0,expiry:n})}),Ev(this,"ping",async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:t}=e;if(this.pairings.keys.includes(t)){const e=await this.sendRequest(t,"wc_pairingPing",{}),{done:n,resolve:r,reject:i}=Yo();this.events.once(ra("pairing_ping",e),e=>{let{error:t}=e;t?i(t):r()}),await n()}}),Ev(this,"updateExpiry",async e=>{let{topic:t,expiry:n}=e;this.isInitialized(),await this.pairings.update(t,{expiry:n})}),Ev(this,"updateMetadata",async e=>{let{topic:t,metadata:n}=e;this.isInitialized(),await this.pairings.update(t,{peerMetadata:n})}),Ev(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),Ev(this,"disconnect",async e=>{this.isInitialized(),await this.isValidDisconnect(e);const{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",tp("USER_DISCONNECTED")),await this.deletePairing(t))}),Ev(this,"formatUriFromPairing",e=>{this.isInitialized();const{topic:t,relay:n,expiry:r,methods:i}=e,s=this.core.crypto.keychain.get(t);return Lh({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:s,relay:n,expiryTimestamp:r,methods:i})}),Ev(this,"sendRequest",async(e,t,n)=>{const r=(0,Yp.formatJsonRpcRequest)(t,n),i=await this.core.crypto.encode(e,r),s=Tf[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,i,s),r.id}),Ev(this,"sendResult",async(e,t,n)=>{const r=(0,Yp.formatJsonRpcResult)(e,n),i=await this.core.crypto.encode(t,r),s=(await this.core.history.get(t,e)).request.method,o=Tf[s].res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(r)}),Ev(this,"sendError",async(e,t,n)=>{const r=(0,Yp.formatJsonRpcError)(e,n),i=await this.core.crypto.encode(t,r),s=(await this.core.history.get(t,e)).request.method,o=Tf[s]?Tf[s].res:Tf.unregistered_method.res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(r)}),Ev(this,"deletePairing",async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,tp("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])}),Ev(this,"cleanup",async()=>{const e=this.pairings.getAll().filter(e=>na(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))}),Ev(this,"onRelayEventRequest",async e=>{const{topic:t,payload:n}=e;switch(n.method){case"wc_pairingPing":return await this.onPairingPingRequest(t,n);case"wc_pairingDelete":return await this.onPairingDeleteRequest(t,n);default:return await this.onUnknownRpcMethodRequest(t,n)}}),Ev(this,"onRelayEventResponse",async e=>{const{topic:t,payload:n}=e,r=(await this.core.history.get(t,n.id)).request.method;return"wc_pairingPing"===r?this.onPairingPingResponse(t,n):this.onUnknownRpcMethodResponse(r)}),Ev(this,"onPairingPingRequest",async(e,t)=>{const{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult(n,e,!0),this.events.emit(Nf,{id:n,topic:e})}catch(r){await this.sendError(n,e,r),this.logger.error(r)}}),Ev(this,"onPairingPingResponse",(e,t)=>{const{id:n}=t;setTimeout(()=>{(0,Yp.isJsonRpcResult)(t)?this.events.emit(ra("pairing_ping",n),{}):(0,Yp.isJsonRpcError)(t)&&this.events.emit(ra("pairing_ping",n),{error:t.error})},500)}),Ev(this,"onPairingDeleteRequest",async(e,t)=>{const{id:n}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(Of,{id:n,topic:e})}catch(r){await this.sendError(n,e,r),this.logger.error(r)}}),Ev(this,"onUnknownRpcMethodRequest",async(e,t)=>{const{id:n,method:r}=t;try{if(this.registeredMethods.includes(r))return;const t=tp("WC_METHOD_UNSUPPORTED",r);await this.sendError(n,e,t),this.logger.error(t)}catch(i){await this.sendError(n,e,i),this.logger.error(i)}}),Ev(this,"onUnknownRpcMethodResponse",e=>{this.registeredMethods.includes(e)||this.logger.error(tp("WC_METHOD_UNSUPPORTED",e))}),Ev(this,"isValidPair",(e,t)=>{var n;if(!fp(e)){const{message:n}=ep("MISSING_OR_INVALID","pair() params: ".concat(e));throw t.setError(ng),new Error(n)}if(!function(e){function t(e){try{return typeof new URL(e)<"u"}catch(t){return!1}}try{if(sp(e,!1))return!!t(e)||t(la(e))}catch(n){}return!1}(e.uri)){const{message:n}=ep("MISSING_OR_INVALID","pair() uri: ".concat(e.uri));throw t.setError(ng),new Error(n)}const r=Mh(null===e||void 0===e?void 0:e.uri);if(null==(n=null===r||void 0===r?void 0:r.relay)||!n.protocol){const{message:e}=ep("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(ng),new Error(e)}if(null==r||!r.symKey){const{message:e}=ep("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(ng),new Error(e)}if(null!=r&&r.expiryTimestamp&&(0,_i.toMiliseconds)(null===r||void 0===r?void 0:r.expiryTimestamp)<Date.now()){t.setError(sg);const{message:e}=ep("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(e)}}),Ev(this,"isValidPing",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","ping() params: ".concat(e));throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)}),Ev(this,"isValidDisconnect",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","disconnect() params: ".concat(e));throw new Error(t)}const{topic:t}=e;await this.isValidPairingTopic(t)}),Ev(this,"isValidPairingTopic",async e=>{if(!sp(e,!1)){const{message:t}=ep("MISSING_OR_INVALID","pairing topic should be a string: ".concat(e));throw new Error(t)}if(!this.pairings.keys.includes(e)){const{message:t}=ep("NO_MATCHING_KEY","pairing topic doesn't exist: ".concat(e));throw new Error(t)}if(na(this.pairings.get(e).expiry)){await this.deletePairing(e);const{message:t}=ep("EXPIRED","pairing topic: ".concat(e));throw new Error(t)}}),this.core=e,this.logger=wo(t,this.name),this.pairings=new _v(this.core,this.logger,this.name,this.storagePrefix)}get context(){return vo(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(cf,async e=>{const{topic:t,message:n,transportType:r}=e;if(this.pairings.keys.includes(t)&&r!==bf.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{const e=await this.core.crypto.decode(t,n);(0,Yp.isJsonRpcRequest)(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):(0,Yp.isJsonRpcResponse)(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,n)}catch(He){this.logger.error(He)}})}registerExpirerEvents(){this.core.expirer.on(jf,async e=>{const{topic:t}=ea(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(Pf,{topic:t}))})}}var Sv=Object.defineProperty,Iv=(e,t,n)=>((e,t,n)=>t in e?Sv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Tv extends Lp{constructor(e,t){super(e,t),this.core=e,this.logger=t,Iv(this,"records",new Map),Iv(this,"events",new wi.EventEmitter),Iv(this,"name","history"),Iv(this,"version","0.3"),Iv(this,"cac
2hed",[]),Iv(this,"initialized",!1),Iv(this,"storagePrefix",ef),Iv(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Iv(this,"set",(e,t,n)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:n}),this.records.has(t.id))return;const r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n,expiry:ta(_i.THIRTY_DAYS)};this.records.set(r.id,r),this.persist(),this.events.emit(Rf,r)}),Iv(this,"resolve",async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;const t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=(0,Yp.isJsonRpcError)(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(Mf,t))}),Iv(this,"get",async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t))),Iv(this,"delete",(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(n=>{if(n.topic===e){if(typeof t<"u"&&n.id!==t)return;this.records.delete(n.id),this.events.emit(Uf,n)}}),this.persist()}),Iv(this,"exists",async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e)),Iv(this,"on",(e,t)=>{this.events.on(e,t)}),Iv(this,"once",(e,t)=>{this.events.once(e,t)}),Iv(this,"off",(e,t)=>{this.events.off(e,t)}),Iv(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=wo(t,this.name)}get context(){return vo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const n={topic:t.topic,request:(0,Yp.formatJsonRpcRequest)(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:t}=ep("NO_MATCHING_KEY","".concat(this.name,": ").concat(e));throw new Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Lf)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:e}=ep("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug("Successfully Restored records for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(Qe){this.logger.debug("Failed to Restore records for ".concat(this.name)),this.logger.error(Qe)}}registerEventListeners(){this.events.on(Rf,e=>{const t=Rf;this.logger.info("Emitting ".concat(t)),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(Mf,e=>{const t=Mf;this.logger.info("Emitting ".concat(t)),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(Uf,e=>{const t=Uf;this.logger.info("Emitting ".concat(t)),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(Tp.li.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,_i.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info("Deleting expired history log: ".concat(t.id)),this.records.delete(t.id),this.events.emit(Uf,t,!1),e=!0)}),e&&this.persist()}catch(Qe){this.logger.warn(Qe)}}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}}
2var Cv=Object.defineProperty,Pv=(e,t,n)=>((e,t,n)=>t in e?Cv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Ov extends Wp{constructor(e,t){super(e,t),this.core=e,this.logger=t,Pv(this,"expirations",new Map),Pv(this,"events",new wi.EventEmitter),Pv(this,"name","expirer"),Pv(this,"version","0.3"),Pv(this,"cached",[]),Pv(this,"initialized",!1),Pv(this,"storagePrefix",ef),Pv(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Pv(this,"has",e=>{try{const t=this.formatTarget(e);return typeof this.getExpiration(t)<"u"}catch(t){return!1}}),Pv(this,"set",(e,t)=>{this.isInitialized();const n=this.formatTarget(e),r={target:n,expiry:t};this.expirations.set(n,r),this.checkExpiry(n,r),this.events.emit(Bf,{target:n,expiration:r})}),Pv(this,"get",e=>{this.isInitialized();const t=this.formatTarget(e);return this.getExpiration(t)}),Pv(this,"del",e=>{if(this.isInitialized(),this.has(e)){const t=this.formatTarget(e),n=this.getExpiration(t);this.expirations.delete(t),this.events.emit(Df,{target:t,expiration:n})}}),Pv(this,"on",(e,t)=>{this.events.on(e,t)}),Pv(this,"once",(e,t)=>{this.events.once(e,t)}),Pv(this,"off",(e,t)=>{this.events.off(e,t)}),Pv(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=wo(t,this.name)}get context(){return vo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return function(e){return $o("topic",e)}(e);if("number"==typeof e)return function(e){return $o("id",e)}(e);const{message:t}=ep("UNKNOWN_TYPE","Target type: ".concat(typeof e));throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Ff)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:e}=ep("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),new Error(e)}this.cached=e,this.logger.debug("Successfully Restored expirations for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(Qe){this.logger.debug("Failed to Restore expirations for ".concat(this.name)),this.logger.error(Qe)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:t}=ep("NO_MATCHING_KEY","".concat(this.name,": ").concat(e));throw this.logger.warn(t),new Error(t)}return t}checkExpiry(e,t){const{expiry:n}=t;(0,_i.toMiliseconds)(n)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(jf,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(Tp.li.pulse,()=>this.checkExpirations()),this.events.on(Bf,e=>{const t=Bf;this.logger.info("Emitting ".concat(t)),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(jf,e=>{const t=jf;this.logger.info("Emitting ".concat(t)),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Df,e=>{const t=Df;this.logger.info("Emitting ".concat(t)),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Nv=Object.defineProperty,Rv=(e,t,n)=>((e,t,n)=>t in e?Nv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Mv extends qp{constructor(e,t,n){super(e,t,n),this.core=e,this.logger=t,this.store=n,Rv(this,"name","verify-api"),Rv(this,"abortController"),Rv(this,"isDevEnv"),Rv(this,"verifyUrlV3",qf),Rv(this,"storagePrefix",ef),Rv(this,"version",2),Rv(this,"publicKey"),Rv(this,"fetchPromise"),Rv(this,"init",async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,_i.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),Rv(this,"register",async e=>{if(!zo()||this.isDevEnv)return;const t=window.location.origin,{id:n,decryptedId:r}=e,i="".concat(this.verifyUrlV3,"/attestation?projectId=").concat(this.core.projectId,"&origin=").concat(t,"&id=").concat(n,"&decryptedId=").concat(r);try{const e=(0,xi.getDocument)(),t=this.startAbortTimer(5*_i.ONE_SECOND),r=await new Promise((r,s)=>{const o=()=>{window.removeEventListener("message",c),e.body.removeChild(a),s("attestation aborted")};this.abortController.signal.addEventListener("abort",o);const a=e.createElement("iframe");a.src=i,a.style.display="none",a.addEventListener("error",o,{signal:this.abortController.signal});const c=i=>{if(i.data&&"string"==typeof i.data)try{const s=JSON.parse(i.data);if("verify_attestation"===s.type){if((0,js.Cq)(s.attestation).payload.id!==n)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",o),window.removeEventListener("message",c),r(null===s.attestation?"":s.attestation)}}catch(s){this.logger.warn(s)}};e.body.appendChild(a),window.addEventListener("message",c,{signal:this.abortController.signal})});
2return this.logger.debug(r,"jwt attestation"),r}catch(s){this.logger.warn(s)}return""}),Rv(this,"resolve",async e=>{if(this.isDevEnv)return"";const{attestationId:t,hash:n,encryptedId:r}=e;if(""===t)return void this.logger.debug("resolve: attestationId is empty, skipping");if(t){if((0,js.Cq)(t).payload.id!==r)return;const e=await this.isValidJwtAttestation(t);if(e)return e.isVerified?e:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!n)return;const i=this.getVerifyUrl(null===e||void 0===e?void 0:e.verifyUrl);return this.fetchAttestation(n,i)}),Rv(this,"fetchAttestation",async(e,t)=>{this.logger.debug("resolving attestation: ".concat(e," from url: ").concat(t));const n=this.startAbortTimer(5*_i.ONE_SECOND),r=await fetch("".concat(t,"/attestation/").concat(e,"?v2Supported=true"),{signal:this.abortController.signal});return clearTimeout(n),200===r.status?await r.json():void 0}),Rv(this,"getVerifyUrl",e=>{let t=e||Wf;return Hf.includes(t)||(this.logger.info("verify url: ".concat(t,", not included in trusted list, assigning default: ").concat(Wf)),t=Wf),t}),Rv(this,"fetchPublicKey",async()=>{try{this.logger.debug("fetching public key from: ".concat(this.verifyUrlV3));const e=this.startAbortTimer(_i.FIVE_SECONDS),t=await fetch("".concat(this.verifyUrlV3,"/public-key"),{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}}),Rv(this,"persistPublicKey",async e=>{this.logger.debug(e,"persisting public key to local storage"),await this.store.setItem(this.storeKey,e),this.publicKey=e}),Rv(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),Rv(this,"isValidJwtAttestation",async e=>{const t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(r){this.logger.error(r),this.logger.warn("error validating attestation")}const n=await this.fetchAndPersistPublicKey();try{if(n)return this.validateAttestation(e,n)}catch(r){this.logger.error(r),this.logger.warn("error validating attestation")}}),Rv(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),Rv(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{const t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});const e=await this.fetchPromise;return this.fetchPromise=void 0,e}),Rv(this,"validateAttestation",(e,t)=>{const n=_h(e,t.publicKey),r={hasExpired:(0,_i.toMiliseconds)(n.exp)<Date.now(),payload:n};if(r.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:r.payload.origin,isScam:r.payload.isScam,isVerified:r.payload.isVerified}}),this.logger=wo(t,this.name),this.abortController=new AbortController,this.isDevEnv=ca(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return vo(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,_i.toMiliseconds)(e))}}var Uv=Object.defineProperty,Lv=(e,t,n)=>((e,t,n)=>t in e?Uv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Bv extends Hp{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,Lv(this,"context","echo"),Lv(this,"registerDeviceToken",async e=>{const{clientId:t,token:n,notificationType:r,enableEncrypted:i=!1}=e,s="".concat("https://echo.walletconnect.com","/").concat(this.projectId,"/clients");await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:r,token:n,always_raw:i})})}),this.logger=wo(t,this.context)}}var Dv=Object.defineProperty,jv=Object.getOwnPropertySymbols,Fv=Object.prototype.hasOwnProperty,zv=Object.prototype.propertyIsEnumerable,Wv=(e,t,n)=>t in e?Dv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qv=(e,t)=>{for(var n in t||(t={}))Fv.call(t,n)&&Wv(e,n,t[n]);if(jv)for(var n of jv(t))zv.call(t,n)&&Wv(e,n,t[n]);return e},Hv=(e,t,n)=>Wv(e,"symbol"!=typeof t?t+"":t,n);class Vv extends Vp{constructor(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];super(e,t,n),this.core=e,this.logger=t,Hv(this,"context","event-client"),Hv(this,"storagePrefix",ef),Hv(this,"storageVersion",.1),Hv(this,"events",new Map),Hv(this,"shouldPersist",!1),Hv(this,"init",async()=>
2{if(!ca())try{const e={eventId:aa(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Go(this.core.relayer.protocol,this.core.relayer.version,wf)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}}),Hv(this,"createEvent",e=>{const{event:t="ERROR",type:n="",properties:{topic:r,trace:i}}=e,s=aa(),o=this.core.projectId||"",a=Date.now(),c=qv({eventId:s,timestamp:a,props:{event:t,type:n,properties:{topic:r,trace:i}},bundleId:o,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,c),this.shouldPersist=!0),c}),Hv(this,"getEvent",e=>{const{eventId:t,topic:n}=e;if(t)return this.events.get(t);const r=Array.from(this.events.values()).find(e=>e.props.properties.topic===n);return r?qv(qv({},r),this.setMethods(r.eventId)):void 0}),Hv(this,"deleteEvent",e=>{const{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0}),Hv(this,"setEventListeners",()=>{this.core.heartbeat.on(Tp.li.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,_i.fromMiliseconds)(Date.now())-(0,_i.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})}),Hv(this,"setMethods",e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)})),Hv(this,"addTrace",(e,t)=>{const n=this.events.get(e);n&&(n.props.properties.trace.push(t),this.events.set(e,n),this.shouldPersist=!0)}),Hv(this,"setError",(e,t)=>{const n=this.events.get(e);n&&(n.props.type=t,n.timestamp=Date.now(),this.events.set(e,n),this.shouldPersist=!0)}),Hv(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),Hv(this,"restore",async()=>{try{const e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,qv(qv({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}}),Hv(this,"submit",async()=>{if(!this.telemetryEnabled||0===this.events.size)return;const e=[];for(const[t,n]of this.events)n.props.type&&e.push(n);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(const t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(He){this.logger.warn(He)}}),Hv(this,"sendEvent",async e=>{const t=this.getAppDomain()?"":"&sp=desktop";return await fetch("".concat("https://pulse.walletconnect.org/batch","?projectId=").concat(this.core.projectId,"&st=events_sdk&sv=js-").concat(wf).concat(t),{method:"POST",body:JSON.stringify(e)})}),Hv(this,"getAppDomain",()=>Vo().url),this.logger=wo(t,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var Gv=Object.defineProperty,Kv=Object.getOwnPropertySymbols,Jv=Object.prototype.hasOwnProperty,Zv=Object.prototype.propertyIsEnumerable,Qv=(e,t,n)=>t in e?Gv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yv=(e,t)=>{for(var n in t||(t={}))Jv.call(t,n)&&Qv(e,n,t[n]);if(Kv)for(var n of Kv(t))Zv.call(t,n)&&Qv(e,n,t[n]);return e},Xv=(e,t,n)=>Qv(e,"symbol"!=typeof t?t+"":t,n);class $v extends Rp{constructor(e){var t;super(e),Xv(this,"protocol","wc"),Xv(this,"version",2),Xv(this,"name",$p),Xv(this,"relayUrl"),Xv(this,"projectId"),Xv(this,"customStoragePrefix"),Xv(this,"events",new wi.EventEmitter),Xv(this,"logger"),Xv(this,"heartbeat"),Xv(this,"relayer"),Xv(this,"crypto"),Xv(this,"storage"),Xv(this,"history"),Xv(this,"expirer"),Xv(this,"pairing"),Xv(this,"verify"),Xv(this,"echoClient"),Xv(this,"linkModeSupportedApps"),Xv(this,"eventClient"),Xv(this,"initialized",!1),Xv(this,"logChunkController"),Xv(this,"on",(e,t)=>this.events.on(e,t)),Xv(this,"once",(e,t)=>this.events.once(e,t)),Xv(this,"off",(e,t)=>this.events.off(e,t)),Xv(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),Xv(this,"dispatchEnvelope",e=>{let{topic:t,message:n,sessionExists:r}=e;if(!t||!n)return;const i={topic:t,message:n,publishedAt:Date.now(),transportType:bf.link_mode};this.relayer.onLinkMessageEvent(i,{sessionExists:r})});const n=this.getGlobalCore(null===e||void 0===e?void 0:e.customStoragePrefix);if(n)try{return this.customStoragePrefix=n.customStoragePrefix,this.logger=n.logger,this.heartbeat=n.heartbeat,this.crypto=n.crypto,this.history=n.history,this.expirer=n.expirer,this.storage=n.storage,this.relayer=n.relayer,this.pairing=n.pairing,this.verify=n.verify,this.echoClient=n.echoClient,this.linkModeSupportedApps=n.linkModeSupportedApps,this.eventClient=n.eventClient,this.initialized=n.initialized,this.logChunkController=n.logChunkController,n}catch(o){console.warn("Failed to copy global core",o)}this.projectId=null===e||void 0===e?void 0:e.projectId,this.relayUrl=(null===e||void 0===e?void 0:e.relayUrl)||af,this.customStoragePrefix=null!=e&&e.customStoragePrefix?":".concat(e.customStoragePrefix):"";const r=function(e){return yo(mo({},e),{level:(null===e||void 0===e?void 0:e.level)||Gs})}({level:"string"==typeof(null===e||void 0===e?void 0:e.logger)&&e.logger?e.logger:tf,name:$p}),{logger:i,chunkLoggerController:s}=bo({opts:r,maxSizeInBytes:null===e||void 0===e?void 0:e.maxLogBlobSizeInBytes,loggerOverride:null===e||void 0===e?void 0:e.logger});this.logChunkController=s,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=wo(i,this.name),this.heartbeat=new Tp.VH,this.crypto=new yy(this,this.logger,null===e||void 0===e?void 0:e.keychain),this.history=new Tv(this,this.logger),this.expirer=new Ov(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new Cp.A(Yv(Yv({},nf),null===e||void 0===e?void 0:e.storageOptions)),this.relayer=new sv({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new kv(this,this.logger),this.verify=new Mv(this,this.logger,this.storage),this.echoClient=new Bv(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new Vv(this,this.logger,null===e||void 0===e?void 0:e.telemetryEnabled),this.setGlobalCore(this)}
2static async init(e){const t=new $v(e);await t.initialize();const n=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",n),t}get context(){return vo(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(xf,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(xf)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(Qe){throw this.logger.warn(Qe,"Core Initialization Failure at epoch ".concat(Date.now())),this.logger.error(Qe.message),Qe}}getGlobalCore(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{if(this.isGlobalCoreDisabled())return;const t="_walletConnectCore_".concat(e),n="".concat(t,"_count");return globalThis[n]=(globalThis[n]||0)+1,globalThis[n]>1&&console.warn("WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ".concat(globalThis[n]," times.")),globalThis[t]}catch(t){return void console.warn("Failed to get global WalletConnect core",t)}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;const n="_walletConnectCore_".concat((null==(t=e.opts)?void 0:t.customStoragePrefix)||"");globalThis[n]=e}catch(n){console.warn("Failed to set global WalletConnect core",n)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&"true"==={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.DISABLE_GLOBAL_CORE}catch(e){return!0}}}const ew=$v,tw="client",nw="".concat("wc","@").concat(2,":").concat(tw,":"),rw=tw,iw="error",sw="WALLETCONNECT_DEEPLINK_CHOICE",ow="Proposal expired",aw=_i.SEVEN_DAYS,cw={wc_sessionPropose:{req:{ttl:_i.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:_i.ONE_DAY,prompt:!1,tag:1104},res:{ttl:_i.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:_i.ONE_DAY,prompt:!1,tag:1106},res:{ttl:_i.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:_i.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:_i.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:_i.ONE_DAY,prompt:!1,tag:1112},res:{ttl:_i.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:_i.ONE_DAY,prompt:!1,tag:1114},res:{ttl:_i.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:_i.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:_i.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:_i.FIVE_MINUTES,prompt:!1,tag:1119}}},lw={min:_i.FIVE_MINUTES,max:_i.SEVEN_DAYS},uw="IDLE",dw="ACTIVE",hw={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},pw=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],fw="".concat("wc","@",1.5,":").concat("auth",":"),gw="".concat(fw,":PUB_KEY");var mw=Object.defineProperty,yw=Object.defineProperties,vw=Object.getOwnPropertyDescriptors,ww=Object.getOwnPropertySymbols,bw=Object.prototype.hasOwnProperty,Aw=Object.prototype.propertyIsEnumerable,_w=(e,t,n)=>t in e?mw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xw=(e,t)=>{for(var n in t||(t={}
2))bw.call(t,n)&&_w(e,n,t[n]);if(ww)for(var n of ww(t))Aw.call(t,n)&&_w(e,n,t[n]);return e},Ew=(e,t)=>yw(e,vw(t)),kw=(e,t,n)=>_w(e,"symbol"!=typeof t?t+"":t,n);class Sw extends Zp{constructor(e){var t;super(e),t=this,kw(this,"name","engine"),kw(this,"events",new wi),kw(this,"initialized",!1),kw(this,"requestQueue",{state:uw,queue:[]}),kw(this,"sessionRequestQueue",{state:uw,queue:[]}),kw(this,"emittedSessionRequests",new ua({limit:500})),kw(this,"requestQueueDelay",_i.ONE_SECOND),kw(this,"expectedPairingMethodMap",new Map),kw(this,"recentlyDeletedMap",new Map),kw(this,"recentlyDeletedLimit",200),kw(this,"relayMessageCache",[]),kw(this,"pendingSessions",new Map),kw(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(cw)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,_i.toMiliseconds)(this.requestQueueDelay)))}),kw(this,"connect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const t=Ew(xw({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t),t.optionalNamespaces=function(e,t){var n,r,i,s,o,a;const c=Qh(e),l=Qh(t),u={},d=Object.keys(c).concat(Object.keys(l));for(const h of d)u[h]={chains:ia(null==(n=c[h])?void 0:n.chains,null==(r=l[h])?void 0:r.chains),methods:ia(null==(i=c[h])?void 0:i.methods,null==(s=l[h])?void 0:s.methods),events:ia(null==(o=c[h])?void 0:o.events,null==(a=l[h])?void 0:a.events)};return u}(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};const{pairingTopic:n,requiredNamespaces:r,optionalNamespaces:i,sessionProperties:s,scopedProperties:o,relays:a}=t;let c,l=n,u=!1;try{if(l){const e=this.client.core.pairing.pairings.get(l);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),u=e.active}}catch(b){throw this.client.logger.error("connect() -> pairing.get(".concat(l,") failed")),b}if(!l||!u){const{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});l=e,c=t}if(!l){const{message:e}=ep("NO_MATCHING_KEY","connect() pairing topic: ".concat(l));throw new Error(e)}const d=await this.client.core.crypto.generateKeyPair(),h=cw.wc_sessionPropose.req.ttl||_i.FIVE_MINUTES,p=ta(h),f=Ew(xw(xw({requiredNamespaces:r,optionalNamespaces:i,relays:null!==a&&void 0!==a?a:[{protocol:"irn"}],proposer:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:p,pairingTopic:l},s&&{sessionProperties:s}),o&&{scopedProperties:o}),{id:(0,Yp.payloadId)()}),g=ra("session_connect",f.id),{reject:m,resolve:y,done:v}=Yo(h,ow),w=e=>{let{id:t}=e;t===f.id&&(this.client.events.off("proposal_expire",w),this.pendingSessions.delete(f.id),this.events.emit(g,{error:{message:ow,code:0}}))};return this.client.events.on("proposal_expire",w),this.events.once(g,e=>{let{error:t,session:n}=e;this.client.events.off("proposal_expire",w),t?m(t):n&&y(n)}),await this.sendProposeSession({proposal:f,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:f.id}}}),await this.setProposal(f.id,f),{uri:c,approval:v}}),kw(this,"pair",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(Qe){throw this.client.logger.error("pair() failed"),Qe}}),kw(this,"approve",async e=>{var t,n,r;const i=this.client.core.eventClient.createEvent({properties:{topic:null==(t=null===e||void 0===e?void 0:e.id)?void 0:t.toString(),trace:[ag]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(x){throw i.setError(mg),x}try{await this.isValidProposalId(null===e||void 0===e?void 0:e.id)}catch(x){throw this.client.logger.error("approve() -> proposal.get(".concat(null===e||void 0===e?void 0:e.id,") failed")),i.setError(bg),x}try{await this.isValidApprove(e)}catch(x){throw this.client.logger.error("approve() -> isValidApprove() failed"),i.setError(wg),x}const{id:s,relayProtocol:o,namespaces:a,sessionProperties:c,scopedProperties:l,sessionConfig:u}=e,d=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:i.eventId});const{pairingTopic:h,proposer:p,requiredNamespaces:f,optionalNamespaces:g}=d;let m=null==(n=this.client.core.eventClient)?void 0:n.getEvent({topic:h});m||(m=null==(r=this.client.core.eventClient)?void 0:r.createEvent({type:ag,properties:{topic:h,trace:[ag,cg]}}));const y=await this.client.core.crypto.generateKeyPair(),v=p.publicKey,w=await this.client.core.crypto.generateSharedKey(y,v),b=xw(xw(xw({relay:{protocol:null!==o&&void 0!==o?o:"irn"},namespaces:a,controller:{publicKey:y,metadata:this.client.metadata},expiry:ta(aw)},c&&{sessionProperties:c}),l&&{scopedProperties:l}),u&&{sessionConfig:u}),A=bf.relay;m.addTrace(lg);try{await this.client.core.relayer.subscribe(w,{transportType:A,internal:{skipSubscribe:!0}})}catch(x){throw m.setError(vg),x}m.addTrace(ug);const _=Ew(xw({},b),{topic:w,requiredNamespaces:f,optionalNamespaces:g,pairingTopic:h,acknowledged:!1,self:b.controller,peer:{publicKey:p.publicKey,metadata:p.metadata},controller:y,transportType:bf.relay});await this.client.session.set(w,_),m.addTrace(hg);try{await this.sendApproveSession({sessionTopic:w,proposal:d,pairingProposalResponse:{relay:{protocol:null!==o&&void 0!==o?o:"irn"},responderPublicKey:y},sessionSettleRequest:b,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:s}}}),m.addTrace(dg)}catch(x){throw this.client.logger.error(x),this.client.session.delete(w,tp("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(w),x}return this.client.core.eventClient.deleteEvent({eventId:m.eventId}),await this.client.core.pairing.updateMetadata({topic:h,metadata:p.metadata}),await this.deleteProposal(s),await this.client.core.pairing.activate({topic:h}),await this.setExpiry(w,ta(aw)),{topic:w,acknowledged:()=>Promise.resolve(this.client.session.get(w))}}),kw(this,"reject",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(Je){throw this.client.logger.error("reject() -> isValidReject() failed"),Je}const{id:t,reason:n}=e;let r;try{r=this.client.proposal.get(t).pairingTopic}catch(Je){throw this.client.logger.error("reject() -> proposal.get(".concat(t,") failed")),Je}
2r&&await this.sendError({id:t,topic:r,error:n,rpcOpts:cw.wc_sessionPropose.reject}),await this.deleteProposal(t)}),kw(this,"update",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(l){throw this.client.logger.error("update() -> isValidUpdate() failed"),l}const{topic:t,namespaces:n}=e,{done:r,resolve:i,reject:s}=Yo(),o=(0,Yp.payloadId)(),a=(0,Yp.getBigIntRpcId)().toString(),c=this.client.session.get(t).namespaces;return this.events.once(ra("session_update",o),e=>{let{error:t}=e;t?s(t):i()}),await this.client.session.update(t,{namespaces:n}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:a}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),s(e)}),{acknowledged:r}}),kw(this,"extend",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(o){throw this.client.logger.error("extend() -> isValidExtend() failed"),o}const{topic:t}=e,n=(0,Yp.payloadId)(),{done:r,resolve:i,reject:s}=Yo();return this.events.once(ra("session_extend",n),e=>{let{error:t}=e;t?s(t):i()}),await this.setExpiry(t,ta(aw)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(e=>{s(e)}),{acknowledged:r}}),kw(this,"request",async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(lt){throw this.client.logger.error("request() -> isValidRequest() failed"),lt}const{chainId:t,request:n,topic:r,expiry:i=cw.wc_sessionRequest.req.ttl}=e,s=this.client.session.get(r);(null===s||void 0===s?void 0:s.transportType)===bf.relay&&await this.confirmOnlineStateOrThrow();const o=(0,Yp.payloadId)(),a=(0,Yp.getBigIntRpcId)().toString(),{done:c,resolve:l,reject:u}=Yo(i,"Request expired. Please try again.");this.events.once(ra("session_request",o),e=>{let{error:t,result:n}=e;t?u(t):l(n)});const d="wc_sessionRequest",h=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);if(h)return await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:r,method:d,params:{request:Ew(xw({},n),{expiryTimestamp:ta(i)}),chainId:t},expiry:i,throwOnFailedPublish:!0,appLink:h}).catch(e=>u(e)),this.client.events.emit("session_request_sent",{topic:r,request:n,chainId:t,id:o}),await c();const p={request:Ew(xw({},n),{expiryTimestamp:ta(i)}),chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:o,relayRpcId:a,topic:r,method:d,params:p,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(o,p)}).catch(e=>u(e)),this.client.events.emit("session_request_sent",{topic:r,request:n,chainId:t,id:o}),e()}),new Promise(async e=>{var t;if(null==(t=s.sessionConfig)||!t.disableDeepLink){const e=await async function(e,t){let n="";try{if(zo()&&(n=localStorage.getItem(t),n))return n;n=await e.getItem(t)}catch(i){console.error(i)}return n}(this.client.core.storage,sw);await sa({id:o,topic:r,wcDeepLink:e})}e()}),c()]).then(e=>e[2])}),kw(this,"respond",async e=>{var t,n;this.isInitialized();const r=this.client.core.eventClient.createEvent({properties:{topic:(null===e||void 0===e?void 0:e.topic)||(null==(n=null==(t=null===e||void 0===e?void 0:e.response)?void 0:t.id)?void 0:n.toString()),trace:[pg]}});try{await this.isValidRespond(e)}catch(l){throw r.addTrace(null===l||void 0===l?void 0:l.message),r.setError(Ag),l}r.addTrace(fg);const{topic:i,response:s}=e,{id:o}=s,a=this.client.session.get(i);a.transportType===bf.relay&&await this.confirmOnlineStateOrThrow();const c=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);try{r.addTrace(gg),(0,Yp.isJsonRpcResult)(s)?await this.sendResult({id:o,topic:i,result:s.result,throwOnFailedPublish:!0,appLink:c}):(0,Yp.isJsonRpcError)(s)&&await this.sendError({id:o,topic:i,error:s.error,appLink:c}),this.cleanupAfterResponse(e)}catch(l){throw r.addTrace(null===l||void 0===l?void 0:l.message),r.setError(_g),l}}),kw(this,"ping",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(n){throw this.client.logger.error("ping() -> isValidPing() failed"),n}const{topic:t}=e;if(this.client.session.keys.includes(t)){const e=(0,Yp.payloadId)(),n=(0,Yp.getBigIntRpcId)().toString(),{done:r,resolve:i,reject:s}=Yo();this.events.once(ra("session_ping",e),e=>{let{error:t}=e;t?s(t):i()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:n}),r()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:t}))}),kw(this,"emit",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);const{topic:t,event:n,chainId:r}=e,i=(0,Yp.getBigIntRpcId)().toString(),s=(0,Yp.payloadId)();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:n,chainId:r},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:s})}),kw(this,"disconnect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);const{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:tp("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else{if(!this.client.core.pairing.pairings.keys.includes(t)){const{message:e}=ep("MISMATCHED_TOPIC","Session or pairing topic not found: ".concat(t));throw new Error(e)}
2await this.client.core.pairing.disconnect({topic:t})}}),kw(this,"find",e=>(this.isInitialized(),this.client.session.getAll().filter(t=>function(e,t){const{requiredNamespaces:n}=t,r=Object.keys(e.namespaces),i=Object.keys(n);let s=!0;return!!Jo(i,r)&&(r.forEach(t=>{const{accounts:r,methods:i,events:o}=e.namespaces[t],a=Kh(r),c=n[t];(!Jo(Eo(t,c),a)||!Jo(c.methods,i)||!Jo(c.events,o))&&(s=!1)}),s)}(t,e)))),kw(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),kw(this,"authenticate",async(e,t)=>{var n;this.isInitialized(),this.isValidAuthenticate(e);const r=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(n=this.client.metadata.redirect)?void 0:n.linkMode),i=r?bf.link_mode:bf.relay;i===bf.relay&&await this.confirmOnlineStateOrThrow();const{chains:s,statement:o="",uri:a,domain:c,nonce:l,type:u,exp:d,nbf:h,methods:p=[],expiry:f}=e,g=[...e.resources||[]],{topic:m,uri:y}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:i});this.client.logger.info({message:"Generated new pairing",pairing:{topic:m,uri:y}});const v=await this.client.core.crypto.generateKeyPair(),w=dh(v);if(await Promise.all([this.client.auth.authKeys.set(gw,{responseTopic:w,publicKey:v}),this.client.auth.pairingTopics.set(w,{topic:w,pairingTopic:m})]),await this.client.core.relayer.subscribe(w,{transportType:i}),this.client.logger.info("sending request to new pairing topic: ".concat(m)),p.length>0){const{namespace:e}=_o(s[0]);let t=Il(e,"request",p);Rl(g)&&(t=Cl(t,g.pop())),g.push(t)}const b=f&&f>cw.wc_sessionAuthenticate.req.ttl?f:cw.wc_sessionAuthenticate.req.ttl,A={authPayload:{type:null!==u&&void 0!==u?u:"caip122",chains:s,statement:o,aud:a,domain:c,version:"1",nonce:l,iat:(new Date).toISOString(),exp:d,nbf:h,resources:g},requester:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:ta(b)},_={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:s,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:m,proposer:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:ta(cw.wc_sessionPropose.req.ttl),id:(0,Yp.payloadId)()},{done:x,resolve:E,reject:k}=Yo(b,"Request expired"),S=(0,Yp.payloadId)(),I=ra("session_connect",_.id),T=ra("session_request",S),C=async e=>{let{error:t,session:n}=e;this.events.off(T,P),t?k(t):n&&E({session:n})},P=async e=>{var n,r,s;if(await this.deletePendingAuthRequest(S,{message:"fulfilled",code:0}),e.error){const t=tp("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(I,C),k(e.error.message))}await this.deleteProposal(_.id),this.events.off(I,C);const{cacaos:o,responder:a}=e.result,c=[],l=[];for(const t of o){await Al({cacao:t,projectId:this.client.core.projectId})||(this.client.logger.error(t,"Signature verification failed"),k(tp("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:e}=t,n=Rl(e.resources),r=[wl(e.iss)],i=bl(e.iss);if(n){const e=Ol(n),t=Nl(n);c.push(...e),r.push(...t)}for(const t of r)l.push("".concat(t,":").concat(i))}const u=await this.client.core.crypto.generateSharedKey(v,a.publicKey);let d;c.length>0&&(d={topic:u,acknowledged:!0,self:{publicKey:v,metadata:this.client.metadata},peer:a,controller:a.publicKey,expiry:ta(aw),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:m,namespaces:Yh([...new Set(c)],[...new Set(l)]),transportType:i},await this.client.core.relayer.subscribe(u,{transportType:i}),await this.client.session.set(u,d),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:a.metadata}),d=this.client.session.get(u)),null!=(n=this.client.metadata.redirect)&&n.linkMode&&null!=(r=a.metadata.redirect)&&r.linkMode&&null!=(s=a.metadata.redirect)&&s.universal&&t&&(this.client.core.addLinkModeSupportedApp(a.metadata.redirect.universal),this.client.session.update(u,{transportType:bf.link_mode})),E({auths:o,session:d})};let O;this.events.once(I,C),this.events.once(T,P);try{if(r){const e=(0,Yp.formatJsonRpcRequest)("wc_sessionAuthenticate",A,S);this.client.core.history.set(m,e);const n=await this.client.core.crypto.encode("",e,{type:2,encoding:ch});O=Bh(t,m,n)}else await Promise.all([this.sendRequest({topic:m,method:"wc_sessionAuthenticate",params:A,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:S}),this.sendRequest({topic:m,method:"wc_sessionPropose",params:_,expiry:cw.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:_.id})])}catch(vt){throw this.events.off(I,C),this.events.off(T,P),vt}return await this.setProposal(_.id,_),await this.setAuthRequest(S,{request:Ew(xw({},A),{verifyContext:{}}),pairingTopic:m,transportType:i}),{uri:null!==O&&void 0!==O?O:y,response:x}}),kw(this,"approveSessionAuthenticate",async e=>{const{id:t,auths:n}=e,r=this.client.core.eventClient.createEvent({properties:{topic:t.toString(),trace:[xg]}});try{this.isInitialized()}catch(lt){throw r.setError(Pg),lt}const i=this.getPendingAuthRequest(t);if(!i)throw r.setError(Mg),new Error("Could not find pending auth request with id ".concat(t));const s=i.transportType||bf.relay;s===bf.relay&&await this.confirmOnlineStateOrThrow();const o=i.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=dh(o),l={type:1,receiverPublicKey:o,senderPublicKey:a},u=[],d=[];for(const f of n){if(!await Al({cacao:f,projectId:this.client.core.projectId})){r.setError(Og);const e=tp("SESSION_SETTLEMENT_FAILED","Signature verification failed");
2throw await this.sendError({id:t,topic:c,error:e,encodeOpts:l}),new Error(e.message)}r.addTrace(kg);const{p:e}=f,n=Rl(e.resources),i=[wl(e.iss)],s=bl(e.iss);if(n){const e=Ol(n),t=Nl(n);u.push(...e),i.push(...t)}for(const t of i)d.push("".concat(t,":").concat(s))}const h=await this.client.core.crypto.generateSharedKey(a,o);let p;if(r.addTrace(Eg),(null===u||void 0===u?void 0:u.length)>0){p={topic:h,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:o,metadata:i.requester.metadata},controller:o,expiry:ta(aw),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:i.pairingTopic,namespaces:Yh([...new Set(u)],[...new Set(d)]),transportType:s},r.addTrace(Ig);try{await this.client.core.relayer.subscribe(h,{transportType:s})}catch(lt){throw r.setError(Ng),lt}r.addTrace(Tg),await this.client.session.set(h,p),r.addTrace(Sg),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})}r.addTrace(Cg);try{await this.sendResult({topic:c,id:t,result:{cacaos:n,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:l,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(i.requester.metadata,s)})}catch(lt){throw r.setError(Rg),lt}return await this.client.auth.requests.delete(t,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:r.eventId}),{session:p}}),kw(this,"rejectSessionAuthenticate",async e=>{this.isInitialized();const{id:t,reason:n}=e,r=this.getPendingAuthRequest(t);if(!r)throw new Error("Could not find pending auth request with id ".concat(t));r.transportType===bf.relay&&await this.confirmOnlineStateOrThrow();const i=r.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),o=dh(i),a={type:1,receiverPublicKey:i,senderPublicKey:s};await this.sendError({id:t,topic:o,error:n,encodeOpts:a,rpcOpts:cw.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(r.requester.metadata,r.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.deleteProposal(t)}),kw(this,"formatAuthMessage",e=>{this.isInitialized();const{request:t,iss:n}=e;return _l(t,n)}),kw(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{const e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)}),kw(this,"cleanupDuplicatePairings",async e=>{if(e.pairingTopic)try{const t=this.client.core.pairing.pairings.get(e.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(n=>{var r,i;return(null==(r=n.peerMetadata)?void 0:r.url)&&(null==(i=n.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&n.topic&&n.topic!==t.topic});if(0===n.length)return;this.client.logger.info("Cleaning up ".concat(n.length," duplicate pairing(s)")),await Promise.all(n.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(Qe){this.client.logger.error(Qe)}}),kw(this,"deleteSession",async e=>{var t;const{topic:n,expirerHasDeleted:r=!1,emitEvent:i=!0,id:s=0}=e,{self:o}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,tp("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),r||this.client.core.expirer.del(n),this.client.core.storage.removeItem(sw).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===n&&this.deletePendingSessionRequest(e.id,tp("USER_DISCONNECTED"))}),n===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=uw),i&&this.client.events.emit("session_delete",{id:s,topic:n})}),kw(this,"deleteProposal",async(e,t)=>{if(t)try{const t=this.client.proposal.get(e),n=this.client.core.eventClient.getEvent({topic:t.pairingTopic});null===n||void 0===n||n.setError(yg)}catch(n){}await Promise.all([this.client.proposal.delete(e,tp("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")}),kw(this,"deletePendingSessionRequest",async function(e,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];
2await Promise.all([t.client.pendingRequest.delete(e,n),r?Promise.resolve():t.client.core.expirer.del(e)]),t.addToRecentlyDeleted(e,"request"),t.sessionRequestQueue.queue=t.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(t.sessionRequestQueue.state=uw,t.client.events.emit("session_request_expire",{id:e}))}),kw(this,"deletePendingAuthRequest",async function(e,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];await Promise.all([t.client.auth.requests.delete(e,n),r?Promise.resolve():t.client.core.expirer.del(e)])}),kw(this,"setExpiry",async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))}),kw(this,"setProposal",async(e,t)=>{this.client.core.expirer.set(e,ta(cw.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)}),kw(this,"setAuthRequest",async(e,t)=>{const{request:n,pairingTopic:r,transportType:i=bf.relay}=t;this.client.core.expirer.set(e,n.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:e,pairingTopic:r,verifyContext:n.verifyContext,transportType:i})}),kw(this,"setPendingSessionRequest",async e=>{const{id:t,topic:n,params:r,verifyContext:i}=e,s=r.request.expiryTimestamp||ta(cw.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,s),await this.client.pendingRequest.set(t,{id:t,topic:n,params:r,verifyContext:i})}),kw(this,"sendRequest",async e=>{const{topic:t,method:r,params:i,expiry:s,relayRpcId:o,clientRpcId:a,throwOnFailedPublish:c,appLink:l,tvf:u,publishOpts:d={}}=e,h=(0,Yp.formatJsonRpcRequest)(r,i,a);let p;const f=!!l;try{const e=f?ch:ah;p=await this.client.core.crypto.encode(t,h,{encoding:e})}catch(y){throw await this.cleanup(),this.client.logger.error("sendRequest() -> core.crypto.encode() for topic ".concat(t," failed")),y}let g;if(pw.includes(r)){const e=hh(JSON.stringify(h)),t=hh(p);g=await this.client.core.verify.register({id:t,decryptedId:e})}const m=xw(xw({},cw[r].req),d);if(m.attestation=g,s&&(m.ttl=s),o&&(m.id=o),this.client.core.history.set(t,h),f){const e=Bh(l,t,p);await n.g.Linking.openURL(e,this.client.name)}else m.tvf=Ew(xw({},u),{correlationId:h.id}),c?(m.internal=Ew(xw({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(t,p,m)):this.client.core.relayer.publish(t,p,m).catch(e=>this.client.logger.error(e));return h.id}),kw(this,"sendProposeSession",async e=>{const{proposal:t,publishOpts:n}=e,r=(0,Yp.formatJsonRpcRequest)("wc_sessionPropose",t,t.id);this.client.core.history.set(t.pairingTopic,r);const i=await this.client.core.crypto.encode(t.pairingTopic,r,{encoding:ah}),s=hh(JSON.stringify(r)),o=hh(i),a=await this.client.core.verify.register({id:o,decryptedId:s});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:i},opts:Ew(xw({},n),{publishMethod:"wc_proposeSession",attestation:a})})}),kw(this,"sendApproveSession",async e=>{const{sessionTopic:t,pairingProposalResponse:n,proposal:r,sessionSettleRequest:i,publishOpts:s}=e,o=(0,Yp.formatJsonRpcResult)(r.id,n),a=await this.client.core.crypto.encode(r.pairingTopic,o,{encoding:ah}),c=(0,Yp.formatJsonRpcRequest)("wc_sessionSettle",i,null===s||void 0===s?void 0:s.id),l=await this.client.core.crypto.encode(t,c,{encoding:ah});this.client.core.history.set(t,c),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:r.pairingTopic,sessionProposalResponse:a,sessionSettlementRequest:l},opts:Ew(xw({},s),{publishMethod:"wc_approveSession"})})}),kw(this,"sendResult",async e=>{const{id:t,topic:r,result:i,throwOnFailedPublish:s,encodeOpts:o,appLink:a}=e,c=(0,Yp.formatJsonRpcResult)(t,i);let l;const u=a&&typeof(null==n.g?void 0:n.g.Linking)<"u";try{const e=u?ch:ah;l=await this.client.core.crypto.encode(r,c,Ew(xw({},o||{}),{encoding:e}))}catch(p){throw await this.cleanup(),this.client.logger.error("sendResult() -> core.crypto.encode() for topic ".concat(r," failed")),p}let d,h;try{d=await this.client.core.history.get(r,t);const e=d.request;try{h=this.getTVFParams(t,e.params,i)}catch(st){this.client.logger.warn("sendResult() -> getTVFParams() failed: ".concat(null===st||void 0===st?void 0:st.message))}}
2catch(p){throw this.client.logger.error("sendResult() -> history.get(".concat(r,", ").concat(t,") failed")),p}if(u){const e=Bh(a,r,l);await n.g.Linking.openURL(e,this.client.name)}else{const e=d.request.method,n=cw[e].res;n.tvf=Ew(xw({},h),{correlationId:t}),s?(n.internal=Ew(xw({},n.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,l,n)):this.client.core.relayer.publish(r,l,n).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(c)}),kw(this,"sendError",async e=>{const{id:t,topic:r,error:i,encodeOpts:s,rpcOpts:o,appLink:a}=e,c=(0,Yp.formatJsonRpcError)(t,i);let l;const u=a&&typeof(null==n.g?void 0:n.g.Linking)<"u";try{const e=u?ch:ah;l=await this.client.core.crypto.encode(r,c,Ew(xw({},s||{}),{encoding:e}))}catch(ot){throw await this.cleanup(),this.client.logger.error("sendError() -> core.crypto.encode() for topic ".concat(r," failed")),ot}let d;try{d=await this.client.core.history.get(r,t)}catch(ot){throw this.client.logger.error("sendError() -> history.get(".concat(r,", ").concat(t,") failed")),ot}if(u){const e=Bh(a,r,l);await n.g.Linking.openURL(e,this.client.name)}else{const e=d.request.method,t=o||cw[e].res;this.client.core.relayer.publish(r,l,t)}await this.client.core.history.resolve(c)}),kw(this,"cleanup",async()=>{const e=[],t=[];this.client.session.getAll().forEach(t=>{let n=!1;na(t.expiry)&&(n=!0),this.client.core.crypto.keychain.has(t.topic)||(n=!0),n&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{na(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])}),kw(this,"onProviderMessageEvent",async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)}),kw(this,"onRelayEventRequest",async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()}),kw(this,"processRequestsQueue",async()=>{if(this.requestQueue.state!==dw){for(this.client.logger.info("Request queue starting with ".concat(this.requestQueue.queue.length," requests"));this.requestQueue.queue.length>0;){this.requestQueue.state=dw;const e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(Qe){this.client.logger.warn(Qe)}}this.requestQueue.state=uw}else this.client.logger.info("Request queue already active, skipping...")}),kw(this,"processRequest",async e=>{const{topic:t,payload:n,attestation:r,transportType:i,encryptedId:s}=e,o=n.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:o}))switch(o){case"wc_sessionPropose":return await this.onSessionProposeRequest
2({topic:t,payload:n,attestation:r,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,n);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,n);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,n);case"wc_sessionPing":return await this.onSessionPingRequest(t,n);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,n);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:n,attestation:r,encryptedId:s,transportType:i});case"wc_sessionEvent":return await this.onSessionEventRequest(t,n);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:n,attestation:r,encryptedId:s,transportType:i});default:return this.client.logger.info("Unsupported request method ".concat(o))}}),kw(this,"onRelayEventResponse",async e=>{const{topic:t,payload:n,transportType:r}=e,i=(await this.client.core.history.get(t,n.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(t,n,r);case"wc_sessionSettle":return this.onSessionSettleResponse(t,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,n);case"wc_sessionExtend":return this.onSessionExtendResponse(t,n);case"wc_sessionPing":return this.onSessionPingResponse(t,n);case"wc_sessionRequest":return this.onSessionRequestResponse(t,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,n);default:return this.client.logger.info("Unsupported response method ".concat(i))}}),kw(this,"onRelayEventUnknownPayload",e=>{const{topic:t}=e,{message:n}=ep("MISSING_OR_INVALID","Decoded payload on topic ".concat(t," is not identifiable as a JSON-RPC request or a response."));throw new Error(n)}),kw(this,"shouldIgnorePairingRequest",e=>{const{topic:t,requestMethod:n}=e,r=this.expectedPairingMethodMap.get(t);return!(!r||r.includes(n))&&!!(r.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),kw(this,"onSessionProposeRequest",async e=>{const{topic:t,payload:n,attestation:r,encryptedId:i}=e,{params:s,id:o}=n;try{const e=this.client.core.eventClient.getEvent({topic:t});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),null!==e&&void 0!==e&&e.setError(og)),this.isValidConnect(xw({},n.params));const a=s.expiryTimestamp||ta(cw.wc_sessionPropose.req.ttl),c=xw({id:o,pairingTopic:t,expiryTimestamp:a,attestation:r,encryptedId:i},s);await this.setProposal(o,c);const l=await this.getVerifyContext({attestationId:r,hash:hh(JSON.stringify(n)),encryptedId:i,metadata:c.proposer.metadata});null!==e&&void 0!==e&&e.addTrace(eg),this.client.events.emit("session_proposal",{id:o,params:c,verifyContext:l})}catch(a){await this.sendError({id:o,topic:t,error:a,rpcOpts:cw.wc_sessionPropose.autoReject}),this.client.logger.error(a)}}),kw(this,"onSessionProposeResponse",async(e,t,n)=>{const{id:r}=t;if((0,Yp.isJsonRpcResult)(t)){const{result:i}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});const s=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});const o=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:o});const a=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});const c=await this.client.core.crypto.generateSharedKey(o,a);this.pendingSessions.set(r,{sessionTopic:c,pairingTopic:e,proposalId:r,publicKey:o});const l=await this.client.core.relayer.subscribe(c,{transportType:n});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if((0,Yp.isJsonRpcError)(t)){await this.deleteProposal(r);const e=ra("session_connect",r);if(0===this.events.listenerCount(e))throw new Error("emitting ".concat(e," without any listeners, 954"));this.events.emit(e,{error:t.error})}}),kw(this,"onSessionSettleRequest",async(e,t)=>{const{id:n,params:r}=t;try{this.isValidSessionSettleRequest(r);const{relay:n,controller:i,expiry:s,namespaces:o,sessionProperties:a,scopedProperties:c,sessionConfig:l}=t.params,u=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!u)return this.client.logger.error("Pending session not found for topic ".concat(e));const d=this.client.proposal.get(u.proposalId),h=Ew(xw(xw(xw({topic:e,relay:n,expiry:s,namespaces:o,acknowledged:!0,pairingTopic:u.pairingTopic,requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces,controller:i.publicKey,self:{publicKey:u.publicKey,metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},a&&{sessionProperties:a}),c&&{scopedProperties:c}),l&&{sessionConfig:l}),{transportType:bf.relay});await this.client.session.set(h.topic,h),await this.setExpiry(h.topic,h.expiry),await this.client.core.pairing.updateMetadata({topic:u.pairingTopic,metadata:h.peer.metadata}),this.client.events.emit("session_connect",{session:h}),this.events.emit(ra("session_connect",u.proposalId),{session:h}),this.pendingSessions.delete(u.proposalId),this.deleteProposal(u.proposalId,!1),this.cleanupDupl
2icatePairings(h),await this.sendResult({id:t.id,topic:e,result:!0})}catch(Je){await this.sendError({id:n,topic:e,error:Je}),this.client.logger.error(Je)}}),kw(this,"onSessionSettleResponse",async(e,t)=>{const{id:n}=t;(0,Yp.isJsonRpcResult)(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(ra("session_approve",n),{})):(0,Yp.isJsonRpcError)(t)&&(await this.client.session.delete(e,tp("USER_DISCONNECTED")),this.events.emit(ra("session_approve",n),{error:t.error}))}),kw(this,"onSessionUpdateRequest",async(e,t)=>{const{params:n,id:r}=t;try{const t="".concat(e,"_session_update"),s=xp.get(t);if(s&&this.isRequestOutOfSync(s,r))return this.client.logger.warn("Discarding out of sync request - ".concat(r)),void this.sendError({id:r,topic:e,error:tp("INVALID_UPDATE_REQUEST")});this.isValidUpdate(xw({topic:e},n));try{xp.set(t,r),await this.client.session.update(e,{namespaces:n.namespaces}),await this.sendResult({id:r,topic:e,result:!0})}catch(i){throw xp.delete(t),i}this.client.events.emit("session_update",{id:r,topic:e,params:n})}catch(Je){await this.sendError({id:r,topic:e,error:Je}),this.client.logger.error(Je)}}),kw(this,"isRequestOutOfSync",(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3)),kw(this,"onSessionUpdateResponse",(e,t)=>{const{id:n}=t,r=ra("session_update",n);if(0===this.events.listenerCount(r))throw new Error("emitting ".concat(r," without any listeners"));(0,Yp.isJsonRpcResult)(t)?this.events.emit(ra("session_update",n),{}):(0,Yp.isJsonRpcError)(t)&&this.events.emit(ra("session_update",n),{error:t.error})}),kw(this,"onSessionExtendRequest",async(e,t)=>{const{id:n}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,ta(aw)),await this.sendResult({id:n,topic:e,result:!0}),this.client.events.emit("session_extend",{id:n,topic:e})}catch(r){await this.sendError({id:n,topic:e,error:r}),this.client.logger.error(r)}}),kw(this,"onSessionExtendResponse",(e,t)=>{const{id:n}=t,r=ra("session_extend",n);if(0===this.events.listenerCount(r))throw new Error("emitting ".concat(r," without any listeners"));(0,Yp.isJsonRpcResult)(t)?this.events.emit(ra("session_extend",n),{}):(0,Yp.isJsonRpcError)(t)&&this.events.emit(ra("session_extend",n),{error:t.error})}),kw(this,"onSessionPingRequest",async(e,t)=>{const{id:n}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:n,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:n,topic:e})}catch(r){await this.sendError({id:n,topic:e,error:r}),this.client.logger.error(r)}}),kw(this,"onSessionPingResponse",(e,t)=>{const{id:n}=t,r=ra("session_ping",n);setTimeout(()=>{if(0===this.events.listenerCount(r))throw new Error("emitting ".concat(r," without any listeners 2176"));(0,Yp.isJsonRpcResult)(t)?this.events.emit(ra("session_ping",n),{}):(0,Yp.isJsonRpcError)(t)&&this.events.emit(ra("session_ping",n),{error:t.error})},500)}),kw(this,"onSessionDeleteRequest",async(e,t)=>{const{id:n}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise(t=>{this.client.core.relayer.once(ff,async()=>{t(await this.deleteSession({topic:e,id:n}))})}),this.sendResult({id:n,topic:e,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:tp("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(r){this.client.logger.error(r)}}),kw(this,"onSessionRequest",async e=>{var t,n,r;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=e,{id:l,params:u}=s;try{await this.isValidRequest(xw({topic:i},u));const e=this.client.session.get(i),s={id:l,topic:i,params:u,verifyContext:await this.getVerifyContext({attestationId:o,hash:hh(JSON.stringify((0,Yp.formatJsonRpcRequest)("wc_sessionRequest",u,l))),encryptedId:a,metadata:e.peer.metadata,transportType:c})};await this.setPendingSessionRequest(s),c===bf.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(n=e.peer.metadata.redirect)?void 0:n.universal),null!=(r=this.client.signConfig)&&r.disableRequestQueue?this.emitSessionRequest(s):(this.addSessionRequestToSessionRequestQueue(s),this.processSessionRequestQueue())}
2catch(ot){await this.sendError({id:l,topic:i,error:ot}),this.client.logger.error(ot)}}),kw(this,"onSessionRequestResponse",(e,t)=>{const{id:n}=t,r=ra("session_request",n);if(0===this.events.listenerCount(r))throw new Error("emitting ".concat(r," without any listeners"));(0,Yp.isJsonRpcResult)(t)?this.events.emit(ra("session_request",n),{result:t.result}):(0,Yp.isJsonRpcError)(t)&&this.events.emit(ra("session_request",n),{error:t.error})}),kw(this,"onSessionEventRequest",async(e,t)=>{const{id:n,params:r}=t;try{const t="".concat(e,"_session_event_").concat(r.event.name),i=xp.get(t);if(i&&this.isRequestOutOfSync(i,n))return void this.client.logger.info("Discarding out of sync request - ".concat(n));this.isValidEmit(xw({topic:e},r)),this.client.events.emit("session_event",{id:n,topic:e,params:r}),xp.set(t,n)}catch(Je){await this.sendError({id:n,topic:e,error:Je}),this.client.logger.error(Je)}}),kw(this,"onSessionAuthenticateResponse",(e,t)=>{const{id:n}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),(0,Yp.isJsonRpcResult)(t)?this.events.emit(ra("session_request",n),{result:t.result}):(0,Yp.isJsonRpcError)(t)&&this.events.emit(ra("session_request",n),{error:t.error})}),kw(this,"onSessionAuthenticateRequest",async e=>{var t;const{topic:n,payload:r,attestation:i,encryptedId:s,transportType:o}=e;try{const{requester:e,authPayload:a,expiryTimestamp:c}=r.params,l=await this.getVerifyContext({attestationId:i,hash:hh(JSON.stringify(r)),encryptedId:s,metadata:e.metadata,transportType:o}),u={requester:e,pairingTopic:n,id:r.id,authPayload:a,verifyContext:l,expiryTimestamp:c};await this.setAuthRequest(r.id,{request:u,pairingTopic:n,transportType:o}),o===bf.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:n,params:r.params,id:r.id,verifyContext:l})}catch(a){this.client.logger.error(a);const e=r.params.requester.publicKey,t=await this.client.core.crypto.generateKeyPair(),i=this.getAppLinkIfEnabled(r.params.requester.metadata,o),s={type:1,receiverPublicKey:e,senderPublicKey:t};await this.sendError({id:r.id,topic:n,error:a,encodeOpts:s,rpcOpts:cw.wc_sessionAuthenticate.autoReject,appLink:i})}}),kw(this,"addSessionRequestToSessionRequestQueue",e=>{this.sessionRequestQueue.queue.push(e)}),kw(this,"cleanupAfterResponse",e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=uw,this.processSessionRequestQueue()},(0,_i.toMiliseconds)(this.requestQueueDelay))}),kw(this,"cleanupPendingSentRequestsForTopic",e=>{let{topic:t,error:n}=e;const r=this.client.core.history.pending;r.length>0&&r.filter(e=>e.topic===t&&"wc_sessionRequest"===e.request.method).forEach(e=>{const t=ra("session_request",e.request.id);if(0===this.events.listenerCount(t))throw new Error("emitting ".concat(t," without any listeners"));this.events.emit(ra("session_request",e.request.id),{error:n})})}),kw(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===dw)return void this.client.logger.info("session request queue is already active.");const e=this.sessionRequestQueue.queue[0];if(e)try{this.emitSessionRequest(e)}catch(Qe){this.client.logger.error(Qe)}else this.client.logger.info("session request queue is empty.")}),kw(this,"emitSessionRequest",e=>{this.emittedSessionRequests.has(e.id)?this.client.logger.warn({id:e.id},"Skipping emitting `session_request` event for duplicate request. id: ".concat(e.id)):(this.sessionRequestQueue.state=dw,this.emittedSessionRequests.add(e.id),this.client.events.emit("session_request",e))}),kw(this,"onPairingCreated",e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;const t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);
2t&&this.onSessionProposeRequest({topic:e.topic,payload:(0,Yp.formatJsonRpcRequest)("wc_sessionPropose",Ew(xw({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties}),t.id),attestation:t.attestation,encryptedId:t.encryptedId})}),kw(this,"isValidConnect",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","connect() params: ".concat(JSON.stringify(e)));throw new Error(t)}const{pairingTopic:t,requiredNamespaces:n,optionalNamespaces:r,sessionProperties:i,scopedProperties:s,relays:o}=e;if(ip(t)||await this.isValidPairingTopic(t),!function(e,t){let n=!1;return t&&!e?n=!0:e&&np(e)&&e.length&&e.forEach(e=>{n=pp(e)}),n}(o,!0)){const{message:e}=ep("MISSING_OR_INVALID","connect() relays: ".concat(o));throw new Error(e)}if(n&&!ip(n)&&0!==rp(n)){const e="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(e):this.client.logger.warn(e),this.validateNamespaces(n,"requiredNamespaces")}if(r&&!ip(r)&&0!==rp(r)&&this.validateNamespaces(r,"optionalNamespaces"),i&&!ip(i)&&this.validateSessionProps(i,"sessionProperties"),s&&!ip(s)){this.validateSessionProps(s,"scopedProperties");const e=Object.keys(n||{}).concat(Object.keys(r||{}));if(!Object.keys(s).every(t=>e.includes(t.split(":")[0])))throw new Error("Scoped properties must be a subset of required/optional namespaces, received: ".concat(JSON.stringify(s),", required/optional namespaces: ").concat(JSON.stringify(e)))}}),kw(this,"validateNamespaces",(e,t)=>{const n=function(e,t,n){let r=null;if(e&&rp(e)){const i=dp(e,t);i&&(r=i);const s=lp(e,t,n);s&&(r=s)}else r=ep("MISSING_OR_INVALID","".concat(t,", ").concat(n," should be an object with data"));return r}(e,"connect()",t);if(n)throw new Error(n.message)}),kw(this,"isValidApprove",async e=>{if(!fp(e))throw new Error(ep("MISSING_OR_INVALID","approve() params: ".concat(e)).message);const{id:t,namespaces:n,relayProtocol:r,sessionProperties:i,scopedProperties:s}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);const o=this.client.proposal.get(t),a=hp(n,"approve()");if(a)throw new Error(a.message);const c=vp(o.requiredNamespaces,n,"approve()");if(c)throw new Error(c.message);if(!sp(r,!0)){const{message:e}=ep("MISSING_OR_INVALID","approve() relayProtocol: ".concat(r));throw new Error(e)}if(i&&!ip(i)&&this.validateSessionProps(i,"sessionProperties"),s&&!ip(s)){this.validateSessionProps(s,"scopedProperties");const e=new Set(Object.keys(n));if(!Object.keys(s).every(t=>e.has(t.split(":")[0])))throw new Error("Scoped properties must be a subset of approved namespaces, received: ".concat(JSON.stringify(s),", approved namespaces: ").concat(Array.from(e).join(", ")))}}),kw(this,"isValidReject",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","reject() params: ".concat(e));throw new Error(t)}const{id:t,reason:n}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!function(e){return!(!e||"object"!=typeof e||!e.code||!op(e.code,!1)||!e.message||!sp(e.message,!1))}(n)){const{message:e}=ep("MISSING_OR_INVALID","reject() reason: ".concat(JSON.stringify(n)));throw new Error(e)}}),kw(this,"isValidSessionSettleRequest",e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","onSessionSettleRequest() params: ".concat(e));throw new Error(t)}const{relay:t,controller:n,namespaces:r,expiry:i}=e;if(!pp(t)){const{message:e}=ep("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(e)}const s=function(e,t){let n=null;return sp(null===e||void 0===e?void 0:e.publicKey,!1)||(n=ep("MISSING_OR_INVALID","".concat(t," controller public key should be a string"))),n}(n,"onSessionSettleRequest()");if(s)throw new Error(s.message);const o=hp(r,"onSessionSettleRequest()");if(o)throw new Error(o.message);if(na(i)){const{message:e}=ep("EXPIRED","onSessionSettleRequest()");throw new Error(e)}}),kw(this,"isValidUpdate",async e=>{if(!fp(e)){const{message:t}
2=ep("MISSING_OR_INVALID","update() params: ".concat(e));throw new Error(t)}const{topic:t,namespaces:n}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const r=this.client.session.get(t),i=hp(n,"update()");if(i)throw new Error(i.message);const s=vp(r.requiredNamespaces,n,"update()");if(s)throw new Error(s.message)}),kw(this,"isValidExtend",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","extend() params: ".concat(e));throw new Error(t)}const{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)}),kw(this,"isValidRequest",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","request() params: ".concat(e));throw new Error(t)}const{topic:t,request:n,chainId:r,expiry:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);const{namespaces:s}=this.client.session.get(t);if(!gp(s,r)){const{message:e}=ep("MISSING_OR_INVALID","request() chainId: ".concat(r));throw new Error(e)}if(!function(e){return!(ip(e)||!sp(e.method,!1))}(n)){const{message:e}=ep("MISSING_OR_INVALID","request() ".concat(JSON.stringify(n)));throw new Error(e)}if(!mp(s,r,n.method)){const{message:e}=ep("MISSING_OR_INVALID","request() method: ".concat(n.method));throw new Error(e)}if(i&&!function(e,t){return op(e,!1)&&e<=t.max&&e>=t.min}(i,lw)){const{message:e}=ep("MISSING_OR_INVALID","request() expiry: ".concat(i,". Expiry must be a number (in seconds) between ").concat(lw.min," and ").concat(lw.max));throw new Error(e)}}),kw(this,"isValidRespond",async e=>{var t;if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","respond() params: ".concat(e));throw new Error(t)}const{topic:n,response:r}=e;try{await this.isValidSessionTopic(n)}catch(He){throw null!=(t=null===e||void 0===e?void 0:e.response)&&t.id&&this.cleanupAfterResponse(e),He}if(!function(e){return!(ip(e)||ip(e.result)&&ip(e.error)||!op(e.id,!1)||!sp(e.jsonrpc,!1))}(r)){const{message:e}=ep("MISSING_OR_INVALID","respond() response: ".concat(JSON.stringify(r)));throw new Error(e)}const i=this.client.pendingRequest.get(r.id);if(i.topic!==n){const{message:e}=ep("MISMATCHED_TOPIC","Request response topic mismatch. reqId: ".concat(r.id,", expected topic: ").concat(i.topic,", received topic: ").concat(n));throw new Error(e)}}),kw(this,"isValidPing",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","ping() params: ".concat(e));throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),kw(this,"isValidEmit",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","emit() params: ".concat(e));throw new Error(t)}const{topic:t,event:n,chainId:r}=e;await this.isValidSessionTopic(t);const{namespaces:i}=this.client.session.get(t);if(!gp(i,r)){const{message:e}=ep("MISSING_OR_INVALID","emit() chainId: ".concat(r));throw new Error(e)}if(!function(e){return!(ip(e)||!sp(e.name,!1))}(n)){const{message:e}=ep("MISSING_OR_INVALID","emit() event: ".concat(JSON.stringify(n)));throw new Error(e)}if(!yp(i,r,n.name)){const{message:e}=ep("MISSING_OR_INVALID","emit() event: ".concat(JSON.stringify(n)));throw new Error(e)}}),kw(this,"isValidDisconnect",async e=>{if(!fp(e)){const{message:t}=ep("MISSING_OR_INVALID","disconnect() params: ".concat(e));throw new Error(t)}const{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),kw(this,"isValidAuthenticate",e=>{const{chains:t,uri:n,domain:r,nonce:i}=e;if(!Array.isArray(t)||0===t.length)throw new Error("chains is required and must be a non-empty array");if(!sp(n,!1))throw new Error("uri is required parameter");if(!sp(r,!1))throw new Error("domain is required parameter");if(!sp(i,!1))throw new Error("nonce is required parameter");if([...new Set(t.map(e=>_o(e).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:s}=_o(t[0]);if("eip155"!==s)throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),kw(this,"getVerifyContext",async e=>{const{attestationId:t,hash:n,encryptedId:r,metadata:i,transportType:s}=e,o={verified:{verifyUrl:i.verifyUrl||Wf,validation:"UNKNOWN",origin:i.url||""}};try{if(s===bf.link_mode){const e=this.getAppLinkIfEnabled(i,s);return o.verified.validation=e&&new URL(e).origin===new URL(i.url).origin?"VALID":"INVALID",o}const e=await this.client.core.verify.resolve({attestationId:t,hash:n,encryptedId:r,verifyUrl:i.verifyUrl});e&&(o.verified.origin=e.origin,o.verified.isScam=e.isScam,o.verified.validation=e.origin===new URL(i.url).origin?"VALID":"INVALID")}catch(a){this.client.logger.warn(a)}return this.client.logger.debug("Verify context: ".concat(JSON.stringify(o))),o}),kw(this,"validateSessionProps",(e,t)=>{Object.values(e).forEach((n,r)=>{if(null==n){const{message:i}=ep("MISSING_OR_INVALID","".concat(t," must contain an existing value for each key. Received: ").concat(n," for key ").concat(Object.keys(e)[r]));throw new Error(i)}})}),kw(this,"getPendingAuthRequest",e=>{const t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0}),kw(this,"addToRecentlyDeleted",(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0;const t=this.recentlyDeletedLimit/2;
2for(const n of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(n)}}}),kw(this,"checkRecentlyDeleted",e=>{const t=this.recentlyDeletedMap.get(e);if(t){const{message:n}=ep("MISSING_OR_INVALID","Record was recently deleted - ".concat(t,": ").concat(e));throw new Error(n)}}),kw(this,"isLinkModeEnabled",(e,t)=>{var r,i,s,o,a,c,l,u,d;return!(!e||t!==bf.link_mode)&&(!0===(null==(i=null==(r=this.client.metadata)?void 0:r.redirect)?void 0:i.linkMode)&&void 0!==(null==(o=null==(s=this.client.metadata)?void 0:s.redirect)?void 0:o.universal)&&""!==(null==(c=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:c.universal)&&void 0!==(null==(l=null===e||void 0===e?void 0:e.redirect)?void 0:l.universal)&&""!==(null==(u=null===e||void 0===e?void 0:e.redirect)?void 0:u.universal)&&!0===(null==(d=null===e||void 0===e?void 0:e.redirect)?void 0:d.linkMode)&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&typeof(null==n.g?void 0:n.g.Linking)<"u")}),kw(this,"getAppLinkIfEnabled",(e,t)=>{var n;return this.isLinkModeEnabled(e,t)?null==(n=null===e||void 0===e?void 0:e.redirect)?void 0:n.universal:void 0}),kw(this,"handleLinkModeMessage",e=>{let{url:t}=e;if(!t||!t.includes("wc_ev")||!t.includes("topic"))return;const n=oa(t,"topic")||"",r=decodeURIComponent(oa(t,"wc_ev")||""),i=this.client.session.keys.includes(n);i&&this.client.session.update(n,{transportType:bf.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:r,sessionExists:i})}),kw(this,"registerLinkModeListeners",async()=>{var e;if(ca()||Fo()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){const e=null==n.g?void 0:n.g.Linking;if(typeof e<"u"){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);const t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}),kw(this,"getTVFParams",(e,t,n)=>{var r,i,s;if(null==(r=t.request)||!r.method)return{};const o={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{const e=this.extractTxHashesFromResult(t.request,n);o.txHashes=e,o.contractAddresses=this.isValidContractData(t.request.params)?[null==(s=null==(i=t.request.params)?void 0:i[0])?void 0:s.to]:[]}catch(a){this.client.logger.warn(a,"Error getting TVF params")}return o}),kw(this,"isValidContractData",e=>{var t;if(!e)return!1;try{const n=(null===e||void 0===e?void 0:e.data)||(null==(t=null===e||void 0===e?void 0:e[0])?void 0:t.data);if(!n.startsWith("0x"))return!1;const r=n.slice(2);return!!/^[0-9a-fA-F]*$/.test(r)&&r.length%2===0}catch(n){}return!1}),kw(this,"extractTxHashesFromResult",(t,n)=>{var r;try{if(!n)return[];const i=t.method,s=hw[i];if("sui_signTransaction"===i)return[il(n.transactionBytes)];if("near_signTransaction"===i)return[sl(n)];if("near_signTransactions"===i)return n.map(e=>sl(e));if("xrpl_signTransactionFor"===i||"xrpl_signTransaction"===i)return[null==(r=n.tx_json)?void 0:r.hash];if("polkadot_signTransaction"===i)return[Sp({transaction:t.params.transactionPayload,signature:n.signature})];if("algo_signTxn"===i)return np(n)?n.map(e=>ol(e)):[ol(n)];if("cosmos_signDirect"===i)return[cl(n)];if("wallet_sendCalls"===i)return function(t){var n,r;const i=[];try{if("string"==typeof t)return i.push(t),i;if("object"!=typeof t)return i;null!=t&&t.id&&i.push(t.id);const e=null==(r=null==(n=null===t||void 0===t?void 0:t.capabilities)?void 0:n.caip345)?void 0:r.transactionHashes;e&&i.push(...e)}catch(e){console.warn("getWalletSendCallsHashes failed: ",e)}return i}(n);if("string"==typeof n)return[n];const o=n[s.key];if(np(o))return"solana_signAllTransactions"===i?o.map(e=>function(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);const r=n[0];if(0===r)throw new Error("No signatures found");const i=1+64*r;if(n.length<i)throw new Error("Transaction data too short for claimed signature count");if(n.length<100)throw new Error("Transaction too short");const s=Buffer.from(e,"base64").slice(1,65);return Ls.A.encode(s)}(e)):o;if("string"==typeof o)return[o]}catch(i){this.client.logger.warn(i,"Error extracting tx hashes from result")}return[]})}async processPendingMessageEvents(){try{const t=this.client.session.keys,n=this.client.core.relayer.messages.getWithoutAck(t);for(const[r,i]of Object.entries(n))for(const t of i)try{await this.onProviderMessageEvent({topic:r,message:t,publishedAt:Date.now()})}catch(e){this.client.logger.warn("Error processing pending message event for topic: ".concat(r,", message: ").concat(t))}}catch(t){this.client.logger.warn(t,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){const{message:e}=ep("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(cf,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:t,message:n,attestation:r,transportType:i}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(gw)?this.client.auth.authKeys.get(gw):{responseTopic:void 0,publicKey:void 0};try{const e=await this.client.core.crypto.decode(t,n,{receiverPublicKey:s,encoding:i===bf.link_mode?ch:ah});(0,Yp.isJsonRpcRequest)(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:r,transportType:i,encryptedId:hh(n)})):(0,Yp.isJsonRpcResponse)(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:i}),this.client.core.history.delete(t,e.id)):await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:i}),await this.client.core.relayer.messages.ack(t,n)}catch(He){this.client.logger.error(He)}}registerExpirerEvents(){this.client.core.expirer.on(jf,async e=>
2{const{topic:t,id:n}=ea(e.target);return n&&this.client.pendingRequest.keys.includes(n)?await this.deletePendingSessionRequest(n,ep("EXPIRED"),!0):n&&this.client.auth.requests.keys.includes(n)?await this.deletePendingAuthRequest(n,ep("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n})))})}registerPairingEvents(){this.client.core.pairing.events.on(Cf,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Of,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!sp(e,!1)){const{message:t}=ep("MISSING_OR_INVALID","pairing topic should be a string: ".concat(e));throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ep("NO_MATCHING_KEY","pairing topic doesn't exist: ".concat(e));throw new Error(t)}if(na(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=ep("EXPIRED","pairing topic: ".concat(e));throw new Error(t)}}async isValidSessionTopic(e){if(!sp(e,!1)){const{message:t}=ep("MISSING_OR_INVALID","session topic should be a string: ".concat(e));throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=ep("NO_MATCHING_KEY","session topic doesn't exist: ".concat(e));throw new Error(t)}if(na(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=ep("EXPIRED","session topic: ".concat(e));throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=ep("MISSING_OR_INVALID","session topic does not exist in keychain: ".concat(e));throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else{if(!this.client.core.pairing.pairings.keys.includes(e)){if(sp(e,!1)){const{message:t}=ep("NO_MATCHING_KEY","session or pairing topic doesn't exist: ".concat(e));throw new Error(t)}{const{message:t}=ep("MISSING_OR_INVALID","session or pairing topic should be a string: ".concat(e));throw new Error(t)}}this.isValidPairingTopic(e)}}async isValidProposalId(e){if(!function(e){return"number"==typeof e}(e)){const{message:t}=ep("MISSING_OR_INVALID","proposal id should be a number: ".concat(e));throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=ep("NO_MATCHING_KEY","proposal id doesn't exist: ".concat(e));throw new Error(t)}if(na(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=ep("EXPIRED","proposal id: ".concat(e));throw new Error(t)}}}class Iw extends _v{constructor(e,t){super(e,t,"proposal",nw),this.core=e,this.logger=t}}class Tw extends _v{constructor(e,t){super(e,t,"session",nw),this.core=e,this.logger=t}}class Cw extends _v{constructor(e,t){super(e,t,"request",nw,e=>e.id),this.core=e,this.logger=t}}class Pw extends _v{constructor(e,t){super(e,t,"authKeys",fw,()=>gw),this.core=e,this.logger=t}}class Ow extends _v{constructor(e,t){super(e,t,"pairingTopics",fw),this.core=e,this.logger=t}}class Nw extends _v{constructor(e,t){super(e,t,"requests",fw,e=>e.id),this.core=e,this.logger=t}}var Rw=Object.defineProperty,Mw=(e,t,n)=>((e,t,n)=>t in e?Rw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Uw{constructor(e,t){this.core=e,this.logger=t,Mw(this,"authKeys"),Mw(this,"pairingTopics"),Mw(this,"requests"),this.authKeys=new Pw(this.core,this.logger),this.pairingTopics=new Ow(this.core,this.logger),this.requests=new Nw(this.core,this.logger)}
2async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var Lw=Object.defineProperty,Bw=(e,t,n)=>((e,t,n)=>t in e?Lw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class Dw extends Jp{constructor(e){super(e),Bw(this,"protocol","wc"),Bw(this,"version",2),Bw(this,"name",rw),Bw(this,"metadata"),Bw(this,"core"),Bw(this,"logger"),Bw(this,"events",new wi.EventEmitter),Bw(this,"engine"),Bw(this,"session"),Bw(this,"proposal"),Bw(this,"pendingRequest"),Bw(this,"auth"),Bw(this,"signConfig"),Bw(this,"on",(e,t)=>this.events.on(e,t)),Bw(this,"once",(e,t)=>this.events.once(e,t)),Bw(this,"off",(e,t)=>this.events.off(e,t)),Bw(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),Bw(this,"removeAllListeners",e=>this.events.removeAllListeners(e)),Bw(this,"connect",async e=>{try{return await this.engine.connect(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"pair",async e=>{try{return await this.engine.pair(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"approve",async e=>{try{return await this.engine.approve(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"reject",async e=>{try{return await this.engine.reject(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"update",async e=>{try{return await this.engine.update(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"extend",async e=>{try{return await this.engine.extend(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"request",async e=>{try{return await this.engine.request(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"respond",async e=>{try{return await this.engine.respond(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"ping",async e=>{try{return await this.engine.ping(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"emit",async e=>{try{return await this.engine.emit(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"disconnect",async e=>{try{return await this.engine.disconnect(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"find",e=>{try{return this.engine.find(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(Qe){throw this.logger.error(Qe.message),Qe}}),Bw(this,"authenticate",async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(n){throw this.logger.error(n.message),n}}),Bw(this,"formatAuthMessage",e=>{try{return this.engine.formatAuthMessage(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"approveSessionAuthenticate",async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(t){throw this.logger.error(t.message),t}}),Bw(this,"rejectSessionAuthenticate",async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(t){throw this.logger.error(t.message),t}}),this.name=(null===e||void 0===e?void 0:e.name)||rw,this.metadata=Ho(null===e||void 0===e?void 0:e.metadata),this.signConfig=null===e||void 0===e?void 0:e.signConfig;const t=Ip({logger:(null===e||void 0===e?void 0:e.logger)||iw,name:this.name});this.logger=t,this.core=(null===e||void 0===e?void 0:e.core)||new ew(e),this.session=new Tw(this.core,this.logger),this.proposal=new Iw(this.core,this.logger),this.pendingRequest=new Cw(this.core,this.logger),this.engine=new Sw(this),this.auth=new Uw(this.core,this.logger)}static async init(e){const t=new Dw(e);return await t.initialize(),t}get context(){return vo(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}const jw=Dw;var Fw=n(77417);function zw(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function Ww(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}
2function qw(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Hw="[object RegExp]",Vw="[object String]",Gw="[object Number]",Kw="[object Boolean]",Jw="[object Arguments]",Zw="[object Symbol]",Qw="[object Date]",Yw="[object Map]",Xw="[object Set]",$w="[object Array]",eb="[object ArrayBuffer]",tb="[object Object]",nb="[object DataView]",rb="[object Uint8Array]",ib="[object Uint8ClampedArray]",sb="[object Uint16Array]",ob="[object Uint32Array]",ab="[object Int8Array]",cb="[object Int16Array]",lb="[object Int32Array]",ub="[object Float32Array]",db="[object Float64Array]";function hb(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pb(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;const s=null===i||void 0===i?void 0:i(e,t,n,r);if(null!=s)return s;if(zw(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const t=new Array(e.length);r.set(e,t);for(let s=0;s<e.length;s++)t[s]=pb(e[s],s,n,r,i);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;r.set(e,t);for(const[s,o]of e)t.set(s,pb(o,s,n,r,i));return t}if(e instanceof Set){const t=new Set;r.set(e,t);for(const s of e)t.add(pb(s,void 0,n,r,i));return t}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(hb(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);r.set(e,t);for(let s=0;s<e.length;s++)t[s]=pb(e[s],s,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),fb(t,e,n,r,i),t}if(typeof File<"u"&&e instanceof File){const t=new File([e],e.name,{type:e.type});return r.set(e,t),fb(t,e,n,r,i),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return r.set(e,t),fb(t,e,n,r,i),t}if(e instanceof Error){const t=new e.constructor;return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,fb(t,e,n,r,i),t}if("object"==typeof e&&function(e){switch(qw(e)){case Jw:case $w:case eb:case nb:case Kw:case Qw:case ub:case db:case ab:case cb:case lb:case Yw:case Gw:case tb:case Hw:case Xw:case Vw:case Zw:case rb:case ib:case sb:case ob:return!0;default:return!1}}(e)){const t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),fb(t,e,n,r,i),t}return e}function fb(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;const s=[...Object.keys(t),...Ww(t)];for(let o=0;o<s.length;o++){const a=s[o],c=Object.getOwnPropertyDescriptor(e,a);(null==c||c.writable)&&(e[a]=pb(t[a],a,n,r,i))}}function gb(e,t){return function(e,t){return pb(e,void 0,e,new Map,t)}(e,(n,r,i,s)=>{const o=null===t||void 0===t?void 0:t(n,r,i,s);if(null!=o)return o;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case Gw:case Vw:case Kw:{const t=new e.constructor(null===e||void 0===e?void 0:e.valueOf());return fb(t,e),t}case Jw:{const t={};return fb(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}})}function mb(e){return gb(e)}function yb(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===qw(e)}function vb(e){return"object"==typeof e&&null!==e}function wb(){}function bb(e){return hb(e)}function Ab(e){if("object"!=typeof e||null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){var t;const n=e[Symbol.toStringTag];return!(null==n||null===(t=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))||void 0===t||!t.writable)&&e.toString()==="[object ".concat(n,"]")}let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}function _b(e,t,n,r){if(zw(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(r.has(t))return function(e){if(zw(e))return e;if(Array.isArray(e)||hb(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e),n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){const t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){const t=new n(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}if(typeof File<"u"&&e instanceof File)return new n([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const n=Object.create(t);return Object.assign(n,e)}return e}(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++){var s;t[e]=null!==(s=t[e])&&void 0!==s?s:void 0}}const o=[...Object.keys(t),...Ww(t)];for(let a=0;a<o.length;a++){const s=o[a];let c=t[s],l=e[s];if(yb(c)&&(c=(0,i.A)({},c)),yb(l)&&(l=(0,i.A)({},l)),typeof Buffer<"u"&&Buffer.isBuffer(c)&&(c=mb(c)),Array.isArray(c))if("object"==typeof l&&null!=l){const e=[],t=Reflect.ownKeys(l);for(let n=0;n<t.length;n++){const r=t[n];e[r]=l[r]}l=e}else l=[];const u=n(l,c,s,e,t,r);null!=u?e[s]=u:Array.isArray(c)||vb(l)&&vb(c)?e[s]=_b(l,c,n,r):null==l&&Ab(c)?e[s]=_b({},c,n,r):null==l&&bb(c)?e[s]=mb(c):(void 0===l||void 0!==c)&&(e[s]=c)}return e}function xb(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=n.slice(0,-1),s=n[n.length-1];let o=e;for(let a=0;a<i.length;a++)o=_b(o,i[a],s,new Map);return o}(e,...n,wb)}const Eb="error",kb="universal_provider",Sb="".concat("wc","@2:").concat(kb,":"),Ib="https://rpc.walletconnect.org/v1/",Tb="generic",Cb="".concat(Ib,"bundler"),Pb="call_status",Ob="default_chain_changed";var Nb=Object.defineProperty,Rb=Object.defineProperties,Mb=Object.getOwnPropertyDescriptors,Ub=Object.getOwnPropertySymbols,Lb=Object.prototype.hasOwnProperty,Bb=Object.prototype.propertyIsEnumerable,Db=(e,t,n
2)=>t in e?Nb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jb=(e,t)=>{for(var n in t||(t={}))Lb.call(t,n)&&Db(e,n,t[n]);if(Ub)for(var n of Ub(t))Bb.call(t,n)&&Db(e,n,t[n]);return e},Fb=(e,t)=>Rb(e,Mb(t));function zb(e,t,n){var r;const i=_o(e);return(null==(r=t.rpcMap)?void 0:r[i.reference])||"".concat(Ib,"?chainId=").concat(i.namespace,":").concat(i.reference,"&projectId=").concat(n)}function Wb(e){return e.map(e=>"".concat(e.split(":")[0],":").concat(e.split(":")[1]))}function qb(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,n]=e;var r,i;return(null==(r=null===n||void 0===n?void 0:n.chains)?void 0:r.length)&&(null==(i=null===n||void 0===n?void 0:n.chains)?void 0:i.length)>0}))}function Hb(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xb(qb(Vb(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})),qb(Vb(e)))}function Vb(e){var t,n,r,i,s;const o={};if(!rp(e))return o;for(const[a,c]of Object.entries(e)){const e=Jh(a)?[a]:c.chains,l=c.methods||[],u=c.events||[],d=c.rpcMap||{},h=Zh(a);o[h]=Fb(jb(jb({},o[h]),c),{chains:ia(e,null==(t=o[h])?void 0:t.chains),methods:ia(l,null==(n=o[h])?void 0:n.methods),events:ia(u,null==(r=o[h])?void 0:r.events)}),(rp(d)||rp((null==(i=o[h])?void 0:i.rpcMap)||{}))&&(o[h].rpcMap=jb(jb({},d),null==(s=o[h])?void 0:s.rpcMap))}return o}function Gb(e){return e.includes(":")?e.split(":")[2]:e}function Kb(e){const t={};for(const[n,r]of Object.entries(e)){const e=r.methods||[],i=r.events||[],s=r.accounts||[],o=Jh(n)?[n]:r.chains?r.chains:Wb(r.accounts);t[n]={chains:o,methods:e,events:i,accounts:s}}return t}function Jb(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):(e=e.includes(":")?e.split(":")[1]:e,isNaN(Number(e))?e:Number(e))}const Zb={},Qb=e=>Zb[e],Yb=(e,t)=>{Zb[e]=t};var Xb=Object.defineProperty,$b=Object.getOwnPropertySymbols,eA=Object.prototype.hasOwnProperty,tA=Object.prototype.propertyIsEnumerable,nA=(e,t,n)=>t in e?Xb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rA=(e,t)=>{for(var n in t||(t={}))eA.call(t,n)&&nA(e,n,t[n]);if($b)for(var n of $b(t))tA.call(t,n)&&nA(e,n,t[n]);return e};const iA="eip155",sA=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],oA=e=>e&&e.startsWith("0x")?BigInt(e).toString(10):e,aA=e=>e&&e.startsWith("0x")?e:"0x".concat(BigInt(e).toString(16)),cA=e=>Object.keys(e).filter(e=>sA.includes(e)).reduce((t,n)=>(t[n]=lA(e[n]),t),{}),lA=e=>"string"==typeof e&&function(e){try{const t=JSON.parse(e);return"object"==typeof t&&null!==t&&!Array.isArray(t)}catch(t){return!1}}(e)?JSON.parse(e):e;var uA=Object.defineProperty,dA=(e,t,n)=>((e,t,n)=>t in e?uA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let hA;class pA{constructor(e){dA(this,"storage"),this.storage=e}async getItem(e){return await this.storage.getItem(e)}async setItem(e,t){return await this.storage.setItem(e,t)}async removeItem(e){return await this.storage.removeItem(e)}static getStorage(e){return hA||(hA=new pA(e)),hA}}var fA=Object.defineProperty,gA=Object.defineProperties,mA=Object.getOwnPropertyDescriptors,yA=Object.getOwnPropertySymbols,vA=Object.prototype.hasOwnProperty,wA=Object.prototype.propertyIsEnumerable,bA=(e,t,n)=>t in e?fA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;async function AA(e,t){const n=_o(e.result.capabilities.caip345.caip2),r=e.result.capabilities.caip345.transactionHashes,i=await Promise.allSettled(r.map(e=>async function(e,t,n){return await n(parseInt(e)).request((0,Yp.formatJsonRpcRequest)("eth_getTransactionReceipt",[t]))}(n.reference,e,t))),s=i.filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>e);i.filter(e=>"rejected"===e.status).forEach(e=>console.warn("Failed to fetch transaction receipt:",e.reason));const o=!s.length||s.some(e=>!e),a=s.every(e=>"0x1"===(null===e||void 0===e?void 0:e.status)),c=s.every(e=>"0x0"===(null===e||void 0===e?void 0:e.status)),l=s.some(e=>"0x0"===(null===e||void 0===e?void 0:e.status));let u;return o?u=100:a?u=200:c?u=500:l&&(u=600),{id:e.result.id,version:e.request.version,atomic:e.request.atomicRequired,chainId:e.request.chainId,capabilities:e.result.capabilities,receipts:s,status:u}}async function _A(e){let{sendCalls:t,storage:n}=e;const r=await n.getItem(Pb);await n.setItem(Pb,((e,t)=>
2gA(e,mA(t)))(((e,t)=>{for(var n in t||(t={}))vA.call(t,n)&&bA(e,n,t[n]);if(yA)for(var n of yA(t))wA.call(t,n)&&bA(e,n,t[n]);return e})({},r),{[t.result.id]:{request:t.request,result:t.result,expiry:ta(86400)}}))}async function xA(e){let{resultId:t,storage:n}=e;const r=await n.getItem(Pb),i=null===r||void 0===r?void 0:r[t];if(i&&!na(i.expiry))return i;await async function(e){let{resultId:t,storage:n}=e;const r=await n.getItem(Pb);if(r){delete r[t],await n.setItem(Pb,r);for(const e in r)na(r[e].expiry)&&delete r[e];await n.setItem(Pb,r)}}({resultId:t,storage:n})}var EA=Object.defineProperty,kA=Object.defineProperties,SA=Object.getOwnPropertyDescriptors,IA=Object.getOwnPropertySymbols,TA=Object.prototype.hasOwnProperty,CA=Object.prototype.propertyIsEnumerable,PA=(e,t,n)=>t in e?EA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OA=(e,t)=>{for(var n in t||(t={}))TA.call(t,n)&&PA(e,n,t[n]);if(IA)for(var n of IA(t))CA.call(t,n)&&PA(e,n,t[n]);return e},NA=(e,t)=>kA(e,SA(t)),RA=(e,t,n)=>PA(e,"symbol"!=typeof t?t+"":t,n);class MA{constructor(e){RA(this,"name","eip155"),RA(this,"client"),RA(this,"chainId"),RA(this,"namespace"),RA(this,"httpProviders"),RA(this,"events"),RA(this,"storage"),this.namespace=e.namespace,this.events=Qb("events"),this.client=Qb("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=pA.getStorage(this.client.core.storage)}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e);case"wallet_sendCalls":return await this.sendCalls(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t);const n=this.chainId;this.chainId=parseInt(e),this.events.emit(Ob,{currentCaipChainId:"".concat(this.name,":").concat(e),previousCaipChainId:"".concat(this.name,":").concat(n)})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const n=t||zb("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));return new Qp.F(new Fw.V(n,Qb("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var n;const r=parseInt(function(e){return e.includes(":")?e.split(":")[1]:e}(t));e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(e){const t=e||this.chainId;return this.httpProviders[t]||(this.httpProviders=NA(OA({},this.httpProviders),{[t]:this.createHttpProvider(t)}),this.httpProviders[t])}async handleSwitchChain(e){var t,n;let r=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0";r=r.startsWith("0x")?r:"0x".concat(r);const i=parseInt(r,16);if(this.isChainApproved(i))this.setDefaultChain("".concat(i));else{if(!this.namespace.methods.includes("wallet_switchEthereumChain"))throw new Error("Failed to switch to chain 'eip155:".concat(i,"'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method."));await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:r}]},chainId:null==(n=this.namespace.chains)?void 0:n[0]}),this.setDefaultChain("".concat(i))}return null}isChainApproved(e){return this.namespace.chains.includes("".concat(this.name,":").concat(e))}async getCapabilities(e){var t,n,r,i,s;const o=null==(n=null==(t=e.request)?void 0:t.params)?void 0:n[0],a=(null==(i=null==(r=e.request)?void 0:r.params)?void 0:i[1])||[];if(!o)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const c=this.client.session.get(e.topic),l=(null==(s=null===c||void 0===c?void 0:c.sessionProperties)?void 0:s.capabilities)||{},u="".concat(o).concat(a.join(",")),d=null===l||void 0===l?void 0:l[u];if(d)return d;let h;try{h=((e,t,n)=>{const{sessionProperties:r={},scopedProperties:i={}}=e,s={};if(!rp(i)&&!rp(r))return;const o=cA(r);for(const a of n){const e=oA(a);if(!e)continue;s[aA(e)]=o;const n=null===i||void 0===i?void 0:i["".concat(iA,":").concat(e)
2];if(n){const r=null===n||void 0===n?void 0:n["".concat(iA,":").concat(e,":").concat(t)];s[aA(e)]=rA(rA({},s[aA(e)]),cA(r||n))}}for(const[a,c]of Object.entries(s))0===Object.keys(c).length&&delete s[a];return Object.keys(s).length>0?s:void 0})(c,o,a)}catch(It){console.warn("Failed to extract capabilities from session",It)}if(h)return h;const p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:NA(OA({},c.sessionProperties||{}),{capabilities:NA(OA({},l||{}),{[u]:p})})})}catch(It){console.warn("Failed to update session with capabilities",It)}return p}async getCallStatus(e){var t,n,r;const i=this.client.session.get(e.topic),s=null==(t=i.sessionProperties)?void 0:t.bundler_name;if(s){const t=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(t,e)}catch(c){console.warn("Failed to fetch call status from bundler",c,t)}}const o=null==(n=i.sessionProperties)?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(l){console.warn("Failed to fetch call status from custom bundler",l,o)}const a=await xA({resultId:null==(r=e.request.params)?void 0:r[0],storage:this.storage});if(a)try{return await AA(a,this.getHttpProvider.bind(this))}catch(l){console.warn("Failed to fetch call status from stored send calls",l,a)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var n;const r=new URL(e),i=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,Yp.formatJsonRpcRequest)("eth_getUserOperationReceipt",[null==(n=t.request.params)?void 0:n[0]]))});if(!i.ok)throw new Error("Failed to fetch user operation receipt - ".concat(i.status));return await i.json()}getBundlerUrl(e,t){return"".concat(Cb,"?projectId=").concat(this.client.core.projectId,"&chainId=").concat(e,"&bundler=").concat(t)}async sendCalls(e){var t,n,r;const i=await this.client.request(e),s=null==(t=e.request.params)?void 0:t[0],o=null===i||void 0===i?void 0:i.id,a=(null===i||void 0===i?void 0:i.capabilities)||{},c=null==(n=null===a||void 0===a?void 0:a.caip345)?void 0:n.caip2,l=null==(r=null===a||void 0===a?void 0:a.caip345)?void 0:r.transactionHashes;return!o||!c||!(null!=l&&l.length)||await _A({sendCalls:{request:s,result:i},storage:this.storage}),i}}var UA=Object.defineProperty,LA=(e,t,n)=>((e,t,n)=>t in e?UA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class BA{constructor(e){LA(this,"name",Tb),LA(this,"client"),LA(this,"httpProviders"),LA(this,"events"),LA(this,"namespace"),LA(this,"chainId"),this.namespace=e.namespace,this.events=Qb("events"),this.client=Qb("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t);const n=this.chainId;this.chainId=e,this.events.emit(Ob,{currentCaipChainId:"".concat(this.name,":").concat(e),previousCaipChainId:"".concat(this.name,":").concat(n)})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getNamespaceName(){const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return _o(e).namespace}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){var e,t;const n={};return null==(t=null==(e=this.namespace)?void 0:e.accounts)||t.forEach(e
2=>{var t,r;const i=_o(e),s=null==(r=null==(t=this.namespace)?void 0:t.rpcMap)?void 0:r["".concat(i.namespace,":").concat(i.reference)];n[i.reference]=this.createHttpProvider(e,s)}),n}getHttpProvider(e){const t=_o(e).reference,n=this.httpProviders[t];if(typeof n>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return n}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||zb(e,this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));return new Qp.F(new Fw.A(n,Qb("disableProviderPing")))}}var DA=Object.defineProperty,jA=Object.defineProperties,FA=Object.getOwnPropertyDescriptors,zA=Object.getOwnPropertySymbols,WA=Object.prototype.hasOwnProperty,qA=Object.prototype.propertyIsEnumerable,HA=(e,t,n)=>t in e?DA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VA=(e,t)=>{for(var n in t||(t={}))WA.call(t,n)&&HA(e,n,t[n]);if(zA)for(var n of zA(t))qA.call(t,n)&&HA(e,n,t[n]);return e},GA=(e,t)=>jA(e,FA(t)),KA=(e,t,n)=>HA(e,"symbol"!=typeof t?t+"":t,n);class JA{constructor(e){var t,n;KA(this,"client"),KA(this,"namespaces"),KA(this,"optionalNamespaces"),KA(this,"sessionProperties"),KA(this,"scopedProperties"),KA(this,"events",new wi),KA(this,"rpcProviders",{}),KA(this,"session"),KA(this,"providerOpts"),KA(this,"logger"),KA(this,"uri"),KA(this,"disableProviderPing",!1),this.providerOpts=e,this.logger=Ip({logger:null!=(t=e.logger)?t:Eb,name:null!=(n=this.providerOpts.name)?n:kb}),this.disableProviderPing=(null===e||void 0===e?void 0:e.disableProviderPing)||!1}static async init(e){const t=new JA(e);return await t.initialize(),t}async request(e,t,n){const[r,i]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(r).request({request:VA({},e),chainId:"".concat(r,":").concat(i),topic:this.session.topic,expiry:n})}sendAsync(e,t,n,r){const i=(new Date).getTime();this.request(e,n,r).then(e=>t(null,(0,Yp.formatJsonRpcResult)(i,e))).catch(e=>t(e,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:tp("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:r}=await this.client.authenticate(e,t);n&&(this.uri=n,this.events.emit("display_uri",n));const i=await r();if(this.session=i.session,this.session){const e=Kb(this.session.namespaces);this.namespaces=Hb(this.namespaces,e),await this.persist("namespaces",this.namespaces),this.onConnect()}return i}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){const{uri:t,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties});t&&(this.uri=t,this.events.emit("display_uri",t));const r=await n();this.session=r;const i=Kb(r.namespaces);return this.namespaces=Hb(this.namespaces,i),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,r]=this.validateChain(e);this.getProvider(n).setDefaultChain(r,t)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(!np(t))return;for(const n of t)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info("Inactive pairings cleared: ".concat(t.length))}catch(t){this.logger.warn(t,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,t;if(this.client=this.providerOpts.client||await jw.init({core:this.providerOpts.core,logger:this.providerOpts.logger||Eb,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.org",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(n){throw this.logger.error(n,"Failed to get session"),new Error("The provided session: ".concat(null==(t=null==(e=this.providerOpts)?void 0:e.session)?void 0:t.topic," doesn't exist in the Sign client"))}else{const e=this.client.session.getAll();this.session=e[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(e=>Zh(e)))];Yb("client",this.client),Yb("events",this.events),Yb("disableProviderPing",this.disableProviderPing),e.forEach(e
2=>{if(!this.session)return;const t=function(e,t){const n=Object.keys(t.namespaces).filter(t=>t.includes(e));if(!n.length)return[];const r=[];return n.forEach(e=>{const n=t.namespaces[e].accounts;r.push(...n)}),r}(e,this.session);if(0===(null===t||void 0===t?void 0:t.length))return;const n=Wb(t),r=Hb(this.namespaces,this.optionalNamespaces),i=GA(VA({},r[e]),{accounts:t,chains:n});if("eip155"===e)this.rpcProviders[e]=new MA({namespace:i});else this.rpcProviders[e]=new BA({namespace:i})})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var t;const{topic:n}=e;n===(null==(t=this.session)?void 0:t.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var t;const{params:n,topic:r}=e;if(r!==(null==(t=this.session)?void 0:t.topic))return;const{event:i}=n;if("accountsChanged"===i.name){const e=i.data;e&&np(e)&&this.events.emit("accountsChanged",e.map(Gb))}else if("chainChanged"===i.name){const e=n.chainId,t=n.event.data,r=Zh(e),i=Jb(e)!==Jb(t)?"".concat(r,":").concat(Jb(t)):e;this.onChainChanged({currentCaipChainId:i})}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",e=>{let{topic:t,params:n}=e;var r,i;if(t!==(null==(r=this.session)?void 0:r.topic))return;const{namespaces:s}=n,o=null==(i=this.client)?void 0:i.session.get(t);this.session=GA(VA({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:n})}),this.client.on("session_delete",async e=>{var t;e.topic===(null==(t=this.session)?void 0:t.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",GA(VA({},tp("USER_DISCONNECTED")),{data:e.topic})))}),this.on(Ob,e=>{this.onChainChanged(GA(VA({},e),{internal:!0}))})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Tb]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t={},optionalNamespaces:n={},sessionProperties:r,scopedProperties:i}=e;this.optionalNamespaces=Hb(t,n),this.sessionProperties=r,this.scopedProperties=i}validateChain(e){const[t,n]=(null===e||void 0===e?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map(e=>Zh(e)).includes(t))throw new Error("Namespace '".concat(t,"' is not configured. Please call connect() first with namespace config."));if(t&&n)return[t,n];const r=Zh(Object.keys(this.namespaces)[0]);return[r,this.rpcProviders[r].getDefaultChain()]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged(e){let{currentCaipChainId:t,previousCaipChainId:n,internal:r=!1}=e;if(!this.namespaces)return;const[i,s]=this.validateChain(t);s&&(this.updateNamespaceChain(i,s),r?(this.events.emit("chainChanged",s),this.emitAccountsChangedOnChainChange({namespace:i,currentCaipChainId:t,previousCaipChainId:n})):this.getProvider(i).setDefaultChain(s),await this.persist("namespaces",this.namespaces))}emitAccountsChangedOnChainChange(e){let{namespace:t,currentCaipChainId:n,previousCaipChainId:r}=e;var i,s;try{if(r===n)return;const e=null==(s=null==(i=this.session)?void 0:i.namespaces[t])?void 0:s.accounts;if(!e)return;const o=e.filter(e=>e.includes("".concat(n,":"))).map(Gb);if(!np(o))return;this.events.emit("accountsChanged",o)}catch(He){this.logger.warn(He,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(e,t){if(!this.namespaces)return;const n=this.namespaces[e]?e:"".concat(e,":").concat(t),r={chains:[],methods:[],events:[],defaultChain:t};this.namespaces[n]?this.namespaces[n]&&(this.namespaces[n].defaultChain=t):this.namespaces[n]=r}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,t){var n;const r=(null==(n=this.session)?void 0:n.topic)||"";await this.client.core.storage.setItem("".concat(Sb,"/").concat(e).concat(r),t)}async getFromStore(e){var t;const n=(null==(t=this.session)?void 0:t.topic)||"";return await this.client.core.storage.getItem("".concat(Sb,"/").concat(e).concat(n))}async deleteFromStore(e){var t;const n=(null==(t=this.session)?void 0:t.topic)||"";await this.client.core.storage.removeItem("".concat(Sb,"/").concat(e).concat(n))}async cleanupStorage(){var e;try{if((null==(e=this.client)?void 0:e.session.length)>0)return;const t=await this.client.core.storage.getKeys();for(const e of t)e.startsWith(Sb)&&await this.client.core.storage.removeItem(e)}catch(t){this.logger.warn(t,"Failed to cleanup storage")}}}const ZA=JA,QA="".concat("wc","@2:").concat("ethereum_provider",":"),YA=["eth_sendTransaction","personal_sign"],XA=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],$A=["chainChanged","accountsChanged"],e_=["chainChanged","accountsChanged","message","disconnect","connect"];var t_=Object.defineProperty,n_=Object.defineProperties,r_=Object.getOwnPropertyDescriptors,i_=Object.getOwnPropertySymbols,s_=Object.prototype.hasOwnProperty,o_=Object.prototype.propertyIsEnumerable,a_=(e,t,n)=>t in e?t_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c_=(e,t)=>{for(var n in t||(t={}))s_.call(t,n)&&a_(e,n,t[n]);if(i_)for(var n of i_(t))o_.call(t,n)&&a_(e,n,t[n]);return e},l_=(e,t)=>
2n_(e,r_(t)),u_=(e,t,n)=>a_(e,"symbol"!=typeof t?t+"":t,n);function d_(e){return Number(e[0].split(":")[1])}function h_(e){return"0x".concat(e.toString(16))}class p_{constructor(){u_(this,"events",new wi.EventEmitter),u_(this,"namespace","eip155"),u_(this,"accounts",[]),u_(this,"signer"),u_(this,"chainId",1),u_(this,"modal"),u_(this,"rpc"),u_(this,"STORAGE_KEY",QA),u_(this,"on",(e,t)=>(this.events.on(e,t),this)),u_(this,"once",(e,t)=>(this.events.once(e,t),this)),u_(this,"removeListener",(e,t)=>(this.events.removeListener(e,t),this)),u_(this,"off",(e,t)=>(this.events.off(e,t),this)),u_(this,"parseAccount",e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e),this.signer={},this.rpc={}}static async init(e){const t=new p_;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,n){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),n)}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){var t;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:n,optional:r}=function(e){const{chains:t,optionalChains:n,methods:r,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=e;if(!np(t))throw new Error("Invalid chains");const c={chains:t,methods:r||YA,events:s||$A,rpcMap:c_({},t.length?{[d_(t)]:a[d_(t)]}:{})},l=null===s||void 0===s?void 0:s.filter(e=>!$A.includes(e)),u=null===r||void 0===r?void 0:r.filter(e=>!YA.includes(e));if(!n&&!o&&!i&&(null==l||!l.length)&&(null==u||!u.length))return{required:t.length?c:void 0};const d=(null===l||void 0===l?void 0:l.length)&&(null===u||void 0===u?void 0:u.length)||!n,h={chains:[...new Set(d?c.chains.concat(n||[]):n)],methods:[...new Set(c.methods.concat(null!=i&&i.length?i:XA))],events:[...new Set(c.events.concat(null!=o&&o.length?o:e_))],rpcMap:a};return{required:t.length?c:void 0,optional:n.length?h:void 0}}(this.rpc);try{const t=await new Promise(async(t,i)=>{var s,o;this.rpc.showQrModal&&(null==(s=this.modal)||s.open(),null==(o=this.modal)||o.subscribeState(e=>{!e.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),i(new Error("Connection request reset. Please try again.")))}));const a=null!=e&&e.scopedProperties?{[this.namespace]:e.scopedProperties}:void 0;await this.signer.connect(l_(c_({namespaces:c_({},n&&{[this.namespace]:n})},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:null===e||void 0===e?void 0:e.pairingTopic,scopedProperties:a})).then(e=>{t(e)}).catch(e=>{var t;null==(t=this.modal)||t.showErrorMessage("Unable to connect"),i(new Error(e.message))})});if(!t)return;const i=xo(t.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:i),this.setAccounts(i),this.events.emit("connect",{chainId:h_(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{null==(t=this.modal)||t.close()}}async authenticate(e,t){var n;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:null===e||void 0===e?void 0:e.chains});try{const n=await new Promise(async(n,r)=>{var i,s;this.rpc.showQrModal&&(null==(i=this.modal)||i.open(),null==(s=this.modal)||s.subscribeState(e=>{!e.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),r(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(l_(c_({},e),{chains:this.rpc.chains}),t).then(e=>{n(e)}).catch(e=>{var t;null==(t=this.modal)||t.showErrorMessage("Unable to connect"),r(new Error(e.message))})}),r=n.session;if(r){const e=xo(r.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:e),this.setAccounts(e),this.events.emit("connect",{chainId:h_(this.chainId)})}return n}catch(r){throw this.signer.logger.error(r),r}finally{null==(n=this.modal)||n.close()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:n}=t;"accountsChanged"===n.name?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===n.name?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("accountsChanged",e=>{this.accounts=this.parseAccounts(e),this.events.emit("accountsChanged",this.accounts)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",h_(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",l_(c_({},tp("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith("".concat(this.namespace,":"))}formatChainId(e){return"".concat(this.namespace,":").concat(e)}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(e=>this.isCompatibleChainId(e)).map(e=>this.parseChainId(e));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",h_(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,r]=e.split(":");return{chainId:"".concat(t,":").concat(n),address:r}}setAccounts(e){this.accounts=e.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,n;const r=null!=(t=null===e||void 0===e?void 0:e.chains)?t:[],i=null!=(n=null===e||void 0===e?void 0:e.optionalChains)?n:[],s=r.concat(i);if(!s.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=r.length?(null===e||void 0===e?void 0:e.methods)||YA:[],a=r.length?(null===e||void 0===e?void 0:e.events)||$A:[],c=(null===e||void 0===e?void 0:e.optionalMethods)||[],l=(null===e||void 0===e?void 0:e.optionalEvents)||[],u=(null===e||void 0===e?void 0:e.rpcMap)||this.buildRpcMap(s,e.projectId),d=(null===e||void 0===e?void 0:e.qrModalOptions)||void 0;return{chains:null===r||void 0===r?void 0:r.map(e=>this.formatChainId(e)),optionalChains:i.map(e=>this.formatChainId(e)),methods:o,events:a,optionalMethods:c,optionalEvents:l,rpcMap:u,showQrModal:!(null==e||!e.showQrModal),qrModalOptions:d,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};
2return e.forEach(e=>{n[e]=this.getRpcUrl(e,t)}),n}async initialize(e){var t;if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?d_(this.rpc.chains):d_(this.rpc.optionalChains),this.signer=await ZA.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storage:e.storage,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{const r=await(async()=>{const{createAppKit:e}=await n.e(2415).then(n.bind(n,52415));return e})(),{convertWCMToAppKitOptions:i}=await Promise.resolve().then(function(){return I_}),s=i(l_(c_({},this.rpc.qrModalOptions),{chains:[...new Set([...this.rpc.chains,...this.rpc.optionalChains])],metadata:this.rpc.metadata,projectId:this.rpc.projectId}));if(!s.networks.length)throw new Error("No networks found for WalletConnect\xb7");e=r(l_(c_({},s),{universalProvider:this.signer,manualWCControl:!0,enableMobileFullScreen:!0===(null==(t=this.rpc.qrModalOptions)?void 0:t.enableMobileFullScreen)}))}catch(r){throw console.warn(r),new Error("To use QR modal, please install @reown/appkit package")}if(e)try{this.modal=e}catch(r){throw this.signer.logger.error(r),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:r}=e;t&&np(t)&&(this.rpc.chains=t.map(e=>this.formatChainId(e)),t.forEach(e=>{this.rpc.rpcMap[e]=(null===r||void 0===r?void 0:r[e])||this.getRpcUrl(e)})),n&&np(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=null===n||void 0===n?void 0:n.map(e=>
2this.formatChainId(e)),n.forEach(e=>{this.rpc.rpcMap[e]=(null===r||void 0===r?void 0:r[e])||this.getRpcUrl(e)}))}getRpcUrl(e,t){var n;return(null==(n=this.rpc.rpcMap)?void 0:n[e])||"".concat("https://rpc.walletconnect.org/v1/","?chainId=eip155:").concat(e,"&projectId=").concat(t||this.rpc.projectId)}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem("".concat(this.STORAGE_KEY,"/chainId")),t=this.session.namespaces["".concat(this.namespace,":").concat(e)]?this.session.namespaces["".concat(this.namespace,":").concat(e)]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:null===t||void 0===t?void 0:t.accounts),this.setAccounts(null===t||void 0===t?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(e=>this.signer.logger.warn(e))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem("".concat(this.STORAGE_KEY,"/chainId"),this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map(e=>this.parseAccount(e))}}const f_=p_;var g_=Object.defineProperty,m_=Object.defineProperties,y_=Object.getOwnPropertyDescriptors,v_=Object.getOwnPropertySymbols,w_=Object.prototype.hasOwnProperty,b_=Object.prototype.propertyIsEnumerable,A_=(e,t,n)=>t in e?g_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__=(e,t)=>
2{for(var n in t||(t={}))w_.call(t,n)&&A_(e,n,t[n]);if(v_)for(var n of v_(t))b_.call(t,n)&&A_(e,n,t[n]);return e},x_=(e,t)=>m_(e,y_(t));function E_(e){if(e)return{"--w3m-font-family":e["--wcm-font-family"],"--w3m-accent":e["--wcm-accent-color"],"--w3m-color-mix":e["--wcm-background-color"],"--w3m-z-index":e["--wcm-z-index"]?Number(e["--wcm-z-index"]):void 0,"--w3m-qr-color":e["--wcm-accent-color"],"--w3m-font-size-master":e["--wcm-text-medium-regular-size"],"--w3m-border-radius-master":e["--wcm-container-border-radius"],"--w3m-color-mix-strength":0}}const k_=e=>{const[t,n]=e.split(":");return S_({id:n,caipNetworkId:e,chainNamespace:t,name:"",nativeCurrency:{name:"",symbol:"",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}})};function S_(e){return __({formatters:void 0,fees:void 0,serializers:void 0},e)}var I_=Object.freeze({__proto__:null,convertWCMToAppKitOptions:function(e){var t,n,r,i,s,o,a;const c=null==(t=e.chains)?void 0:t.map(k_).filter(Boolean);if(0===c.length)throw new Error("At least one chain must be specified");const l=c.find(t=>{var n;return t.id===(null==(n=e.defaultChain)?void 0:n.id)}),u={projectId:e.projectId,networks:c,themeMode:e.themeMode,themeVariables:E_(e.themeVariables),chainImages:e.chainImages,connectorImages:e.walletImages,defaultNetwork:l,metadata:x_(__({},e.metadata),{name:(null==(n=e.metadata)?void 0:n.name)||"WalletConnect",description:(null==(r=e.metadata)?void 0:r.description)||"Connect to WalletConnect-compatible wallets",url:(null==(i=e.metadata)?void 0:i.url)||"https://walletconnect.org",icons:(null==(s=e.metadata)?void 0:s.icons)||["https://walletconnect.org/walletconnect-logo.png"]}),showWallets:!0,featuredWalletIds:"NONE"===e.explorerRecommendedWalletIds?[]:Array.isArray(e.explorerRecommendedWalletIds)?e.explorerRecommendedWalletIds:[],excludeWalletIds:"ALL"===e.explorerExcludedWalletIds?[]:Array.isArray(e.explorerExcludedWalletIds)?e.explorerExcludedWalletIds:[],enableEIP6963:!1,enableInjected:!1,enableCoinbase:!0,enableWalletConnect:!0,features:{email:!1,socials:!1}};if(null!=(o=e.mobileWallets)&&o.length||null!=(a=e.desktopWallets)&&a.length){const t=[...(e.mobileWallets||[]).map(e=>({id:e.id,name:e.name,links:e.links})),...(e.desktopWallets||[]).map(e=>({id:e.id,name:e.name,links:{native:e.links.native,universal:e.links.universal}}))],n=[...u.featuredWalletIds||[],...u.excludeWalletIds||[]],r=t.filter(e=>!n.includes(e.id));r.length&&(u.customWallets=r)}return u},defineChain:S_}),T_=n(37017),C_=n(12663),P_=n(80595),O_=n(82425);n(82595);const N_=["style"],R_=["children","open","onClick"],M_=["style"],U_=["style"],L_=["config"];class B_{static parse(e){try{return new B_(e)}catch(e){return null}}static throwIfNotWellFormedJwt(e){return p.i(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=p.i(e)}}class D_ extends B_{static parse(e){try{return new D_(e)}catch(e){return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}}const j_=e=>{let{style:t}=e,n=(0,s.A)(e,N_);return(0,o.jsxs)("svg",(0,i.A)((0,i.A)({viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:(0,i.A)({height:"28px",width:"28px"},t)},n),{},{children:[(0,o.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}))},F_="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",z_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALZJREFUaEPtmjEOhDAMBNc/O14GvOzys3CAKK6eAlmaVGl2Zc+kTOU685vkc9/bnD2prZK5/TZY24z9P+g4F5hNh7/GdoG37WlAA5CATwgCxHENYISwQAMQII5rACOEBRqAAHFcAxghLNAABIjjGsAIYYEGIEAc1wBGCAs0AAHiuAYwQligAQgQxzWAEcICDUCAOK4BjBAWaAACxHENYISwQAMQII6fBjr+VHkW3+u+tfyxMpJaDgYzYxb/ALZVAAAAAElFTkSuQmCC";let W_,q_;class H_ extends y.E{async initialize(){await this.importPromise,await this.syncAccounts(),this.initialized=!0,this.emit
2("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:z_,id:"com.coinbase.wallet"}}async promptConnection(){try{await this.importPromise;let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new w.P("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(Qe){throw(0,b.f)(Qe)}}constructor(e,t,r,s,o){super("base_account",e,t,r),this.connectorType="base_account",this.walletClientType="base_account",this.displayName="Base",this.setBaseAccountSdk=o,this.proxyProvider=new y.P(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.baseAccountConfig=(0,i.A)((0,i.A)({},s),{},{appChainIds:[t.id].concat(e.map(e=>e.id))}),W_?(this.proxyProvider.setWalletProvider(W_.getProvider()),this.setBaseAccountSdk(W_),console.log("Base Account SDK Initialized")):this.importPromise=n.e(9822).then(n.bind(n,9822)).then(e=>{let{createBaseAccountSDK:t}=e;W_=t(this.baseAccountConfig),this.proxyProvider.setWalletProvider(W_.getProvider()),this.setBaseAccountSdk(W_),console.log("Base Account SDK Initialized")}
2).catch(console.error)}}let V_=[1,11155111,137,10,8453,84532,42161,7777777,43114,56];class G_ extends y.E{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:F_,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new w.P("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(Qe){throw(0,b.f)(Qe)}}updateConnectionPreference(e){this.coinbaseWalletConfig=(0,i.A)((0,i.A)({},this.coinbaseWalletConfig),{},{preference:(0,i.A)((0,i.A)({},this.coinbaseWalletConfig.preference),{},{options:e})}),this.walletClientType="smartWalletOnly"===e?"coinbase_smart_wallet":"coinbase_wallet",q_=Cn((0,i.A)({},this.coinbaseWalletConfig)),this.proxyProvider.setWalletProvider(q_.getProvider())}constructor(e,t,n,r){var s;if(super("coinbase_wallet",e,t,n),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new y.P(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.coinbaseWalletConfig=(0,i.A)((0,i.A)({},r),{},{appChainIds:[t.id].concat(e.map(e=>e.id))}),this.walletClientType="smartWalletOnly"===(null===(s=this.coinbaseWalletConfig.preference)||void 0===s?void 0:s.options)?"coinbase_smart_wallet":"coinbase_wallet","coinbase_smart_wallet"===this.walletClientType&&(this.displayName="Coinbase Smart Wallet"),!q_){var o,a;let e="eoaOnly"!==(null===(o=this.coinbaseWalletConfig.preference)||void 0===o?void 0:o.options)?(null!==(a=this.coinbaseWalletConfig.appChainIds)&&void 0!==a?a:[]).filter(e=>!V_.includes(e)):[];e.length>0&&!e.every(e=>l.o.has(e))&&console.info("The configured chains are not supported by Coinbase Smart Wallet: ".concat(e.join(", "))),q_=Cn(this.coinbaseWalletConfig)}this.proxyProvider.setWalletProvider(q_.getProvider())}}const K_=e=>{let t=Object.assign({},((0,r.A)(e),e));return(0,o.jsx)("svg",(0,i.A)((0,i.A)({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),{},{children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})}))};class J_ extends y.E{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[(0,y.t)((null===e||void 0===e?void 0:e.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:K_,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor(e){let{provider:t,chains:n,defaultChain:r,rpcConfig:i,imported:s,walletIndex:o}=e;super("privy",n,r,i),this.connectorType="embedded",this.proxyProvider=t,this.walletIndex=o,s&&(this.connectorType="embedded_imported"),this.subscribeListeners()}}async function Z_(){let e=Uk();return e?e.getAccessToken():Promise.resolve(b.u.get(On.P)||b.u.get(On.C)||null)}const Q_=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"];function Y_(e){return e?{"privy-ui":"t"}:void 0}class X_{async authenticate(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w.a("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(jn.p,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(Qe){throw(0,w.f)(Qe)}}async link(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w.a("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(jn.a,{email:this.meta.email,code:this.meta.emailCode})}catch(Qe){throw(0,w.f)(Qe)}}async sendCodeEmail(e){let{email:t,captchaToken:n,withPrivyUi:r}=e;if(!this.api)throw new w.a("Auth flow has no API instance");if(t&&(this.meta.email=t),n&&(this.meta.captchaToken=n),!this.meta.email)throw new w.a("Email must be set when initialzing authentication.");let s=Y_(r);try{return await this.api.post(jn.b,{email:this.meta.email,token:this.meta.captchaToken},{headers:(0,i.A)({},s)})}catch(t){throw(0,w.f)(t)}}constructor(e){let{email:t,captchaToken:n,disableSignup:r}=e;this.meta={email:t,captchaToken:n,disableSignup:null!==r&&void 0!==r&&r}}}class $_ extends X_{async link(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w.a("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(jn.u,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(Qe){throw(0,w.f)(Qe)}}constructor(e,t,n){super({email:t,captchaToken:n}),this.meta={email:t,captchaToken:n,oldAddress:e,disableSignup:!1}}}function ex(e){var t;return{name:(null===(t=e.metadata)||void 0===t?void 0:t.shortName)||e.name||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function tx(e,t){let n=ex(t);if(n.universalLink)return sx(n.universalLink,e)}let nx="WALLETCONNECT_DEEPLINK_CHOICE";function rx(e){return e.startsWith("http://")||e.startsWith("https://")}function ix(e,t){if(rx(e))return sx(e,t);let n=e;return n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n="".concat(n,"://")),n.endsWith("/")||(n="".concat(n,"/")),{redirect:"".concat(n,"wc?uri=").concat(encodeURIComponent(t)),href:n}}function sx(e,t){if(!rx(e))return ix(e,t);let n=e;return n.endsWith("/")||(n="".concat(n,"/")),{redirect:"".concat(n,"wc?uri=").concat(encodeURIComponent(t)),href:n}}function ox(e,t){window.open(e,t,"noreferrer noopener")}class ax{execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}class cx{get meta(){return this._meta}async authenticate(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.channelToken)throw new w.a("Auth flow must be initialized first");try{let e=await this.api.post(jn.f,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new w.a("No response from authentication");return e}catch(Qe){throw(0,w.f)(Qe)}}async link(){if(!this.api)throw new w.a("Auth flow has no API instance");try{return await this.api.post(jn.c,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(Qe){throw(0,w.f)(Qe)}}async _startChannelOnce(){if(!this.api)throw new w.a("Auth flow has no API instance");let e=await this.api.post(jn.d,{token:this.captchaToken});Rn.Fr&&!Rn.un&&e.connect_uri&&ox(e.connect_uri,"_blank"),this._meta=(0,i.A)((0,i.A)({},this._meta),{},{connectUri:e.connect_uri,channelToken:e.channel_token})}async initializeFarcasterConnect(){if(!this.api)throw new w.a("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.channelToken)throw new w.a("Auth flow must be initialized first");let e=await this.api.get(jn.e,{headers:{"farcaster-channel-token":this.meta.channelToken}});return"completed"===e.state&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new ax(this._startChannelOnce.bind(this)),this.pollForReady=new ax(this._pollForReady.bind(this)),this._meta.disableSignup=t}}function lx(){return"undefined"!=typeof window&&"chrome-extension:"===window.location.protocol&&"chrome"in window}function ux(){var e;if(!lx())return;let t=window.chrome;return null===t||void 0===t||null===(e=t.runtime)||void 0===e?void 0:e.id}function dx(){var e;if(!lx())return!1;let t=window.chrome;return"function"==typeof(null===t||void 0===t||null===(e=t.identity)||void 0===e?void 0:e.launchWebAuthFlow)}async function hx(e){return new Promise((t,n)=>{dx()?window.chrome.identity.launchWebAuthFlow({url:e,interactive:!0},async e=>{try{let n=function(e){if(!lx())return;let t=window.chrome;return null===t||void 0===t||null===(e=t.runtime)||void 0===e||null===(e=e.lastError)||void 0===e?void 0:e.message}();if(n||!e){let e="WebAuthFlow failed: ".concat(n||"Response URI missing");throw Error(e)}let r=new URL(e),i=ux();if(!i)throw Error("Invalid extension context");if("chrome-extension:"===r.protocol){if(r.hostname!==i)throw Error("Invalid responseUri origin")}else{if("https:"!==r.protocol)throw Error("Invalid responseUri protocol");{let e=r.hostname.split(".");if(3!==e.length||"chromiumapp"!==e[1]||"org"!==e[2]||e[0]!==i)throw Error("Invalid responseUri origin")}}let s=r.searchParams.get("privy_oauth_state"),o=r.searchParams.get("privy_oauth_code");if(!s||!o)throw Error("Invalid responseUri - missing required parameters");t({privyOAuthState:s,privyOAuthCode:o})}catch(e){n(e)}}):n(Error("Chrome identity API not available"))})}function px(e){return crypto.getRandomValues(new Uint8Array(e))}
2function fx(){return f.l(px(36))}function gx(){return fx()}async function mx(e){if("S256"!=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"S256"))return e;{let t=await async function(e){let t=(new TextEncoder).encode(e);return new Uint8Array(await crypto.subtle.digest("SHA-256",t))}(e);return f.l(t)}}class yx{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w.a("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if("undefined"===this.meta.authorizationCode)throw new w.a("User denied confirmation during OAuth flow");let e=function(){let e=b.u.get(On.a);if(!e)throw new w.a("Authentication error.");return e}();try{let t=await this.api.post(jn.o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return b.u.del(On.a),b.u.del(On.H),b.u.del(On.O),t}catch(e){let t=(0,w.f)(e);if(t.privyErrorCode)throw new w.a(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new w.a("Invalid code during oauth flow.",void 0,w.b.OAUTH_USER_DENIED);throw new w.a("Invalid code during OAuth flow.",void 0,w.b.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w.a("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if("undefined"===this.meta.authorizationCode)throw new w.a("User denied confirmation during OAuth flow");let e=b.u.get(On.a);if(!e)throw new w.a("Authentication error.");try{let t=await this.api.post(jn.g,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return b.u.del(On.a),t}catch(e){throw(0,w.f)(e)}}async getAuthorizationUrl(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.provider)throw new w.a("Provider must be set when initializing OAuth authentication.");let e=fx();b.u.put(On.a,e);let t=gx();b.u.put(On.S,t);let n=await mx(e);this.meta.withPrivyUi||b.u.put(On.H,!0),this.meta.disableSignup?b.u.put(On.O,!0):b.u.del(On.O);let r=Y_(this.meta.withPrivyUi),s=window.location.href,o=function(){let e=ux();if(e)return"https://".concat(e,".chromiumapp.org")}();o&&(s=o);try{return await this.api.post(jn.h,{provider:this.meta.provider,redirect_to:this.meta.customOAuthRedirectUrl||s,token:this.meta.captchaToken,code_challenge:n,state_code:t},{headers:(0,i.A)({},r)})}catch(e){throw(0,w.f)(e)}}constructor(e){this.meta=e}}function vx(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),n=e.get("privy_oauth_state"),r=e.get("privy_oauth_provider");if(!t||!n||!r)return{inProgress:!1};let i=!1;try{i=!!window.opener.location.origin}catch(s){}return{inProgress:!0,authorizationCode:t,stateCode:n,provider:r,withPrivyUi:!b.u.get(On.H),popupFlow:null!==window.opener&&i,disableSignup:!!b.u.get(On.O)}}function wx(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),b.u.del(On.S),window.history.replaceState({},"",e)}class bx{async initRegisterFlow(e){if(!this.api)throw new w.a("Auth flow has no API instance");this.authenticateForRegistration=!0,this.meta.initRegisterResponse=await this.initRegisterOnce.execute(e)}async initAuthenticationFlow(e){if(!this.api)throw new w.a("Auth flow has no API instance");this.authenticateForRegistration=!1,this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new w.a("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async register(){let e=await n.e(4949).then(n.bind(n,84949));if(!this.api)throw new w.a("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new w.a("WebAuthn is not supported in this browser");this.meta.initRegisterResponse||(this.meta.initRegisterResponse=await this.initRegisterOnce.execute());try{var t,r;let n=this.meta.initRegisterResponse.options,i=await e.startRegistration({optionsJSON:this._transformInitLinkOptionsToCamelCase(n)});return null!==(t=(r=this.meta).setPasskeyAuthState)&&void 0!==t&&t.call(r,{status:"submitting-response"}),await this.api.post(jn.i,{relying_party:this.meta.initRegisterResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(i)})}catch(e){if("NotAllowedError"===e.name)throw new w.a("Passkey request timed out or rejected by user.",void 0,w.b.PASSKEY_NOT_ALLOWED);throw(0,w.f)(e)}}async authenticate(){var e,t;if(this.authenticateForRegistration)return this.register();let r=await n.e(4949).then(n.bind(n,84949));if(!this.api)throw new w.a("Auth flow has no API instance");if(!r.browserSupportsWebAuthn())throw new w.a("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());let s=null!==(e=null===(t=this.meta.allowedCredentialsIds)||void 0===t?void 0:t.map(e=>({type:"public-key",id:e})))&&void 0!==e?e:this.meta.initAuthenticateResponse.options.allow_credentials;try{var o,a;let e=await r.startAuthentication({optionsJSON:this._transformInitAuthenticateOptionsToCamelCase((0,i.A)((0,i.A)({},this.meta.initAuthenticateResponse.options),{},{allow_credentials:s}))});return null!==(o=(a=this.meta).setPasskeyAuthState)&&void 0!==o&&o.call(a,{status:"submitting-response"}),await this.api.post(jn.j,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(e)})}catch(r){if("NotAllowedError"===r.name)throw new w.a("Passkey request timed out or rejected by user.",void 0,w.b.PASSKEY_NOT_ALLOWED);throw(0,w.f)(r)}}async link(){let e=await n.e(4949).then(n.bind(n,84949));if(!this.api)throw new w.a("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new w.a("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{var t,r;let n=this.meta.initLinkResponse.options,i=await e.startRegistration({optionsJSON:this._transformInitLinkOptionsToCamelCase(n)});return null!==(t=(r=this.meta).setPasskeyAuthState)&&void 0!==t&&t.call(r,{status:"submitting-response"}),await this.api.post(jn.k,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(i)})}catch(e){if("NotAllowedError"===e.name)throw new w.a("Passkey request timed out or rejected by user.",void 0,w.b.PASSKEY_NOT_ALLOWED);throw(0,w.f)(e)}}async _initRegisterOnce(e){if(!this.api)throw new w.a("Auth flow has no API instance");let t=Y_(e);return await this.api.post(jn.l,{token:this.meta.captchaToken},{headers:(0,i.A)({},t)})}async _initAuthenticateOnce(e){if(!this.api)throw new w.a("Auth flow has no API instance");let t=Y_(e);return await this.api.post(jn.m,{token:this.meta.captchaToken},{headers:(0,i.A)({},t)})}async _initLinkOnce(){if(!this.api)throw new w.a("Auth flow has no API instance");return await this.api.post(jn.n,{})}_transformInitLinkOptionsToCamelCase(e){var t,n,r,i,s,o,a,c;return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map(e=>({type:e.type,alg:e.alg})),timeout:e.timeout,excludeCredentials:null===(t=e.exclude_credentials)||void 0===t?void 0:t.map(e=>({id:e.id,type:e.type,transports:e.transports})),authenticatorSelection:{authenticatorAttachment:null===(n=e.authenticator_selection)||void 0===n?void 0:n.authenticator_attachment,requireResidentKey:null===(r=e.authenticator_selection)||void 0===r?void 0:r.require_resident_key,residentKey:null===(i=e.authenticator_selection)||void 0===i?void 0:i.resident_key,userVerification:null===(s=e.authenticator_selection)||void 0===s?void 0:s.user_verification},attestation:e.attestation,extensions:{appid:null===(o=e.extensions)||void 0===o?void 0:o.app_id,credProps:null===(a=e.extensions)||void 0===a||null===(a=a.cred_props)||void 0===a?void 0:a.rk,hmacCreateSecret:null===(c=e.extensions)||void 0===c?void 0:c.hmac_create_secret},hints:this.meta.hints}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_i
2d:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){var t,n,r,i;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:(null===(t=e.allow_credentials)||void 0===t?void 0:t.map(e=>({id:e.id,type:e.type,transports:e.transports})))||[],timeout:e.timeout,extensions:{appid:null===(n=e.extensions)||void 0===n?void 0:n.app_id,credProps:null===(r=e.extensions)||void 0===r?void 0:r.cred_props,hmacCreateSecret:null===(i=e.extensions)||void 0===i?void 0:i.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor(e){let{captchaToken:t,setPasskeyAuthState:n,hints:r}=e;this.authenticateForRegistration=!1,this.initRegisterOnce=new ax(this._initRegisterOnce.bind(this)),this.initAuthenticateOnce=new ax(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new ax(this._initLinkOnce.bind(this)),this.meta={captchaToken:t,setPasskeyAuthState:n,hints:r}}}const Ax=e=>{let{address:t,chainId:n,nonce:r}=e;return"".concat(window.location.host," wants you to sign in with your Ethereum account:\n").concat(t,"\n\nBy signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.\n\nURI: ").concat(window.location.origin,"\nVersion: 1\nChain ID: ").concat(n,"\nNonce: ").concat(r,"\nIssued At: ").concat((new Date).toISOString(),"\nResources:\n- https://privy.io")};class _x{get meta(){var e,t,n,r;return{connectorType:null===(e=this.wallet)||void 0===e?void 0:e.connectorType,walletClientType:null===(t=this.wallet)||void 0===t?void 0:t.walletClientType,chainId:null===(n=this.wallet)||void 0===n?void 0:n.chainId,address:null===(r=this.wallet)||void 0===r?void 0:r.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new w.a("SiweFlow has no client instance");try{var e,t,n,r,i;if(this.preparedMessage&&this.signature)return await this.client.authenticateWithSiweInternal({message:this.preparedMessage,signature:this.signature,chainId:null===(e=this.wallet)||void 0===e?void 0:e.chainId,walletClientType:null!==(t=this.walletClientType)&&void 0!==t?t:null===(n=this.wallet)||void 0===n?void 0:n.walletClientType,connectorType:null!==(r=this.connectorType)&&void 0!==r?r:null===(i=this.wallet)||void 0===i?void 0:i.connectorType,mode:this._meta.disableSignup?"no-signup":"login-or-sign-up"});if(!this.wallet)throw new w.a("SiweFlow has no wallet instance");let{message:s,signature:o}=await this.sign();return await this.client.authenticateWithSiweInternal({message:s,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(Qe){throw(0,w.f)(Qe)}}async link(){if(!this.client)throw new w.a("SiweFlow has no client instance");try{if(!this.wallet)throw new w.a("SiweFlow has no wallet instance");let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(Qe){throw(0,w.f)(Qe)}}async sign(){if(!this.client)throw new w.a("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new w.a("Could not prepare SIWE message");if(!this.wallet)throw new w.a("SiweFlow has no wallet instance");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new w.a("SiweFlow has no client instance");if(!this.wallet)throw new w.a("UI SiweFlow has no wallet instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new w.a("SiweFlow has no client instance");if(!this.wallet)throw new w.a("SiweFlow has no wallet instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Ax({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;this._meta={disableSignup:!1}
2,this.getNonceOnce=new ax(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=n,this.client=e,this._meta.disableSignup=r,this.preparedMessage=null===i||void 0===i?void 0:i.message,this.signature=null===i||void 0===i?void 0:i.signature,this.walletClientType=null===i||void 0===i?void 0:i.walletClientType,this.connectorType=null===i||void 0===i?void 0:i.connectorType}}class xx{get meta(){var e;return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup,messageType:this._meta.messageType,address:null===(e=this.wallet)||void 0===e?void 0:e.address}}set messageType(e){this._meta.messageType=e}async authenticate(){if(!this.client)throw new w.a("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up",messageType:this.meta.messageType})}catch(Qe){throw(0,w.f)(Qe)}}async link(){if(!this.client)throw new w.a("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,messageType:this.meta.messageType})}catch(Qe){throw(0,w.f)(Qe)}}async sign(){let e,t;if(!this.client)throw new w.a("SiwsFlow has no client instance");await this.buildMessage();let n="transaction"===this.meta.messageType;if(!this.preparedMessage)throw new w.a("Could not prepare SIWS message");if(!n&&!this.wallet.provider.signMessage||n&&!this.wallet.provider.signTransaction)throw new w.a("Wallet does not support the necessary signing methods");if(n&&this._plugin){let n=await this.wallet.provider.signTransaction({transaction:Fn.K3.decode(this.preparedMessage)});e=Fn.K3.encode(n.signedTransaction),t=this._plugin.getSignatureFromTransaction(n.signedTransaction,this.wallet.address)}else{e=this.preparedMessage;let n=await this.wallet.provider.signMessage({message:(new TextEncoder).encode(this.preparedMessage)});t=Fn.K3.encode(n.signature)}return{message:e,signature:t}}async _getNonceOnce(){if(!this.client)throw new w.a("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new w.a("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),"transaction"===this.meta.messageType&&this._plugin?this.preparedMessage=this._plugin.createSiwsMemoTransaction({address:e,nonce:this.nonce}):this.preparedMessage=(0,zn.p)({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"plain",s=arguments.length>5?arguments[5]:void 0;this._meta={disableSignup:!1,messageType:"plain"},this.getNonceOnce=new ax(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=t,this._meta.disableSignup=r,this._meta.messageType=i,this._plugin=s}}class Ex{async authenticate(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w.a("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(jn.q,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(Qe){throw(0,w.f)(Qe)}}async link(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w.a("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(jn.r,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(Qe){throw(0,w.f)(Qe)}}async sendSmsCode(e){let{phoneNumber:t,captchaToken:n,withPrivyUi:r}=e;if(!this.api)throw new w.a("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),n&&(this.meta.captchaToken=n),!this.meta.phoneNumber)throw new w.a("phone nNumber must be set when initialzing authentication.");let s=Y_(r);try{return await this.api.post(jn.s,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:(0,i.A)({},s)})}catch(t){throw(0,w.f)(t)}}constructor(e){let{phoneNumber:t,captchaToken:n,disableSignup:r}=e;this.meta={phoneNumber:t,captchaToken:n,disableSignup:null!==r&&void 0!==r&&r}}}
2class kx extends Ex{async link(){if(!this.api)throw new w.a("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new w.a("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(jn.t,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(Qe){throw(0,w.f)(Qe)}}constructor(e,t,n){super({phoneNumber:t,captchaToken:n}),this.meta={phoneNumber:t,captchaToken:n,oldPhoneNumber:e,disableSignup:!1}}}const Sx=(0,a.createContext)({enabled:!1,siteKey:"",provider:void 0,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:w.n,setError:w.n,setExecuting:w.n,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:w.d,reset:w.n,execute:w.n});class Ix extends w.c{constructor(e,t,n){super(e||"Captcha failed"),this.type="Captcha",t instanceof Error&&(this.cause=t),this.privyErrorCode=n}}const Tx=e=>{let{children:t,appId:n,captchaSiteKey:r,captchaEnabled:s,captchaProvider:c}=e,l=(0,a.useRef)(null),u=(0,a.useRef)(null),[d,h]=(0,a.useState)(),[p,f]=(0,a.useState)(),[g,m]=(0,a.useState)(!1),v=(0,a.useMemo)(()=>s?g||d||p?!g||d||p?d&&!p?{status:"success",token:d}:p?{status:"error",error:p}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[s,d,p,g]),b=(0,a.useMemo)(()=>s&&c?"turnstile"===c?{remove:()=>{var e;null!==(e=l.current)&&void 0!==e&&e.remove(),m(!1),f(void 0),h(void 0)},reset:()=>{var e;null!==(e=l.current)&&void 0!==e&&e.reset(),m(!1),f(void 0),h(void 0)},execute:()=>{var e;m(!0),null===(e=l.current)||void 0===e||e.execute()},waitForResult:async()=>{try{return await(0,y.p)(()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.getResponse()},{interval:200,timeout:2e4})}catch(t){throw new Ix("Captcha failed",null,w.b.CAPTCHA_TIMEOUT)}}}:{remove:()=>{var e;null!==(e=u.current)&&void 0!==e&&e.removeCaptcha(),m(!1),f(void 0),h(void 0)},reset:()=>{var e;null!==(e=u.current)&&void 0!==e&&e.resetCaptcha(),m(!1),f(void 0),h(void 0)},execute:()=>{var e;m(!0),null===(e=u.current)||void 0===e||e.execute()},waitForResult:async()=>{try{return await(0,y.p)(()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getResponse()},{interval:200,timeout:2e4})}catch(t){throw new Ix("Captcha failed",null,w.b.CAPTCHA_TIMEOUT)}}}:null,[s,c]),A=(0,a.useMemo)(()=>{var e,t;if(!s||!c||!b)return(0,i.A)((0,i.A)({},v),{},{enabled:!1,siteKey:"",appId:n,setToken:w.n,setError:w.n,setExecuting:w.n,waitForResult:()=>Promise.resolve(void 0),remove:w.d,reset:w.n,execute:w.n,provider:void 0,ref:{current:null}});let o=(0,i.A)((0,i.A)({},v),{},{enabled:!0,appId:n,setToken:h,setError:f,setExecuting:m});return"turnstile"===c?(0,i.A)((0,i.A)({},o),{},{provider:"turnstile",ref:l,siteKey:null!==(e=r.split("t:")[1])&&void 0!==e?e:""},b):(0,i.A)((0,i.A)({},o),{},{provider:"hcaptcha",ref:u,siteKey:null!==(t=r.split("h:")[1])&&void 0!==t?t:""},b)},[v,s,c,b,n,r]);return(0,o.jsx)(Sx.Provider,{value:A,children:t})},Cx=()=>(0,a.useContext)(Sx);class Px{async authenticate(){if(!this.api)throw new w.a("Auth flow has no API instance");try{return await this.api.post(jn.v,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(Qe){throw(0,w.f)(Qe)}}async link(){if(!this.api)throw new w.a("Auth flow has no API instance");try{return await this.api.post(jn.w,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(Qe){throw(0,w.f)(Qe)}}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=t}}function Ox(e){let t={detail:"",retryable:!1};return(null===e||void 0===e?void 0:e.privyErrorCode)===w.b.LINKED_TO_ANOTHER_USER&&(t.detail="This account has already been linked to another user."),(null===e||void 0===e?void 0:e.privyErrorCode)===w.b.DISALLOWED_LOGIN_METHOD&&(t.detail="Login with Telegram not allowed."),(null===e||void 0===e?void 0:e.privyErrorCode)===w.b.INVALID_DATA&&(t.retryable=!0,t.detail="Something went wrong. Try again."),(null===e||void 0===e?void 0:e.privyErrorCode)===w.b.CANNOT_LINK_MORE_OF_TYPE&&(t.retryable=!0,t.detail="Something went wrong. Try again."),(null===e||void 0===e?void 0:e.privyErrorCode)===w.b.INVALID_CREDENTIALS&&(t.retryable=!0,t.detail="Something went wrong. Try again."),(null===e||void 0===e?void 0:e.privyErrorCode)===w.b.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again."),(null===e||void 0===e?void 0:e.privyErrorCode)===w.b.TOO_MANY_REQUESTS&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),e instanceof Ix&&(t.retryable=!0,t.detail="Something went wrong. Try again."),t}function Nx(e){return Object.fromEntries(decodeURIComponent(e).split("&").map(e=>e.split("=").map(decodeURIComponent)))}function Rx(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}let Mx=(0,a.lazy)(()=>n.e(5740).then(n.bind(n,95740))),Ux=(0,a.lazy)(()=>n.e(8807).then(n.bind(n,51188)));const Lx=e=>{let t=Cx();return(0,a.useEffect)(()=>t.remove,[t.remove]),t.enabled&&t.provider?(0,o.jsx)(a.Suspense,{fallback:null,children:(0,o.jsxs)("div",{className:"hidden h-0 w-0",children:["turnstile"===t.provider&&(0,o.jsx)(Mx,(0,i.A)((0,i.A)({},e),{},{captchaContext:t})),"hcaptcha"===t.provider&&(0,o.jsx)(Ux,(0,i.A)((0,i.A)({},e),{},{captchaContext:t}))]})}):null};var Bx=Object.freeze({__proto__:null,AccountNotFoundScreen:()=>Promise.all([n.e(1275),n.e(9453)]).then(n.bind(n,79453)),AffirmativeConsentScreen:()=>Promise.all([n.e(1275),n.e(3397),n.e(9359)]).then(n.bind(n,29359)),AllowlistRejectionScreen:()=>Promise.all([n.e(1275),n.e(5678),n.e(6088)]).then(n.bind(n,16088)),AuthenticateWithWalletScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(6563),n.e(6386)]).then(n.bind(n,66386)),AwaitingEvmToSolBridgingScreen:()=>Promise.all([n.e(1275),n.e(7801),n.e(770),n.e(9224)]).then(n.bind(n,9224)),AwaitingExter
2nalEthereumTransferScreen:()=>Promise.all([n.e(1275),n.e(7801),n.e(770),n.e(9123)]).then(n.bind(n,89123)),AwaitingPasswordlessCodeScreen:()=>Promise.all([n.e(1275),n.e(180)]).then(n.bind(n,30180)),AwaitingSolToEvmBridgingScreen:()=>Promise.all([n.e(1275),n.e(7801),n.e(6781)]).then(n.bind(n,6781)),CaptchaScreen:()=>Promise.all([n.e(1275),n.e(6716),n.e(9227)]).then(n.bind(n,89227)),CoinbaseOnrampStatusScreen:()=>Promise.all([n.e(1275),n.e(70)]).then(n.bind(n,80070)),ConnectLedgerScreen:()=>Promise.all([n.e(1275),n.e(1444)]).then(n.bind(n,71444)),ConnectOnlyLandingScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(6563),n.e(2166)]).then(n.bind(n,82166)),ConnectOnlyStatusScreen:()=>Promise.all([n.e(1275),n.e(6773)]).then(n.bind(n,86773)),ConnectOrCreateScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(252),n.e(6563),n.e(4061),n.e(2043),n.e(9669)]).then(n.bind(n,69669)),ConnectionStatusScreen:()=>Promise.all([n.e(1275),n.e(463)]).then(n.bind(n,20463)),CrossAppAuthScreen:()=>Promise.all([n.e(1275),n.e(3364)]).then(n.bind(n,3364)),DelegatedActionsConsentScreen:()=>Promise.all([n.e(1275),n.e(5817),n.e(4411)]).then(n.bind(n,54411)),DelegatedActionsRevokeScreen:()=>Promise.all([n.e(1275),n.e(5817),n.e(9568)]).then(n.bind(n,79568)),EmbeddedWalletConnectingScreen:()=>Promise.all([n.e(1275),n.e(6716),n.e(8450)]).then(n.bind(n,98450)),EmbeddedWalletCreatedScreen:()=>Promise.all([n.e(1275),n.e(2222)]).then(n.bind(n,62222)),EmbeddedWalletKeyExportScreen:()=>Promise.all([n.e(1275),n.e(3867)]).then(n.bind(n,73867)),EmbeddedWalletOnAccountCreateScreen:()=>Promise.all([n.e(1275),n.e(6716),n.e(3461)]).then(n.bind(n,83461)),EmbeddedWalletPasswordCreateScreen:()=>Promise.all([n.e(1275),n.e(9551),n.e(1359)]).then(n.bind(n,41359)),EmbeddedWalletPasswordUpdateScreen:()=>Promise.all([n.e(1275),n.e(9551),n.e(9368)]).then(n.bind(n,9368)),EmbeddedWalletPasswordUpdateSplashScreen:()=>Promise.all([n.e(1275),n.e(5678),n.e(1083)]).then(n.bind(n,21083)),ErrorScreen:()=>Promise.all([n.e(1275),n.e(5678),n.e(6425)]).then(n.bind(n,66425)),FarcasterConnectStatusScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(7279),n.e(7488)]).then(n.bind(n,67488)),FarcasterSignerStatusScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(7279),n.e(3485)]).then(n.bind(n,73485)),FundSolWalletWithExternalSolanaWallet:()=>Promise.all([n.e(1275),n.e(4857)]).then(n.bind(n,24857)),FundingAmountEditScreen:()=>Promise.all([n.e(1275),n.e(5457)]).then(n.bind(n,25457)),FundingMethodSelectionScreen:()=>n.e(8656).then(n.bind(n,28656)),InAppBrowserLoginNotPossible:()=>Promise.all([n.e(1275),n.e(3397),n.e(4658)]).then(n.bind(n,4658)),InstallWalletScreen:()=>Promise.all([n.e(1275),n.e(8669)]).then(n.bind(n,98669)),LandingScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(252),n.e(6563),n.e(4061),n.e(2043),n.e(6490)]).then(n.bind(n,56490)),LinkConflictScreen:()=>Promise.all([n.e(1275),n.e(4927)]).then(n.bind(n,24927)),LinkEmailScreen:()=>Promise.all([n.e(1275),n.e(4262)]).then(n.bind(n,24262)),LinkPasskeyScreen:()=>Promise.all([n.e(1275),n.e(3567)]).then(n.bind(n,83567)),LinkPhoneScreen:()=>Promise.all([n.e(1275),n.e(252),n.e(7882)]).then(n.bind(n,7882)),LoginFailedScreen:()=>Promise.all([n.e(1275),n.e(6716),n.e(3170)]).then(n.bind(n,73170)),ManualTransferScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(7457)]).then(n.bind(n,7457)),MfaAuthEnrollmentFlowScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(5678),n.e(8126),n.e(1176),n.e(7237)]).then(n.bind(n,51278)),MfaAuthVerifyFlowScreen:()=>Promise.all([n.e(1275),n.e(8126),n.e(6887),n.e(8485),n.e(2595)]).then(n.bind(n,22595)),MfaEnrollmentFlowScreen:()=>Promise.all([n.e(1275),n.e(4036),n.e(5678),n.e(252),n.e(8126),n.e(1176),n.e(6450)]).then(n.bind(n,6450)),MoonpayStatusScreen:()=>Promise.all([n.e(1275),n.e(3460)]).then(n.bind(n,73460)),OAuthStatusScreen:()=>Promise.all([n.e(1275),n.e(4061),n.e(1593)]).then(n.bind(n,12578)),PasskeySelectSignupOrLogin:()=>Promise.all([n.e(1275),n.e(5035)]).then(n.bind(n,5035)),PasskeyStatusScreen:()=>Promise.all([n.e(1275),n.e(4978)]).then(n.bind(n,44978)),PasswordRecoveryScreen:()=>Promise.all([n.e(1275),n.e(4627)]).then(n.bind(n,94627)),RecoveryOAuthScreen:()=>Promise.all([n.e(1275),n.e(517)]).then(n.bind(n,60517)),RecoverySelectionScreen:()=>Promise.all([n.e(1275),n.e(3275)]).then(n.bind(n,63275)),SendTransactionScreen:()=>Promise.all([n.e(1275),n.e(5678),n.e(6887),n.e(2977),n.e(3331)]).then(n.bind(n,13331)),SetAutomaticRecoveryScreen:()=>
2Promise.all([n.e(1275),n.e(2163)]).then(n.bind(n,32163)),SignRequestScreen:()=>Promise.all([n.e(1275),n.e(5238)]).then(n.bind(n,35238)),StandardSignAndSendTransactionScreen:()=>Promise.all([n.e(1275),n.e(5678),n.e(2977),n.e(38)]).then(n.bind(n,12932)),TelegramAuthScreen:()=>Promise.all([n.e(1275),n.e(3099)]).then(n.bind(n,3099)),TransferFromWalletScreen:()=>n.e(9293).then(n.bind(n,89293)),UpdateEmailScreen:()=>Promise.all([n.e(1275),n.e(1333)]).then(n.bind(n,41333)),UpdatePhoneScreen:()=>Promise.all([n.e(1275),n.e(252),n.e(8893)]).then(n.bind(n,58893)),UserLimitReachedScreen:()=>Promise.all([n.e(1275),n.e(3383)]).then(n.bind(n,23383)),WalletInterstitialScreen:()=>Promise.all([n.e(1275),n.e(9583)]).then(n.bind(n,49583))});const Dx=(0,Hn.v)(()=>({inProgressMfaFlow:void 0})),jx=(0,Wn.DU)([":root{","};"],e=>Fx(e.palette)),Fx=e=>(0,Wn.AH)(["",""],Object.entries(function(e){return{"--privy-color-background":e.background,"--privy-color-background-2":e.background2,"--privy-color-background-3":e.background3,"--privy-color-foreground":e.foreground,"--privy-color-foreground-2":e.foreground2,"--privy-color-foreground-3":e.foreground3,"--privy-color-foreground-4":e.foreground4,"--privy-color-foreground-accent":e.foregroundAccent,"--privy-color-accent":e.accent,"--privy-color-accent-light":e.accentLight,"--privy-color-accent-hover":e.accentHover,"--privy-color-accent-dark":e.accentDark,"--privy-color-accent-darkest":e.accentDarkest,"--privy-color-success":e.success,"--privy-color-success-dark":e.successDark,"--privy-color-success-light":e.successLight,"--privy-color-success-bg":e.successBg,"--privy-color-error":e.error,"--privy-color-error-light":e.errorLight,"--privy-color-error-bg":e.errorBg,"--privy-color-error-bg-hover":e.errorBgHover,"--privy-color-warn":e.warn,"--privy-color-warn-light":e.warnLight,"--privy-color-warn-bg":e.warnBg,"--privy-color-warning-dark":e.warningDark,"--privy-color-error-dark":e.errorDark,"--privy-color-info-bg":e.infoBg,"--privy-color-info-bg-hover":e.infoBgHover,"--privy-color-border-default":e.borderDefault,"--privy-color-border-hover":e.borderHover,"--privy-color-border-focus":e.borderFocus,"--privy-color-border-error":e.borderError,"--privy-color-border-success":e.borderSuccess,"--privy-color-border-warning":e.borderWarning,"--privy-color-border-info":e.borderInfo,"--privy-color-border-interactive":e.borderInteractive,"--privy-color-border-interactive-hover":e.borderInteractiveHover,"--privy-color-background-hover":e.backgroundHover,"--privy-color-background-clicked":e.backgroundClicked,"--privy-color-background-disabled":e.backgroundDisabled,"--privy-color-background-interactive":e.backgroundInteractive,"--privy-color-background-interactive-hover":e.backgroundInteractiveHover,"--privy-color-background-interactive-clicked":e.backgroundInteractiveClicked,"--privy-color-background-interactive-disabled":e.backgroundInteractiveDisabled,"--privy-color-foreground-hover":e.foregroundHover,"--privy-color-foreground-clicked":e.foregroundClicked,"--privy-color-foreground-disabled":e.foregroundDisabled,"--privy-color-foreground-interactive":e.foregroundInteractive,"--privy-color-foreground-interactive-hover":e.foregroundInteractiveHover,"--privy-link-navigation-color":e.linkNavigationColor,"--privy-link-navigation-decoration":e.linkNavigationDecoration,"--privy-accent-has-good-contrast":e.accentHasGoodContrast,"--privy-color-icon-default":e.iconDefault,"--privy-color-icon-muted":e.iconMuted,"--privy-color-icon-subtle":e.iconSubtle,"--privy-color-icon-inverse":e.iconInverse,"--privy-color-icon-success":e.iconSuccess,"--privy-color-icon-warning":e.iconWarning,"--privy-color-icon-error":e.iconError,"--privy-color-icon-interactive":e.iconInteractive,"--privy-color-icon-default-hover":e.iconDefaultHover,"--privy-color-icon-muted-hover":e.iconMutedHover,"--privy-color-icon-subtle-hover":e.iconSubtleHover,"--privy-color-icon-default-clicked":e.iconDefaultClicked,"--privy-color-icon-muted-clicked":e.iconMutedClicked,"--privy-color-icon-subtle-clicked":e.iconSubtleClicked,"--privy-color-icon-default-disabled":e.iconDefaultDisabled,"--privy-color-icon-muted-disabled":e.iconMutedDisabled,"--privy-color-icon-subtle-disabled":e.iconSubtleDisabled,"--privy-color-icon-error-hover":e.iconErrorHover,"--privy-color-icon-interactive-hover":e.iconInteractiveHover,"--privy-color-icon-error-clicked":e.iconErrorClicked,"--privy-color-icon-interactive-clicked":e.iconInteractiveClicked,"--privy-color-icon-muted-disabled-alt":e.iconMutedDisabledAlt,"--privy-color-icon-subtle-disabled-alt":e.iconSubtleDisabledAlt,"--privy-border-radius-xs":"6px","--privy-border-radius-sm":"8px","--privy-border-radius-md":"12px","--privy-border-radius-mdlg":"16px","--privy-border-radius-lg":"24px","--privy-border-radius-full":"9999px","--privy-height-modal-full":"620px","--privy-height-modal-compact":"480px"}}(e)).map(e=>{let[t,n]=e;return"".concat(t,": ").concat(n,";")}).join("\n")),zx=Wn.I4.div.withConfig({displayName:"StylesWrapper",componentId:"sc-188229e4-0"})([""," color:var(--privy-color-foreground-2);h3{font-size:16px;line-height:24px;font-weight:500;color:var(--privy-color-foreground-2);}h4{font-size:14px;line-height:20px;font-weight:500;color:var(--privy-color-foreground);}p{font-size:13px;line-height:20px;color:var(--privy-color-foreground-2);}
2button:focus,input:focus,optgroup:focus,select:focus,textarea:focus{outline:none;border-color:var(--privy-color-accent-light);box-shadow:0 0 0 3px var(--privy-color-border-focus);}.mobile-only{@media (min-width:441px){display:none;}}@keyframes fadein{0%{opacity:0;}100%{opacity:1;}}"],"\n *,\n ::before,\n ::after {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n }\n\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n tab-size: 4;\n font-feature-settings: normal;\n\n margin: 0;\n font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji';\n\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n\n abbr:where([title]) {\n text-decoration: underline dotted;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,\
2n 'Apple Color Emoji', 'Segoe UI Emoji';\n display: inline;\n }\n\n a {\n color: inherit;\n text-decoration: inherit;\n }\n\n b,\n strong {\n font-weight: bolder;\n }\n\n code,\n kbd,\n samp,\n pre {\n font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;\n font-size: 1em;\n }\n\n small {\n font-size: 80%;\n }\n\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n\n sub {\n bottom: -0.25em;\n }\n\n sup {\n top: -0.5em;\n }\n\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n font-family: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n\n button,\n select {\n text-transform: none;\n }\n\n button,\n [type='button'],\n [type='reset'],\n [type='submit'] {\n -webkit-appearance: button;\n background-color: transparent;\n background-image: none;\n }\n\n ::-moz-focus-inner {\n border-style: none;\n padding: 0;\n }\n\n :-moz-focusring {\n outline: 1px dotted ButtonText;\n }\n\n :-moz-ui-invalid {\n box-shadow: none;\n }\n\n legend {\n padding: 0;\n }\n\n progress {\n vertical-align: baseline;\n }\n\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n\n [type='search'] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n\n summary {\n display: list-item;\n }\n\n blockquote,\n dl,\n dd,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n figure,\n p,\n pre {\n margin: 0;\n }\n\n fieldset {\n margin: 0;\n padding: 0;\n }\n\n legend {\n padding: 0;\n }\n\n ol,\n ul,\n menu {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n textarea {\n resize: vertical;\n }\n\n input::placeholder,\n textarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n }\n\n button,\n [role='button'] {\n cursor: pointer;\n }\n\n :disabled {\n cursor: default;\n }\n\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n }\n\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n\n [hidden] {\n display: none;\n }\n"),Wx=e=>{let{children:t,open:n,onClick:r}=e,c=(0,s.A)(e,R_);return(0,o.jsx)(yr,{show:n,as:a.Fragment,children:(0,o.jsxs)(vi,(0,i.A)((0,i.A)({onClose:r},c),{},{as:Hx,children:[(0,o.jsx)(mr,{as:a.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,o.jsx)(qx,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,o.jsx)(Vx,{children:(0,o.jsx)(mr,{as:a.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,o.jsx)(mi,{as:Gx,children:t})})})]}))})};let qx=Wn.I4.div.withConfig({displayName:"Backdrop",componentId:"sc-3cfde0b5-0"})(["position:fixed;inset:0;transition:backdrop-filter 100ms ease;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);&.entering,&.leaving{backdrop-filter:unset;-webkit-backdrop-filter:unset;}"]),Hx=Wn.I4.div.withConfig({displayName:"DialogWrapper",componentId:"sc-3cfde0b5-1"})(["position:relative;z-index:999999;"]),Vx=Wn.I4.div.withConfig({displayName:"DialogContainer",componentId:"sc-3cfde0b5-2"})(["position:fixed;inset:0;display:flex;align-items:center;justify-content:center;width:100vw;min-height:100vh;"]);const Gx=Wn.I4.div.withConfig({displayName:"Panel",componentId:"sc-3cfde0b5-3"})(["padding:0;background:transparent;border:none;width:100%;pointer-events:auto;outline:none;display:block;@media (max-width:440px){opacity:1;transform:translate3d(0,0,0);transition:transform 200ms ease-in;position:fixed;bottom:0;&.entering,&.leaving{opacity:0;transform:translate3d(0,100%,0);transition:transform 150ms ease-in 0ms,opacity 0ms ease 150ms;}}@media (min-width:441px){opacity:1;transition:opacity 100ms ease-in;&.entering,&.leaving{opacity:0;transition-delay:5ms;}margin:auto;width:360px;box-shadow:0px 8px 36px rgba(55,65,81,0.15);border-radius:var(--privy-border-radius-lg);}"]);let Kx=(0,a.lazy)(()=>Promise.all([n.e(1275),n.e(8126),n.e(6887),n.e(8485),n.e(7448)]).then(n.bind(n,17448))),Jx=(0,a.lazy)(()=>Bx.MfaAuthVerifyFlowScreen().then(e=>({default:e.default.component}))),Zx=()=>(0,o.jsx)(tE,{children:(0,o.jsx)(y.L,{})}),Qx=()=>{let{currentScreen:e}=(0,g.a)(),t=Dx(e=>e.inProgressMfaFlow),n=()=>Dx.setState({inProgressMfaFlow:void 0}),{component:r,isLoading:i}=(()=>{let{ready:e}=(0,g.u)(),{currentScreen:t}=(0,g.a)(),[n,r]=(0,a.useState)(null),[i,s]=(0,a.useState)(!1),o=function(e){let[t,n]=(0,a.useState)(!1),r=(0,a.useRef)(null),i=(0,a.useRef)(null),s=(0,a.useRef)(null);return(0,a.useEffect)(()=>
2{if(r.current&&(clearTimeout(r.current),r.current=null),i.current&&(clearTimeout(i.current),i.current=null),e)s.current=Date.now(),r.current=setTimeout(()=>{n(!0)},150);else if(null!==s.current){let e=Date.now()-s.current;if(e>=150){let t=Math.max(0,400-(e-150));i.current=setTimeout(()=>{n(!1),s.current=null},t)}else r.current&&(clearTimeout(r.current),r.current=null),n(!1),s.current=null}return()=>{r.current&&clearTimeout(r.current),i.current&&clearTimeout(i.current)}},[e]),t}(i);return(0,a.useEffect)(()=>{if(!t)return r(null),void s(!1);s(!0),Bx[t]().then(n=>{(!t||e||n.default.isShownBeforeReady)&&(r(()=>n.default.component),s(!1))}).catch(()=>{r(null),s(!1)})},[t,e]),{component:n,isLoading:o}})();return function(){let{isModalOpen:e}=(0,g.u)(),{headless:t}=(0,On.u)(),{currentScreen:n}=(0,g.a)(),{status:r,execute:i,reset:s,enabled:o}=Cx(),[c,l]=(0,a.useState)(!1);(0,a.useEffect)(()=>{!e&&o&&s()},[e,o,s]),(0,a.useEffect)(()=>{n?Bx[n]().then(e=>{l(!!e.default.isCaptchaRequired)}).catch(()=>{l(!1)}):l(!1)},[n]),(0,a.useEffect)(()=>{e&&c&&!t&&"ready"===r&&o&&i()},[e,c,t,r,o,i])}(),e||"txn"!==t?i?(0,o.jsx)(Zx,{}):r?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.H,{$if:!!t,children:(0,o.jsx)(r,{})}),(0,o.jsxs)(a.Suspense,{children:["txn"===t&&(0,o.jsx)(Kx,{onClose:n}),"auth"===t&&(0,o.jsx)(Jx,{})]})]}):null:(0,o.jsx)(Kx,{onClose:n})},Yx=()=>{let e=(0,a.useRef)(null);return(0,o.jsx)(eE,{style:{height:(0,y.u)(e)},id:"privy-modal-content",children:(0,o.jsx)("div",{ref:e,children:(0,o.jsx)(Qx,{})})})};const Xx=e=>{let{open:t}=e,n=(0,On.u)(),{gracefulClosePrivyModal:r}=(()=>{let{closePrivyModal:e}=(0,w.u)(),{onUserCloseViaDialogOrKeybindRef:t}=(0,g.a)();return{gracefulClosePrivyModal:(0,a.useCallback)(()=>{if(null===t||void 0===t||!t.current)return e({shouldCallAuthOnSuccess:!1});t.current()},[e])}})(),i=Dx(e=>e.inProgressMfaFlow);return function(e){(0,qn.u)("configureMfa",e)}({onMfaRequired:()=>{n.mfa.noPromptOnMfaRequired||Dx.setState({inProgressMfaFlow:"txn"})}}),n.render.standalone?(0,o.jsx)(zx,{children:(0,o.jsx)($x,{id:"privy-modal-content",children:(0,o.jsx)(Qx,{})})}):(0,o.jsx)(Wx,{open:!(!t&&!i),id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,o.jsx)(zx,{children:(0,o.jsx)(Yx,{})})})};let $x=Wn.I4.div.withConfig({displayName:"ContentWrapper",componentId:"sc-4759f1d5-0"})(["display:flex;flex-direction:column;text-align:center;font-size:14px;line-height:20px;width:100%;background:var(--privy-color-background);padding:0 16px;"]),eE=(0,Wn.I4)($x).withConfig({displayName:"BaseModal",componentId:"sc-4759f1d5-1"})(["transition:height 150ms ease-out;overflow-x:hidden;overflow-y:auto;scrollbar-width:none;max-height:calc(100svh - 32px);border-radius:var(--privy-border-radius-lg) var(--privy-border-radius-lg) 0 0;box-shadow:0px 0px 36px rgba(55,65,81,0.15);@media (min-width:441px){box-shadow:0px 8px 36px rgba(55,65,81,0.15);border-radius:var(--privy-border-radius-lg);}"]),tE=Wn.I4.div.withConfig({displayName:"LoadingScreenContainer",componentId:"sc-4759f1d5-2"})(["display:flex;align-items:center;justify-content:center;min-height:300px;padding:2rem;"]);function nE(e){let t=(0,a.useRef)(null),n=(0,a.useRef)();return(0,a.useEffect)(()=>{var r,i;null!==(r=n.current)&&void 0!==r&&r.remove(),n.current=function(e){let{botUsername:t,scriptHost:n}=e,r=document.createElement("script"),{origin:i}=new URL(n);return r.async=!0,r.src="".concat(i,"/js/telegram-login.js"),r.setAttribute("data-telegram-login",t),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}(e),null===(i=t.current)||void 0===i||i.after(n.current)},[e]),(0,o.jsx)("div",{ref:t,hidden:!0})}const rE=()=>{let{ready:e}=(0,v.u)(),{client:t}=(0,w.u)();return(0,a.useEffect)(()=>{var n;let r=()=>{if(!t.connectors||!e)return;let n=t.connectors.wallets.map(e=>({address:e.address,connectorType:e.connectorType,walletClientType:e.walletClientType,connectedAt:e.connectedAt,id:e.meta.id}));b.u.put(On.b,n)};return null!==(n=t.connectors)&&void 0!==n&&n.on("walletsUpdated",r),()=>{var e;null===(e=t.connectors)||void 0===e||e.off("walletsUpdated",r)}},[e,t.connectors]),null};class iE extends y.E{async initialize(){var e,t,n;let r=await this.createProvider();this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session&&(null!==(e=this.walletProvider)&&void 0!==e&&null!==(e=e.session)&&void 0!==e&&e.peer.metadata.url&&(this.walletEntry=(0,y.g)(null===(t=this.walletProvider)||void 0===t||null===(t=t.session)||void 0===t?void 0:t.peer.metadata.url),this.walletClientType=(null===(n=this.walletEntry)||void 0===n?void 0:n.slug)||"unknown"),this.connected=!0,await this.syncAccounts()),this.initialized=!0,this.emit
2("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){var e;return!(null===(e=this.walletProvider)||void 0===e||!e.connected)}get walletBranding(){var e,t,n;let r=null===(e=this.walletProvider)||void 0===e||null===(e=e.session)||void 0===e||null===(e=e.peer.metadata.icons)||void 0===e?void 0:e[0];return{name:(0,y.s)((null===(t=this.walletProvider)||void 0===t||null===(t=t.session)||void 0===t?void 0:t.peer.metadata.name)||"")||"WalletConnect",icon:"string"==typeof r?r:b.W,id:(null===(n=this.walletProvider)||void 0===n||null===(n=n.session)||void 0===n?void 0:n.peer.metadata.name.toLowerCase())||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(nx)}catch(e){}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((e,t)=>{(async(t,n,r,i)=>{let s="",o=await Promise.race([null===(t=this.walletProvider)||void 0===t?void 0:t.enable(),this.proxyProvider.walletTimeout()]);if(null!==o&&void 0!==o&&o.length&&(s=o[0]),!s||""===s)throw new w.P("Unable to retrieve address");null!==(n=this.walletProvider)&&void 0!==n&&null!==(n=n.session)&&void 0!==n&&n.peer.metadata.url&&(this.walletEntry=(0,y.g)(null===(r=this.walletProvider)||void 0===r||null===(r=r.session)||void 0===r?void 0:r.peer.metadata.url),this.walletClientType=(null===(i=this.walletEntry)||void 0===i?void 0:i.slug)||"unknown",this.proxyProvider.rpcTimeoutDuration=(0,y.c)(this.rpcConfig,this.walletClientType)),this.connected=!0,await this.syncAccounts(o),e()})().catch(e=>{t(e?(0,b.f)(e):new w.P("Unknown error during connection"))})})}disconnect(){var e;null===(e=this.walletProvider)||void 0===e||e.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect WalletConnect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let i of this.chains){let t=(0,y.a)(i.id,this.chains,this.rpcConfig,this.privyAppId);t&&(e[i.id]=t)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(e=>e.id),r=await f_.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:n,optionalEvents:e_,optionalMethods:XA,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.origin,icons:[]}});return r.on("display_uri",e=>{if(r.signer.abortPairingAttempt(),function(){try{localStorage.removeItem(nx)}catch(e){}}(),!this.showPrivyQrModal)throw new w.P("WalletConnect modal not available - Privy handles wallet connections through its own UI");if(Rn.Fr&&this.walletEntry){var t;let{redirect:n,href:r}=function(e,t){let n=ex(t);if(n.deepLink)return ix(n.deepLink,e);if(n.universalLink)return sx(n.universalLink,e);throw new w.a("Unsupported wallet ".concat(t.id))}(e,this.walletEntry);ox(n,"_self"),function(e){let{href:t,name:n}=e;try{localStorage.setItem(nx,JSON.stringify({href:t,name:n}))}catch(r){}}({href:r,name:(null===(t=this.walletEntry.metadata)||void 0===t?void 0:t.shortName)||this.walletEntry.name});let i=tx(e,this.walletEntry);return this.redirectUri=n,this.fallbackUniversalRedirectUri=null===i||void 0===i?void 0:i.redirect,this.showPrivyQrModal({native:n,universal:n})}if(this.redirectUri=void 0,this.walletEntry){let t=tx(e,this.walletEntry);this.fallbackUniversalRedirectUri=null===t||void 0===t?void 0:t.redirect}this.showPrivyQrModal({native:e,universal:void 0})}),r.on("connect",()=>{var e,t,n;(null===(e=r.session)||void 0===e?void 0:e.peer.metadata.url)&&(this.walletEntry=(0,y.g)(null===(t=r.session)||void 0===t?void 0:t.peer.metadata.url),this.walletClientType=(null===(n=this.walletEntry)||void 0===n?void 0:n.slug)||"unknown")}),r}async enableProvider(){var e,t;return null!==(e=this.walletProvider)&&void 0!==e&&e.connected?Promise.resolve(this.walletProvider.accounts):await(null===(t=this.walletProvider)||void 0===t?void 0:t.enable())}setWalletEntry(e,t){this.walletEntry=e,this.showPrivyQrModal=t}constructor(e){let{walletConnectCloudProjectId:t,rpcConfig:n,chains:r,defaultChain:i,shouldEnforceDefaultChainOnConnect:s,privyAppId:o,privyAppName:a,walletClientType:c}=e;super(c||"unknown",r,i,n),this.connectorType="wallet_connect_v2",this.privyAppId=o,this.privyAppName=a,this.walletConnectCloudProjectId=t,this.rpcConfig=n,this.shouldEnforceDefaultChainOnConnect=s,this.proxyProvider=new y.P(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=(0,y.b)(c),this.walletClientType=c)}}
2const sE=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];class oE extends Error{constructor(e,t){super(t),this.type=e}}function aE(e){let t=e.type;return"string"==typeof t&&sE.includes(t)}function cE(e){return aE(e)&&"wallet_not_on_device"===e.type}function lE(e){return aE(e)&&("invalid_recovery_pin"===e.type||"invalid_request_arguments"===e.type)}function uE(e){return!!aE(e)&&"mfa_timeout"===e.type}function dE(e){return!!aE(e)&&"missing_or_invalid_mfa"===e.type}function hE(e){return!!aE(e)&&"mfa_verification_max_attempts_reached"===e.type}function pE(e){return!(!aE(e)||!e.message.includes("code 429"))}function fE(e){return!!function(e){let t=e.type;return"string"==typeof t&&"client_error"===t}(e)&&"MFA canceled"===e.message}async function gE(e,t,n,r,i){let s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=s,a=async a=>{if(o&&t&&t.length>0){var c;a===(s?0:1)?i("configureMfa","onMfaRequired",{mfaMethods:t}):null===(c=r.current)||void 0===c||c.reject(new oE("missing_or_invalid_mfa","MFA verification failed, retry."));let o=await new Promise((e,t)=>{n.current={resolve:e,reject:t},setTimeout(()=>{var e;let n=new oE("mfa_timeout","Timed out waiting for MFA code");null!==(e=r.current)&&void 0!==e&&e.reject(n),t(n)},3e5)});return await e(o)}return await e()},c=null;for(let h=0;h<4;h++)try{var l;c=await a(h),null===(l=r.current)||void 0===l||l.resolve(void 0);break}catch(e){var u;if("missing_or_invalid_mfa"!==e.type)throw null!==(u=r.current)&&void 0!==u&&u.resolve(void 0),e;o=!0}if(null===c){var d;let e=new oE("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw null!==(d=r.current)&&void 0!==d&&d.reject(e),e}return c}var mE;let yE=(mE=0,()=>"id-"+mE++);function vE(e){return void 0!==e.error}let wE=new class{enqueue(e,t){this.callbacks[e]=t}dequeue(e,t){let n=this.callbacks[t];if(!n)throw Error("cannot dequeue ".concat(e," event: no event found for id ").concat(t));switch(delete this.callbacks[t],e){case"privy:iframe:ready":case"privy:user-signer:sign":case"privy:wallets:add":case"privy:wallets:import":case"privy:wallets:set-recovery":case"privy:wallets:connect":case"privy:wallets:recover":case"privy:wallets:rpc":case"privy:wallet:create":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:auth:unlink-passkey":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:delegated-actions:consent":return n;default:throw Error("invalid wallet event type ".concat(e))}}constructor(){this.callbacks={}}},bE=new Map,AE=(e,t)=>"bigint"==typeof t?t.toString():t;function _E(e,t,n,r){let i=n.contentWindow;if(!i)throw Error("iframe not initialized");let s=((e,t)=>"".concat(e).concat(JSON.stringify(t,AE)))(e,t);if("privy:wallet:create"===e){let e=bE.get(s);if(e)return e}let o=new Promise((n,s)=>{let o=yE();wE.enqueue(o,{resolve:n,reject:s}),i.postMessage({id:o,event:e,data:t},r)}).finally(()=>{bE.delete(s)});return bE.set(s,o),o}function xE(e){let t=(0,On.c)(),n=(0,a.useRef)(null),r=(0,a.useRef)(e.mfaMethods),s=(0,qn.a)(),[c,l]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,a.useEffect)(()=>{if(!c)return;let t=n.current;if(!t)return;function o(t){var n;t&&t.origin===e.origin&&"string"==typeof(n=t.data).event&&/^privy:.+/.test(n.event)&&function(e){switch(e.event){case"privy:iframe:ready":let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data);case"privy:user-signer:sign":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:add":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:set-recovery":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:connect":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:recover":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:rpc":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallet:create":let n=wE.dequeue(e.event,e.id);
2return vE(e)?n.reject(new oE(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallets:import":let r=wE.dequeue(e.event,e.id);return vE(e)?r.reject(new oE(e.error.type,e.error.message)):r.resolve(e.data);case"privy:mfa:verify":let i=wE.dequeue(e.event,e.id);return vE(e)?i.reject(new oE(e.error.type,e.error.message)):i.resolve(e.data);case"privy:mfa:init-enrollment":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:submit-enrollment":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:unenroll":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:clear":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:auth:unlink-passkey":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:solana-wallet:create":let s=wE.dequeue(e.event,e.id);return vE(e)?s.reject(new oE(e.error.type,e.error.message)):s.resolve(e.data);case"privy:farcaster:init-signer":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:farcaster:sign":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:delegated-actions:consent":{let t=wE.dequeue(e.event,e.id);return vE(e)?t.reject(new oE(e.error.type,e.error.message)):t.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}(t.data)}let a={signWithUserSigner:n=>gE(r=>_E("privy:user-signer:sign",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),addWallet:n=>gE(r=>_E("privy:wallets:add",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),setRecovery:n=>gE(r=>_E("privy:wallets:set-recovery",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),connect:n=>gE(r=>_E("privy:wallets:connect",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),recover:n=>gE(r=>_E("privy:wallets:recover",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s,!n.recoveryAccessToken&&!n.recoveryPassword&&!n.recoverySecretOverride),rpc:n=>gE(r=>_E("privy:wallets:rpc",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),create:n=>_E("privy:wallet:create",n,t,e.origin),importWallet:n=>_E("privy:wallets:import",n,t,e.origin),createSolana:n=>gE(r=>_E("privy:solana-wallet:create",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),createDelegatedAction:n=>_E("privy:delegated-actions:consent",n,t,e.origin),verifyMfa:n=>gE(r=>_E("privy:mfa:verify",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s,!0),initEnrollMfa:n=>gE(r=>_E("privy:mfa:init-enrollment",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),submitEnrollMfa:n=>gE(r=>_E("privy:mfa:submit-enrollment",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),unenrollMfa:n=>gE(r=>_E("privy:mfa:unenroll",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),clearMfa:n=>_E("privy:mfa:clear",n,t,e.origin),unlinkPasskeyAccount:n=>gE(r=>_E("privy:auth:unlink-passkey",(0,i.A)((0,i.A)({},n),r),t,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,s),initFarcasterSigner:n=>_E("privy:farcaster:init-signer",n,t,e.origin),signFarcasterMessage:n=>_E("privy:farcaster:sign",n,t,e.origin)};window.addEventListener("message",o);let l=new AbortController;return(0,y.i)(()=>_E("privy:iframe:ready",{},t,e.origin),{abortSignal:l.signal}).then(()=>e.onLoad(a),function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];console.warn("Privy iframe failed to load: ",...n),e.onLoadFailed()}),()=>{window.removeEventListener("message",o),l.abort()}},[c]),t?(0,o.jsx)("iframe",{ref:n,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>l(!0),src:(0,T_.j)({origin:e.origin,path:"/apps/".concat(e.appId,"/embedded-wallets"),query:{caid:e.clientAnalyticsId,client_id:e.appClientId}})}):null}const EE=e=>{var t;let{address:n,user:r}=e,i=r.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===n);if(!i)throw new w.a("Address to delegate is not associated with current user.");if(!(0,b.i)(i))throw new w.a("useDelegatedActions is not supported for ".concat(i.chainType," wallets. Use the useSessionSigners hook to provision server side access on behalf of your users."));return{address:i.address,chainType:i.chainType,walletIndex:null!==(t=i.walletIndex)&&void 0!==t?t:0}}
2,kE=e=>{let{address:t,user:n}=e,r=n.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===t);if(!r)throw new w.a("Address to delegate is not associated with current user.");let i=r.imported?r:(0,g.g)(n);if(!i)throw new w.a("Unable to determine root address for delegated address.");if(!(0,b.i)(i))throw new w.a("useDelegatedActions is not supported for ".concat(i.chainType," wallets. Use the useSessionSigners hook to provision server side access on behalf of your users."));return{address:i.address,chainType:i.chainType,imported:i.imported}},SE=e=>e.linkedAccounts.filter(e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.delegated),IE="popup-privy-oauth",TE="PRIVY_OAUTH_USE_BROADCAST_CHANNEL";class CE{async authenticate(){if(!this.api)throw new w.a("Auth flow has no API instance");try{return await this.api.post(jn.o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(Qe){throw(0,w.f)(Qe)}}async link(){if(!this.api)throw new w.a("Auth flow has no API instance");try{return await this.api.post(jn.g,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(Qe){throw(0,w.f)(Qe)}}constructor(e){let{authorizationCode:t,stateCode:n,codeVerifier:r,provider:i}=e;this.meta={authorizationCode:t,stateCode:n,codeVerifier:r,provider:i}}}async function PE(e){let{api:t,requesterAppId:n,providerAppId:r}=e,i=(await t.get("/api/v1/apps/".concat(n,"/cross-app/connections"))).connections.find(e=>e.provider_app_id===r);if(!i)throw new w.a("Invalid connected app");return{name:i.provider_app_name,logoUrl:i.provider_app_icon_url||void 0,apiUrl:i.provider_app_custom_api_url,readOnly:i.read_only,customAuthAuthorizeUrl:i.provider_app_custom_auth_authorize_url,customAuthTransactUrl:i.provider_app_custom_auth_transact_url}}const OE=async e=>{let{user:t,address:n,client:r,request:i,requesterAppId:s,reconnect:o}=e;r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:n,method:i.method}});let a=null===t||void 0===t?void 0:t.linkedAccounts.find(e=>"cross_app"===e.type&&(e.embeddedWallets.some(e=>e.address===n)||e.smartWallets.some(e=>e.address===n)));if(!t||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:n}}),new w.a("Cannot request a signature with this wallet address");let c=r.getProviderAccessToken(a.providerApp.id),l=await PE({api:r.api,requesterAppId:s,providerAppId:a.providerApp.id});if(!c){if(l.readOnly)throw console.error("cannot transact against a read-only provider app"),new w.a("Cannot transact against a read-only provider app");await o({appId:a.providerApp.id,action:"link"})&&(c=r.getProviderAccessToken(a.providerApp.id))}if(!c)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:n}}),new w.a("Transactions require a valid token");let u=new URL(l.customAuthTransactUrl||"".concat(l.apiUrl,"/oauth/transact"));u.searchParams.set("token",c||""),u.searchParams.set("request",NE(i));let d=(0,Dn.h)({location:u.href});if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:n}}),new w.a("Failed to initialize signature request");return new Promise((e,t)=>{let s=setTimeout(()=>{l(),t(new w.a("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:n}})},12e4),o=setInterval(()=>{d.closed&&(l(),t(new w.a("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:n}}))},300),c=s=>{var o,c,u;s.data&&("set"===(null===(o=s.data.token)||void 0===o?void 0:o.action)&&void 0!==(null===(c=s.data.token)||void 0===c?void 0:c.value)?r.storeProviderAccessToken(a.providerApp.id,s.data.token.value):"clear"===(null===(u=s.data.token)||void 0===u?void 0:u.action)&&r.storeProviderAccessToken(a.providerApp.id,null),"PRIVY_CROSS_APP_ACTION_RESPONSE"===s.data.type&&s.data.result&&(l(),e(s.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:n,method:i.method}})),"PRIVY_CROSS_APP_ACTION_ERROR"===s.data.type&&s.data.error&&(l(),t(s.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:s.data.error,address:n}})))};window.addEventListener("message",c);let l=()=>{d.close(),clearInterval(o),clearTimeout(s),window.removeEventListener("message",c)}})};let NE=e=>JSON.stringify({content:{request:{request:RE(e,Mn.nj)}},timestamp:Date.now(),callbackUrl:window.origin});const RE=(e,t)=>"bigint"==typeof e?t(e):Array.isArray(e)?e.map(e=>RE(e,t)):e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(e=>{let[n,r]=e;return[n,RE(r,t)]})):e;function ME(e){let{isCreatingWallet:t,skipSplashScreen:n}=e;return t?"EmbeddedWalletPasswordCreateScreen":n?"EmbeddedWalletPasswordUpdateScreen":"EmbeddedWalletPasswordUpdateSplashScreen"}function UE(e){let{walletAction:t,availableRecoveryMethods:n,legacySetWalletPasswordFlow:r,isResettingPassword:i,showAutomaticRecovery:s}=e;return s?"SetAutomaticRecoveryScreen":r||1===n.length?ME({isCreatingWallet:"create"===t,skipSplashScreen:i}):"RecoverySelectionScreen"}function LE(e){switch(e){case"user-passcode":return"PasswordRecoveryScreen";case"google-drive":case"icloud":return"RecoveryOAuthScreen";default:throw Error("Recovery method not supported")}}function BE(e,t,n,r,s,o,a){return(0,i.A)((0,i.A)({},e),{},{funding:null!==e&&void 0!==e&&e.funding?(0,i.A)((0,i.A)({},e.funding),{},{fundingResult:{status:t,address:e.funding.address,fundingMethod:void 0,transactionHash:n,amount:e.funding.amount,assetType:s?(null===o||void 0===o?void 0:o.symbol)||"ETH":a.nativeCurrency.symbol||"ETH",metadata:{walletClientType:r}}}):void 0,solanaFundingData:null===e||void 0===e?void 0:e.solanaFundingData,sendTransaction:null===e||void 0===e?void 0:e.sendTransaction})}const DE=new Map([["FundingMethodSelectionScreen",null],["TransferFromWalletScreen","external"],["FundingAmountEditScreen","external"],["ConnectOnlyLandingScreen","external"],["ConnectOnlyStatusScreen","external"],["AwaitingExter
2nalEthereumTransferScreen","external"],["AwaitingEvmToSolBridgingScreen","external"],["AwaitingSolToEvmBridgingScreen","external"],["ManualTransferScreen","manual"],["MoonpayStatusScreen","moonpay"]]);function jE(e){var t,n;let r=e.toLowerCase();return!(null===(t=window)||void 0===t||null===(t=t.webkit)||void 0===t||null===(t=t.messageHandlers)||void 0===t||!t.ReactNativeWebView)||!(null===(n=window)||void 0===n||!n.ReactNativeWebView)||["fbav","fban","instagram","snapchat","linkedinapp"].some(e=>r.includes(e))}async function FE(e){var t;let{rpc:n,address:r}=e;return null!==(t=(await n.getBalance(r,{commitment:"confirmed"}).send()).value)&&void 0!==t?t:0n}let zE={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",line_oauth:"line",twitch_oauth:"twitch",twitter_oauth:"twitter",wallet:"siwe",smart_wallet:"siwe",cross_app:"privy:"};const WE=e=>{if((0,g.i)(e))return{displayName:e.replace("custom:",""),loginMethod:"custom"};let t=zE[e];return"wallet"===e||"phone"===e?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}},qE=(e,t)=>!(0,g.b)(e)&&("all-users"===t||"users-without-wallets"===t&&!HE(e).length);let HE=e=>e.linkedAccounts.filter(e=>"wallet"===e.type&&"ethereum"===e.chainType);const VE=(e,t)=>!(0,g.c)(e)&&("all-users"===t||"users-without-wallets"===t&&!GE(e).length);let GE=e=>e.linkedAccounts.filter(e=>"wallet"===e.type&&"solana"===e.chainType);async function KE(e,t,n,r){let s=(0,Pn._)(e),o=await(async()=>r?await r():await t.prepareTransactionRequest((0,i.A)((0,i.A)({},s),{},{account:{address:n,type:"json-rpc"}})))();return(0,i.A)((0,i.A)({},o),{},{type:Pn.k[o.type]})}const JE=e=>{let{disabled:t}=e,{migrate:n}=(()=>{let e=(0,On.u)(),{user:t}=(0,g.u)(),{client:n,refreshSessionAndUser:r,walletProxy:i}=(0,w.u)();return{migrate:(0,a.useCallback)(async()=>{if("legacy-embedded-wallets-only"===e.embeddedWallets.mode)return{success:!0};if(!t)throw new w.a("User must be authenticated before migrating wallets",w.b.MUST_BE_AUTHENTICATED);if(!i)throw new w.a("Cannot connect to wallet proxy");let s=await n.getAccessToken();if(!s)throw new w.a("User must be authenticated before migrating wallets",w.b.MUST_BE_AUTHENTICATED);let o=t.linkedAccounts.filter(e=>"wallet"===e.type&&"privy"===e.walletClientType&&(0,b.i)(e)&&!(0,g.d)(e));if(0===o.length)return{success:!0};let a=o.filter(e=>e.imported),c=o.filter(e=>!e.imported);if(c.length>0){var l,u;let e=null!==(l=null!==(u=c.find(e=>"ethereum"===e.chainType&&0===e.walletIndex))&&void 0!==u?u:c.find(e=>"solana"===e.chainType&&0===e.walletIndex))&&void 0!==l?l:null;if(!e)throw new w.a("Primary wallet not found");let{entropyId:t,entropyIdVerifier:n}=(0,v.t)(e);try{await i.connect({accessToken:s,entropyId:t,entropyIdVerifier:n})}catch(r){if(!cE(r)||"privy"!==e.recoveryMethod)throw r;await i.recover({accessToken:s,entropyId:t,entropyIdVerifier:n})}await i.createDelegatedAction({accessToken:s,rootWallet:{address:e.address,chainType:e.chainType,imported:!1},delegatedWallets:c.map(e=>{var t;return{address:e.address,chainType:e.chainType,walletIndex:null!==(t=e.walletIndex)&&void 0!==t?t:0}})})}for(let e of a){var d;let{entropyId:t,entropyIdVerifier:n}=(0,v.t)(e);try{await i.connect({accessToken:s,entropyId:t,entropyIdVerifier:n})}catch(a){if(!cE(a)||"privy"!==e.recoveryMethod)throw a;await i.recover({accessToken:s,entropyId:t,entropyIdVerifier:n})}await i.createDelegatedAction({accessToken:s,rootWallet:{address:e.address,chainType:e.chainType,imported:!0},delegatedWallets:[{address:e.address,chainType:e.chainType,walletIndex:null!==(d=e.walletIndex)&&void 0!==d?d:0}]})}return await r(),{success:!0}},[e.embeddedWallets.mode,t,i,n,r])}})(),{user:r}=(0,g.u)(),{walletProxy:i}=(0,w.u)(),s=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{!t&&!s.current&&r&&i&&(s.current=!0,n().catch(e=>{console.debug("Unable to migrate wallets: ",e)}).finally(()=>{s.current=!1}))},[r,i,t,n]),null},ZE=e=>
2({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}),QE=(0,Hn.v)(()=>({ethereum:[]})),YE=()=>QE.getState().ethereum;class XE{async authenticate(){if(!this.api)throw new w.a("Auth flow has no API instance");try{return await this.api.post(jn.x,{token:this.meta.token})}catch(Qe){throw(0,w.f)(Qe)}}async link(){if(!this.api)throw new w.a("Auth flow has no API instance");try{return await this.api.post(jn.y,{token:this.meta.token})}catch(Qe){throw(0,w.f)(Qe)}}constructor(e){this.meta={token:e}}}function $E(e){let{subscribe:t,getExternalJwt:n,enabled:r=!0,onAuthenticated:i,onUnauthenticated:s,onError:o}=e,{client:c,onCustomAuthAuthenticated:l}=(0,w.u)(),{logout:u,authenticated:d,ready:h}=(0,zn.u)();if(!c)throw new w.a("`useSyncJwtBasedAuthState` must be used within a `PrivyProvider`");let[p,f]=(0,a.useState)({status:"initial"}),g=(0,a.useRef)(),m=(0,a.useRef)(!1),y=(0,a.useRef)(n);(0,a.useEffect)(()=>{y.current=n},[n]);let v=(0,a.useRef)(i);(0,a.useEffect)(()=>{v.current=i},[i]);let b=(0,a.useRef)(s);(0,a.useEffect)(()=>{b.current=s},[s]);let A=(0,a.useRef)(o);return(0,a.useEffect)(()=>{A.current=o},[o]),(0,a.useEffect)(()=>{if(!r||!h)return;let e=async()=>{if(!m.current){m.current=!0;try{var n,r;f({status:"loading"});let e=await y.current();if(void 0!==g.current&&g.current===e)return void f({status:"done"});if(!e)return d&&(await u(),null!==(n=b.current)&&void 0!==n&&n.call(b)),g.current=e,void f({status:"done"});c.startAuthFlow(new XE(e));let{user:t,isNewUser:i=!1}=await c.authenticate();if(!t)throw new w.a("Failed to sync with custom auth provider");null!==(r=v.current)&&void 0!==r&&r.call(v,{user:t,isNewUser:i}),l(t,i),g.current=e,f({status:"done"})}catch(t){var i,s;if(console.warn(t),await u().catch(()=>{}),null!==(i=b.current)&&void 0!==i&&i.call(b),t instanceof w.e&&t.privyErrorCode===w.b.LINKED_TO_ANOTHER_USER)return f({status:"initial"}),void setTimeout(()=>{e()},0);null!==(s=A.current)&&void 0!==s&&s.call(A,t),f({status:"error",error:t})}finally{m.current=!1}}};return e(),t(e)},[t,c,l,d,u,r,h]),r?{state:p}:{state:{status:"not-enabled"}}}let ek=(0,Hn.v)(()=>({jwtAuthFlowState:{status:"not-enabled"}}));function tk(e){let{customAuth:t}=e,{jwtAuthFlowState:n}=function(e,t){let{customAuth:n}=e,r=(0,qn.a)(),i=(0,a.useRef)(),s=(0,a.useCallback)(e=>(i.current=e,()=>{i.current=void 0}),[]),o=null!==(t=null===n||void 0===n?void 0:n.getCustomAccessToken)&&void 0!==t?t:()=>Promise.resolve(void 0),{state:c}=$E({enabled:!0===(null===n||void 0===n?void 0:n.enabled),subscribe:s,getExternalJwt:o,onAuthenticated:e=>{let{user:t,isNewUser:n}=e;r("login","onComplete",{user:t,isNewUser:n,wasAlreadyAuthenticated:!1,loginMethod:"custom",loginAccount:null}),r("customAuth","onAuthenticated",{user:t})},onUnauthenticated:()=>{r("customAuth","onUnauthenticated")},onError:e=>{r("login","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR)}});return(0,a.useEffect)(()=>{(async e=>{n&&!n.isLoading&&(null===(e=i.current)||void 0===e||e.call(i))})()},[null===n||void 0===n?void 0:n.enabled,null===n||void 0===n?void 0:n.getCustomAccessToken,null===n||void 0===n?void 0:n.isLoading]),{jwtAuthFlowState:c}}({customAuth:t});return(0,a.useEffect)(()=>{ek.setState({jwtAuthFlowState:n})},[n]),null}const nk=(0,a.createContext)(!1);let rk,ik,sk,ok,ak;const ck=e=>{var t,r,s;let c=e.client,l=e.privy,d=(0,zn.a)(),h=(0,On.u)();(0,y.d)((0,y.e)(null!==(t=null===h||void 0===h?void 0:h.appearance.walletList)&&void 0!==t?t:[]));let[p,f]=(0,a.useState)(!1),m=Dx(e=>e.inProgressMfaFlow),[A,_]=(0,a.useState)(!1),[x,E]=(0,a.useState)(null),k=QE(e=>e.ethereum),[S,I]=(0,a.useState)(void 0),[T,C]=(0,a.useState)(!1),[P,O]=(0,a.useState)(null),[N,R]=(0,a.useState)(!1),[M,U]=(0,a.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:w.n}),[L,B]=(0,a.useState)({status:"initial"}),[D,j]=(0,a.useState)({status:"initial"}),[F,z]=(0,a.useState)({status:"initial"}),[W,q]=(0,a.useState)({status:"initial"}),[H,V]=(0,a.useState)({status:"initial"}),[G,K]=(0,a.useState)({status:"initial"}),[J,Z]=(0,a.useState)(null),Q=(0,On.c)(),[Y,X]=(0,a.useState)({}),[$,ee]=(0,a.useState)(null),te=(0,a.useRef)(null),[ne,re]=(0,a.useState)(!1),[ie,se]=(0,a.useState)(!1),oe=(0,a.useRef)(null),ae=(0,a.useRef)(null),ce=(0,a.useRef)(qn.p),[le,ue]=(0,a.useState)(!1),[de,he]=(0,a.useState)(!1),pe=(0,a.useCallback)(e=>{he(e),!e&&P&&Bx[P]().then(e=>{e.default.isUnauthenticatedScreem&&O(null)})},[P]);c.onStoreCustomerAccessToken=e=>{e&&(0,qn.e)(ce,"accessToken","onAccessTokenGranted",{accessToken:e})},c.onDeleteCustomerAccessToken=()=>{E(null),pe(!1),(0,qn.e)(ce,"accessToken","onAccessTokenRemoved")};let fe=(0,a.useRef)(null),ge=(0,a.useRef)(null),me=(0,a.useRef)(!1),ye=e=>{let{showWalletUIs:t}=e;return me.current?me.current:void 0!==t?!t:!h.embeddedWallets.showWalletUIs},ve=e=>{O(e),setTimeout(()=>{f(!0)},15)};(0,a.useEffect)(()=>{var t,n,r;if(!x)return void(null===(t=c.connectors)||void 0===t||t.removeEmbeddedWalletConnectors());let i=(0,g.b)(x),s=(0,g.e)(x),o=(0,g.f)(x);i&&s.length||null!==(n=c.connectors)&&void 0!==n&&n.removeEmbeddedWalletConnectors(),o.length||null!==(r=c.connectors)&&void 0!==r&&r.removeImportedWalletConnectors(),c.connectors?J?(i&&c.connectors.addEmbeddedWalletConnectors({w
2alletProxy:J,user:x,embeddedWallets:s,defaultChain:h.defaultChain,appId:e.appId,privyClient:l}),o.forEach(t=>{var n;return null===(n=c.connectors)||void 0===n?void 0:n.addImportedWalletConnector(J,t.address,h.defaultChain,e.appId)})):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")},[J,x]),(0,a.useEffect)(()=>{var e;J&&(null===(e=te.current)||void 0===e||e.call(te,J))},[J]);let we=(0,a.useCallback)((e,t)=>{E(e),C(t),pe(!0),se(!0)},[]);(0,a.useEffect)(()=>{ie&&J&&x&&(async()=>{let e=qE(x,h.embeddedWallets.ethereum.createOnLogin),t=VE(x,h.embeddedWallets.solana.createOnLogin),n=await Z_();if(n){var r;if(e&&t){let e=await J.create({accessToken:n});return await J.createSolana({accessToken:n,ethereumAddress:null===e||void 0===e?void 0:e.address}),void se(!1)}if(t)return await J.createSolana({accessToken:n,ethereumAddress:null===(r=(0,g.b)(x))||void 0===r?void 0:r.address}),await Be.refreshSessionAndUser(),void se(!1);if(e)return await J.create({accessToken:n}),void se(!1)}})().catch(console.error)},[ie&&J&&x]),(0,a.useEffect)(()=>{if(h.externalWallets.solana.connectors)return h.externalWallets.solana.connectors.onMount(),()=>{var e;return null===(e=h.externalWallets.solana.connectors)||void 0===e?void 0:e.onUnmount()}},[h.externalWallets.solana.connectors]),(0,a.useEffect)(()=>{!A&&Q&&async function(e,t,n,r){let i,s=be(),o=Ae(),a=Nn();c.initializeConnectorManager({walletConnectCloudProjectId:h.walletConnectCloudProjectId,rpcConfig:h.rpcConfig,chains:h.chains,defaultChain:h.defaultChain,store:a,walletList:h.appearance.walletList,shouldEnforceDefaultChainOnConnect:h.shouldEnforceDefaultChainOnConnect,externalWalletConfig:h.externalWallets,appName:null!==(e=h.name)&&void 0!==e?e:"Privy",walletChainType:h.appearance.walletChainType,setBaseAccountSdk:I}),null!==(t=c.connectors)&&void 0!==t&&t.on("connectorInitialized",()=>{i&&clearTimeout(i);let e=c.connectors.walletConnectors.length,t=c.connectors.walletConnectors.reduce((e,t)=>e+(t.initialized?1:0),0);t===e?ue(!0):i=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:t,expected:e}),ue(!0)},1500)}),null===(n=c.connectors)||void 0===n||n.initialize().then(()=>{Se()});let l=await c.getAuthenticatedUser(),u=!!l;h.legal.requireUsersAcceptTerms&&l&&!l.hasAcceptedTerms?(await c.logout(),Be.setReadyToTrue(!0),(0,qn.e)(ce,"logout","onSuccess")):(null!==(r=h.customAuth)&&void 0!==r&&r.enabled||(pe(!!l),l&&(0,qn.e)(ce,"login","onComplete",{user:l,isNewUser:!1,wasAlreadyAuthenticated:!0,loginMethod:null,loginAccount:null}),E(l)),s?ge.current=u?"link":"login":o&&!u?(ge.current="login",X({telegramAuthModalData:{seamlessAuth:!0}}),ve("TelegramAuthScreen")):Be.setReadyToTrue(!!l))}()},[c,$,A,Q]),(0,a.useEffect)(()=>{if(A){if(!x||!x.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType))return void re(!!J);if([...k].some(e=>"privy"===e.walletClientType))return void re(!0);re(!!J)}},[A,x,k,J]),(0,a.useEffect)(()=>{var e;null===(e=c.connectors)||void 0===e||e.setWalletList(h.appearance.walletList)},[h.appearance.walletList.join()]);let be=()=>{let e=vx();return e.inProgress&&e.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):"error"===e.authorizationCode?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}):(e.inProgress&&e.provider.startsWith("privy:")&&!e.popupFlow&&(new BroadcastChannel(IE).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}),window.close()),!!e.inProgress&&!!e.withPrivyUi&&(c.startAuthFlow(new yx((0,i.A)((0,i.A)({},e),{},{customOAuthRedirectUrl:h.customOAuthRedirectUrl}))),ve("OAuthStatusScreen"),!0))},Ae=()=>{var e;let t=function(){let e;return(e=function(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),n=e.get("hash"),r=Number(e.get("auth_date")||""),i=e.get("first_name");if(t&&i&&r&&n)return Object.fromEntries(e.entries())}())?(Rx(),{flowType:"login-url",authData:e}):(e=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=Nx(e.replace("#tgWebAppData=","")),{user:n,auth_date:r,hash:i}=t;return n&&r&&i?t:void 0}())?(Rx(),{flowType:"web-app",authData:e}):void 0}();if(!t||!h.loginMethods.telegram||null===(e=h.loginConfig.telegramAuthConfiguration)||void 0===e||!e.seamlessAuthEnabled)return;let n=new Px;return c.startAuthFlow(n),"login-url"===t.flowType&&(n.meta.telegramWebAppData=void 0,n.meta.telegramAuthResult=t.authData),"web-app"===t.flowType&&(n.meta.telegramAuthResult=void 0,n.meta.telegramWebAppData=t.authData),!0},_e=async(e,t,n,r)=>{var i;if("solana_adapter"!==e)xe(await(null===(i=c.connectors)||void 0===i?void 0:i.createEthereumWalletConnector({connectorType:e,walletClientType:t}))||null,t,n,r);else{var s;let e=null===(s=c.connectors)||void 0===s?void 0:s.findSolanaWalletConnector(t);if(!e)return;xe(e,t,n,r)}};async function xe(e,t,n,r){if(!e)return U({status:"disconnected",connectedWallet:null,connectError:new w.P("Unable to connect to wallet."),connector:null,connectRetry:w.n}),null===r||void 0===r?void 0:r(null,n);U({status:"disconnected",connectedWallet:null,connectError:null,connector:e,connectRetry:w.n}),e instanceof iE&&t&&await e.resetConnection(t),U({connector:e,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>xe(e,t,n,r)});try{let t=await e.connect({showPrompt:!0});if((!t||(0,y.f)(t))&&h.shouldEnforceDefaultChainOnConnect&&!h.chains.find(e=>e.id===Number(null===t||void 0===t?void 0:t.chainId.replace("eip155:","")))&&("wallet_connect_v2"!==(null===t||void 0===t?void 0:t.connectorType)||"metamask"!==(null===t||void 0===t?void 0:t.walletClientType))){U(t=>(0,i.A)((0,i.A)({},t),{}
2,{connector:e,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:w.n}));try{await(null===t||void 0===t?void 0:t.switchChain(h.defaultChain.id)),t&&(t.chainId=(0,y.h)((0,Mn.nj)(h.defaultChain.id)))}catch(s){console.warn("Unable to switch to default chain: ".concat(h.defaultChain.id))}}return U(e=>(0,i.A)((0,i.A)({},e),{},{status:"connected",connectedWallet:t,connectError:null,connectRetry:w.n})),t&&(0,qn.e)(ce,"connectWallet","onSuccess",{wallet:t}),null===r||void 0===r?void 0:r(t,n)}catch(e){return e instanceof w.c?(console.warn(e.cause?e.cause:e.message),(0,qn.e)(ce,"connectWallet","onError",e.privyErrorCode||w.b.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),(0,qn.e)(ce,"connectWallet","onError",w.b.UNKNOWN_CONNECT_WALLET_ERROR)),U(t=>(0,i.A)((0,i.A)({},t),{},{status:"disconnected",connectedWallet:null,connectError:e})),null===r||void 0===r?void 0:r(null,n)}}let Ee=async(e,t,n)=>{if(null===e||!(0,y.f)(e))return;let r=new _x(c,e,t,n);c.startAuthFlow(r)},ke=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"plain",i=d(zn.b);if("transaction"===r&&!i)throw new w.a("useSolanaLedger plugin hook must be mounted");if(null===e||!(0,y.l)(e))return;let s=new xx(e,c,t,n,r,i);c.startAuthFlow(s)},Se=async()=>{let e=new URLSearchParams(window.location.search),t=e.get("privy_connector"),n=e.get("privy_wallet_client"),r="true"===e.get("privy_connect_only");if(!t||!n)return;let i=(0,y.n)({connectorType:t,walletClientType:n});if(!i||!i.isInstalled)return ve("LoginFailedScreen");if(!c.connectors)throw new w.a("Connector not initialized");await ve(r?"ConnectOnlyStatusScreen":"ConnectionStatusScreen");let s=new URL(window.location.href);s.searchParams.delete("privy_connector"),s.searchParams.delete("privy_wallet_client"),s.searchParams.delete("privy_connect_only"),window.history.pushState({},"",s),_e(t,n,void 0,r?void 0:"solana_adapter"===t?ke:Ee)};(0,a.useEffect)(()=>{A&&de&&null===x&&c.getAuthenticatedUser().then(E)},[A,de,x,c]);let Ie=e=>{if(!de)throw(0,qn.e)(ce,"linkAccount","onError",w.b.MUST_BE_AUTHENTICATED,{linkMethod:e}),new w.a("User must be authenticated before linking an account.")},Te=e=>{if(!de||!x)return!1;if("privy"===e.walletClientType)return!0;for(let t of x.linkedAccounts)if("wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType)return!0;return!1},Ce=()=>{QE.setState(e=>{var t;let n=(null===(t=c.connectors)||void 0===t?void 0:t.wallets.filter(y.f).map(e=>(0,i.A)((0,i.A)({},e),{},{linked:Te(e),loginOrLink:async()=>{if(!await e.isConnected())throw new w.a("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new w.a("Cannot link or login with embedded wallet");(async e=>{let t;if(!c.connectors)throw new w.a("Connector not initialized");t="ethereum"===e.type?c.connectors.findWalletConnector(e.connectorType,e.walletClientType)||null:c.connectors.findSolanaWalletConnector(e.walletClientType)||null,U(n=>(0,i.A)((0,i.A)({},n),{},{connector:t,status:"connected",connectedWallet:e,connectError:null,connectRetry:w.n})),h.captcha.enabled&&!de?(X({captchaModalData:{callback:t=>(0,y.f)(e)?Ee(e,t):ke(e,t),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),await ve("CaptchaScreen")):((0,y.f)(e)?await Ee(e):await ke(e),await ve("ConnectionStatusScreen"))})(e)},fund:async t=>{await Be.fundWallet(e.address,t)},unlink:async()=>{if(!de)throw new w.a("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new w.a("Cannot unlink an embedded wallet");E(await c.unlinkEthereumWallet(e.address))}})))||[];return(0,y.j)(e.ethereum,n)?{}:{ethereum:n}})};(0,a.useEffect)(()=>{Ce()},[null===x||void 0===x?void 0:x.linkedAccounts,de,A]),(0,a.useEffect)(()=>{if(A){if(!c.connectors)throw new w.a("Connector not initialized");Ce(),c.connectors.on("walletsUpdated",Ce)}},[A]),(0,a.useEffect)(()=>{var e,t,n,r;[...null!==(e=null===(t=h.loginMethodsAndOrder)||void 0===t?void 0:t.primary)&&void 0!==e?e:[],...null!==(n=null===(r=h.loginMethodsAndOrder)||void 0===r?void 0:r.overflow)&&void 0!==n?n:[]].filter(e=>
2e.startsWith("privy:")).forEach(e=>c.getCrossAppProviderDetails(e.replace("privy:","")))},[!!c]);let Pe=t=>{let{transaction:n,sponsor:r,uiOptions:s,fundWalletConfig:o,address:a,signOnly:d}=t;return new Promise(async(t,p)=>{var f,m;let{requesterAppId:A}=s||{},_=d?"signTransaction":"sendTransaction",E=a?(0,g.h)(x,a):(0,g.b)(x);if(!E&&a){let e=(0,g.k)(YE(),a);if(e){if(r)throw new w.a("Cannot sponsor transactions for externally connected wallet.");try{let r=await e.getEthereumProvider(),s=(0,i.A)((0,i.A)({},n),{},{from:a,chainId:n.chainId||Number(e.chainId.replace("eip155:","")),value:void 0!==n.value?(0,Mn.nj)(n.value):void 0}),o=await r.request({method:"sendTransaction"===_?"eth_sendTransaction":"eth_signTransaction",params:[s]});return(0,qn.e)(ce,_,"onSuccess",{hash:o}),void t({hash:o})}catch(n){return(0,qn.e)(ce,_,"onError",w.b.TRANSACTION_FAILURE),void p(null!==n&&void 0!==n?n:new b.P("Unable to "+_+n))}}}if(!E)return(0,qn.e)(ce,_,"onError",w.b.EMBEDDED_WALLET_NOT_FOUND),void p(new w.a("No embedded or connected wallet found for address."));if(!de||!x)return(0,qn.e)(ce,_,"onError",w.b.MUST_BE_AUTHENTICATED),void p(Error("User must be authenticated before signing with a Privy wallet"));let k=E.address,S=null!==(f=E.walletIndex)&&void 0!==f?f:0,{entropyId:I,entropyIdVerifier:T}=(0,v.g)(x,E),C=De.wallets.find(e=>"privy"===e.walletClientType&&(0,Un.b)(e.address)===(0,Un.b)(k));if(!C)return(0,qn.e)(ce,_,"onError",w.b.EMBEDDED_WALLET_NOT_FOUND),void p(Error("Must have a Privy wallet before signing"));let P=await C.getEthereumProvider(),O=await P.request({method:"eth_chainId"}),N=n.chainId?Number(n.chainId):(0,b.b)(O);(e=>{if(!h.chains.map(e=>e.id).includes(e))throw new w.P("Chain ID ".concat(e," is not supported. It must be added to the config.supportedChains property of the PrivyProvider."),w.b.UNSUPPORTED_CHAIN_ID)})(N);let R=(0,i.A)((0,i.A)({},n),{},{from:null!==(m=n.from)&&void 0!==m?m:k,chainId:N}),M=await Z_();if(!M||!J)return(0,qn.e)(ce,_,"onError",w.b.EMBEDDED_WALLET_NOT_FOUND),void p(Error("Must have valid access token and Privy wallet to send transaction"));let U=(0,C_.g)(R.chainId,h.chains,h.rpcConfig,{appId:e.appId}),L=(0,g.d)(E),B=async e=>{let{transactionRequest:t}=e;try{let e;if(!await Be.recoverEmbeddedWallet({address:k}))throw(0,qn.e)(ce,_,"onError",w.b.UNKNOWN_CONNECT_WALLET_ERROR),p(Error("Unable to connect to wallet")),Error("Unable to connect to wallet");if(r){let e=await(async e=>{let{transactionRequest:t}=e;if(!L)throw new w.a("Sponsoring is only supported for wallets on the TEE stack");if(d)throw new w.a("Cannot sponsor a sign transaction request");let n=e=>null==e?void 0:(0,Mn.nj)(e),r=await(0,u._)(l,async e=>{let{message:t}=e;return await J.signWithUserSigner({accessToken:M,requesterAppId:A,message:t})},{chain_type:"ethereum",method:"eth_sendTransaction",caip2:(0,y.h)((0,Mn.nj)(t.chainId)),sponsor:!0,params:{transaction:{from:t.from,to:t.to,chain_id:n(t.chainId),data:(0,Ln.q)(t.data)?t.data?t.data:(0,Mn.nj)(Uint8Array.from(t.data)):void 0,value:n(t.value)}},wallet_id:E.id});if(r.data&&"hash"in r.data)return r.data.hash;throw new b.P("Unable to sign transaction")})({transactionRequest:t});return(0,qn.e)(ce,"sendTransaction","onSuccess",{hash:e}),e}if(L){var n,i;let r=e=>null==e?void 0:(0,Mn.nj)(e),s=await(0,u._)(l,async e=>{let{message:t}=e;return await J.signWithUserSigner({accessToken:M,requesterAppId:A,message:t})},{chain_type:"ethereum",method:"eth_signTransaction",params:{transaction:{from:t.from,to:t.to,nonce:r(t.nonce),chain_id:r(t.chainId),data:(0,Ln.q)(t.data)?t.data?t.data:(0,Mn.nj)(Uint8Array.from(t.data)):void 0,value:r(t.value),type:t.type,gas_limit:r(null!==(n=t.gasLimit)&&void 0!==n?n:t.gas),gas_price:r(null!==(i=t.gasPrice)&&void 0!==i?i:t.gas),max_fee_per_gas:r(t.maxFeePerGas),max_priority_fee_per_gas:r(t.maxPriorityFeePerGas)}},wallet_id:E.id});if(!s.data||!("signed_transaction"in s.data))throw new b.P("Unable to sign transaction");e=s.data.signed_transaction}else e=await async function(e){let{accessToken:t,entropyId:n,entropyIdVerifier:r,transactingWalletIndex:i,walletProxy:s,transactionRequest:o,requesterAppId:a}=e;return(await s.rpc({entropyId:n,entropyIdVerifier:r,hdWalletIndex:null!==i&&void 0!==i?i:0,chainType:"ethereum",accessToken:t,requesterAppId:a,request:{method:"eth_signTransaction",params:[o]}})).response.data}({accessToken:M,entropyId:I,entropyIdVerifier:T,transactingWalletIndex:S,walletProxy:J,transactionRequest:t,requesterAppId:A});if(d)return(0,qn.e)(ce,"signTransaction","onSuccess",{signature:e}),e;{let t=await U.sendRawTransaction({serializedTransaction:e});return(0,qn.e)(ce,"sendTransaction","onSuccess",{hash:t}),t}}catch(t){throw(0,qn.e)(ce,_,"onError",w.b.TRANSACTION_FAILURE),t}};if(ye({showWalletUIs:null===s||void 0===s?void 0:s.showWalletUIs})){let e=d||r?R:await KE(R,U,R.from);try{let n=await B({transactionRequest:e});d?(0,qn.e)(ce,"signTransaction","onSuccess",{signature:n}):(0,qn.e)(ce,"sendTransaction","onSuccess",{hash:n}),t({hash:n})}catch(n){(0,qn.e)(ce,_,"onError",w.b.TRANSACTION_FAILURE),p(n)}}else{let e={connectingWalletAddress:k,recoveryMethod:E.recoveryMethod,entropyId:I,entropyIdVerifier:T,onCompleteNavigateTo:"SendTransactionScreen",isUnifiedWallet:L,onFailure:e=>{(0,qn.e)(ce,_,"onError",w.b.UNKNOWN_CONNECT_WALLET_ERROR),p(e)}},n=(e=>!!e.fundingConfig&&(0,b.a)(e.fundingConfig.options).length>=1)(h)?(0,b.p)({address:k,appConfig:h,fundWalletConfig:o,methodScreen:"FundingMethodSelectionScreen",chainIdOverride:R.chainId,comingFromSendTransactionScreen:!0}):void 0;X({connectWallet:e,sendTransaction:{transactionRequest:R,transactingWalletIndex:S,transactingWalletAddress:k,entropyId:I,entropyIdVerifier:T,signOnly:d,scanTransaction:async()=>{var e,t,n,r;let i=await KE(R,U,R.from);return await c.scanTransaction({metadata:{domain:h.embeddedWallets.transactionScanning.domain},chain_id:i.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:null===(e=i.value)||void 0===e?void 0:e.toString(),gas:null===(t=i.gas)||void 0===t?void 0:t.toString(),gasPrice:null===(n=i.gasPrice)||void 0===n?void 0:n.toString(),nonce:null===(r=i.nonce)||void 0===r?void 0:r.toString(),data:i.data}]}})},getIsSponsored:async()=>!!r,onConfirm:e=>{let{transactionRequest:t}=e;return B({transactionRequest:t})},onSuccess:e=>{d?(0,qn.e)(ce,"signTransaction","onSuccess",{signature:e.hash}):(0,qn.e)(ce,"sendTransaction","onSuccess",{hash:e.hash}),t(e)},onFailure:e=>{(0,qn.e)(ce,_,"onError",w.b.TRANSACTION_FAILURE),p(e)},uiOptions:s||{},fundWalletConfig:o,requesterAppId:A},funding:n}),ve("EmbeddedWalletConnectingScreen")}})};function Oe(){return new Promise(async(e,t)=>{let n=await Z_();
2if(!n||!J)throw Error("Must have valid access token to enroll in MFA");try{await J.verifyMfa({accessToken:n}),e()}catch(e){t(e)}})}let Ne=e=>null===e||void 0===e?void 0:e.linkedAccounts.filter(e=>null!==e.latestVerifiedAt&&!("wallet"===e.type&&"privy"===e.walletClientType)).sort((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime())[0],Re=e=>{var t;let n=null!==(t=null===x||void 0===x?void 0:x.linkedAccounts.filter(t=>t.type===e).length)&&void 0!==t?t:0,{displayName:r,loginMethod:i}=WE(e);if("passkey"===e&&n>=5||"passkey"!==e&&n>=1)throw(0,qn.e)(ce,"linkAccount","onError",w.b.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:i}),new w.a("User already has an account of type ".concat(r," linked."))};async function Me(e){let{showAutomaticRecovery:t=!1,legacySetWalletPasswordFlow:n=!1}=e;O(null);let r=n?"setWalletPassword":"setWalletRecovery";if(!de||!x)throw(0,qn.e)(ce,r,"onError",w.b.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let i=(0,g.g)(x);if(!i||!J)throw(0,qn.e)(ce,r,"onError",w.b.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");let s=(0,g.d)(i);if(s)throw(0,qn.e)(ce,r,"onError",w.b.UNSUPPORTED_WALLET_TYPE),new w.a("User owned wallet recovery is only supported for on-device execution and this app uses TEE execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");try{await Oe()}catch(t){throw(0,qn.e)(ce,r,"onError",w.b.MISSING_MFA_CREDENTIALS),t}return new Promise((e,o)=>{let a="user-passcode"===i.recoveryMethod,c=UE({walletAction:"update",availableRecoveryMethods:h.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:n,isResettingPassword:a,showAutomaticRecovery:t}),{entropyId:l,entropyIdVerifier:u}=(0,v.g)(x),d={recoveryMethod:i.recoveryMethod,connectingWalletAddress:i.address,onCompleteNavigateTo:c,shouldForceMFA:!1,entropyId:l,isUnifiedWallet:s,entropyIdVerifier:u,onFailure:e=>{(0,qn.e)(ce,r,"onError",w.b.UNKNOWN_CONNECT_WALLET_ERROR),o(e)}};X({setWalletPassword:{onSuccess:t=>{(0,qn.e)(ce,r,"onSuccess",{method:"user-passcode",wallet:t}),e(t)},onFailure:e=>{(0,qn.e)(ce,r,"onError",w.b.USER_EXITED_SET_PASSWORD_FLOW),o(e)},callAuthOnSuccessOnClose:!1},recoverWallet:{entropyId:l,entropyIdVerifier:u,onFailure:o},connectWallet:d,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:a,shouldCreateEth:!1,shouldCreateSol:!1}}),ve("EmbeddedWalletConnectingScreen")})}async function Ue(e){let{appId:t,action:n}=e,r=await Z_();if("link"===n&&!r)throw(0,qn.e)(ce,"linkAccount","onError",w.b.MUST_BE_AUTHENTICATED,{linkMethod:"privy:".concat(t)}),new w.a("User must be authenticated before linking an account.");if("login"===n&&r)throw(0,qn.e)(ce,"login","onError",w.b.UNKNOWN_AUTH_ERROR),new w.a("Attempted to log in, but user is already logged in. Use a `link` helper instead.");fe.current="privy:".concat(t),ge.current=n;let i=(0,Dn.h)();return c.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:t}}),new Promise(async(e,r)=>{let{name:s,logoUrl:o}=await PE({api:c.api,providerAppId:t,requesterAppId:h.id});X({crossAppAuth:{appId:t,name:s,logoUrl:o,action:n,popup:i,onSuccess:e,onError:r}}),ve("CrossAppAuthScreen")})}let Le={ready:A,authenticated:de,user:x,walletConnectors:c.connectors||null,connectWallet:e=>{var t,n,r,i,s;e&&"target"in e&&e&&(e=void 0),X({externalConnectWallet:{walletList:null!==(t=e)&&void 0!==t&&t.walletList&&(null===(n=e)||void 0===n?void 0:n.walletList.length)>0?e.walletList:void 0,walletChainType:null===(r=e)||void 0===r?void 0:r.walletChainType,description:null===(i=e)||void 0===i?void 0:i.description,hideHeader:null===(s=e)||void 0===s?void 0:s.hideHeader}}),ve("ConnectOnlyLandingScreen")},linkWallet:e=>{var t,n,r;return e&&"target"in e&&e&&(e=void 0),Ie("siwe"),fe.current="siwe",ge.current="link",X((0,i.A)((0,i.A)({},Y),{},{externalConnectWallet:(0,i.A)((0,i.A)({},Y.externalConnectWallet),{},{walletList:null===(t=e)||void 0===t?void 0:t.walletList,walletChainType:null===(n=e)||void 0===n?void 0:n.walletChainType,description:(null===(r=e)||void 0===r?void 0:r.description)||"Link a wallet to your ".concat(null===h||void 0===h?void 0:h.name," account")}
2)})),ve("AuthenticateWithWalletScreen")},startCrossAppAuthFlow:Ue,linkEmail:()=>{Ie("email"),Re("email"),fe.current="email",ge.current="link",ve("LinkEmailScreen")},linkPhone:()=>{Ie("sms"),Re("phone"),fe.current="sms",ge.current="link",ve("LinkPhoneScreen")},linkGoogle:async()=>{Ie("google"),Re("google_oauth"),ge.current="link",await Be.initLoginWithOAuth("google")},linkTwitter:async()=>{Ie("twitter"),Re("twitter_oauth"),ge.current="link",await Be.initLoginWithOAuth("twitter")},linkTwitch:async()=>{Ie("twitch"),Re("twitch_oauth"),ge.current="link",await Be.initLoginWithOAuth("twitch")},linkDiscord:async()=>{Ie("discord"),Re("discord_oauth"),ge.current="link",await Be.initLoginWithOAuth("discord")},linkGithub:async()=>{Ie("github"),Re("github_oauth"),ge.current="link",await Be.initLoginWithOAuth("github")},linkSpotify:async()=>{Ie("spotify"),Re("spotify_oauth"),ge.current="link",await Be.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Ie("instagram"),Re("instagram_oauth"),ge.current="link",await Be.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Ie("tiktok"),Re("tiktok_oauth"),ge.current="link",await Be.initLoginWithOAuth("tiktok")},linkLine:async()=>{Ie("line"),Re("line_oauth"),ge.current="link",await Be.initLoginWithOAuth("line")},linkLinkedIn:async()=>{Ie("linkedin"),Re("linkedin_oauth"),ge.current="link",await Be.initLoginWithOAuth("linkedin")},linkApple:async()=>{Ie("apple"),Re("apple_oauth"),ge.current="link",await Be.initLoginWithOAuth("apple")},linkPasskey:async()=>{Ie("passkey"),Re("passkey"),await Be.initLinkWithPasskey(),ve("LinkPasskeyScreen")},linkTelegram:async e=>{if(Ie("telegram"),Re("telegram"),ge.current="link",fe.current="telegram",null!==e&&void 0!==e&&e.launchParams)if(e.launchParams.initDataRaw){let t=new Px;c.startAuthFlow(t),t.meta.telegramAuthResult=void 0,t.meta.telegramWebAppData=Nx(e.launchParams.initDataRaw),X({telegramAuthModalData:{seamlessAuth:!0}}),ve("TelegramAuthScreen")}else(0,qn.e)(ce,"linkAccount","onError",w.b.INVALID_DATA,{linkMethod:"telegram"});else await Be.initLoginWithTelegram();ve("TelegramAuthScreen")},linkFarcaster:async()=>{Ie("farcaster"),Re("farcaster"),await Be.initLoginWithFarcaster(),ge.current="link",fe.current="farcaster",ve("FarcasterConnectStatusScreen")},updateEmail:()=>{if(Ie("email"),null===x||void 0===x||!x.email)throw new w.a("User does not have an email linked to their account.");ge.current="update",fe.current="email",ve("UpdateEmailScreen")},updatePhone:()=>{if(Ie("sms"),null===x||void 0===x||!x.phone)throw new w.a("User does not have a phone number linked to their account.");ge.current="update",fe.current="sms",ve("UpdatePhoneScreen")},login:async e=>{e&&"target"in e&&e&&(e=void 0);let t="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!A){let e=await new Promise(e=>{ee(t=>e.bind(t))});if(ee(null),e)return void console.warn(t)}!x||x.isGuest?(ge.current="login",X({login:e}),ve("LandingScreen")):console.warn(t)},connectOrCreateWallet:async()=>{A||(await new Promise(e=>{ee(()=>e)}),ee(null)),de?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(ge.current="connect-or-create",ve("ConnectOrCreateScreen"))},logout:async()=>{if(ge.current=null,fe.current=null,x&&c.clearProviderAcccessTokens(x),O(null),await c.logout(),x&&J)try{await J.clearMfa({userId:x.id})}catch(Qe){}E(null),pe(!1),j({status:"initial"}),z({status:"initial"}),B({status:"initial"}),q({status:"initial"}),V({status:"initial"}),K({status:"initial"}),(0,qn.e)(ce,"logout","onSuccess"),f(!1),b.u.del(On.d),b.u.del((0,On.g)(h.id))},getAccessToken:(0,a.useCallback)(async()=>{let e=await c.getCustomerAccessToken();return e&&!de&&pe(!0),e},[c,de]),unlinkWallet:async e=>{let t;return E(t=e.startsWith("0x")?await c.unlinkEthereumWallet(e):await c.unlinkSolanaWallet(e)),t},unlinkEmail:async e=>{let t=await c.unlinkEmail(e);return E(t),t},unlinkPhone:async e=>{let t=await c.unlinkPhone(e);return E(t),t},unlinkGoogle:async e=>{let t=await c.unlinkOAuth("google",e);return E(t),t},unlinkTwitter:async e=>{let t=await c.unlinkOAuth("twitter",e);return E(t),t},unlinkTwitch:async e=>{let t=await c.unlinkOAuth("twitch",e);return E(t),t},unlinkDiscord:async e=>{let t=await c.unlinkOAuth("discord",e);return E(t),t},unlinkGithub:async e=>{let t=await c.unlinkOAuth("github",e);return E(t),t},unlinkSpotify:async e=>{let t=await c.unlinkOAuth("spotify",e);return E(t),t},unlinkInstagram:async e=>{let t=await c.unlinkOAuth("instagram",e);return E(t),t},unlinkTiktok:async e=>{let t=await c.unlinkOAuth("tiktok",e);return E(t),t},unlinkLine:async e=>{let t=await c.unlinkOAuth("line",e);return E(t),t},unlinkLinkedIn:async e=>{let t=await c.unlinkOAuth("linkedin",e);return E(t),t},unlinkApple:async e=>{let t=await c.unlinkOAuth("apple",e);return E(t),t},unlinkFarcaster:async e=>{let t=await c.unlinkFarcaster(e);return E(t),t},unlinkTelegram:async e=>{let t=await c.unlinkTelegram(e);return E(t),t},unlinkPasskey:async e=>{let t=await Z_();
2if(!t)throw Error("Must have valid access token to enroll in MFA");if(!J)throw Error("Wallet proxy not initialized.");let n=h.passkeys.shouldUnenrollMfaOnUnlink;await J.unlinkPasskeyAccount({credentialId:e,accessToken:t,removeAsMfa:n});let r=await c.getAuthenticatedUser();return E(r),r},unlinkCrossAppAccount:async e=>{var t;let{subject:n}=e,r=null===x||void 0===x||null===(t=x.linkedAccounts.find(e=>"cross_app"===e.type&&e.subject===n))||void 0===t?void 0:t.providerApp;if(!r)throw new w.a("Invalid subject");c.storeProviderAccessToken(r.id,null);let i=await c.unlinkOAuth("privy:".concat(r.id),n);return E(i),i},setWalletRecovery:async e=>{var t;return Me({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:null!==(t=null===e||void 0===e?void 0:e.showAutomaticRecovery)&&void 0!==t&&t})},setWalletPassword:async()=>Me({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(e,t)=>new Promise(async(n,r)=>{var i,s;let{requesterAppId:o}=(null===t||void 0===t?void 0:t.uiOptions)||{},a=e.message,d=null!==t&&void 0!==t&&t.address?(0,g.h)(x,t.address):(0,g.b)(x);if(!d&&void 0!==(null===t||void 0===t?void 0:t.address)){let i=(0,g.k)(YE(),t.address);if(i)try{let e=await i.getEthereumProvider(),t=await e.request({method:"personal_sign",params:[a,i.address]});return(0,qn.e)(ce,"signMessage","onSuccess",{signature:t}),void n({signature:t})}catch(e){return(0,qn.e)(ce,"signMessage","onError",w.b.UNABLE_TO_SIGN),void r(null!==e&&void 0!==e?e:new b.P("Unable to sign message"))}}if(!d)throw new w.a("No embedded or connected wallet found for address.");if(!de||!x)return(0,qn.e)(ce,"signMessage","onError",w.b.MUST_BE_AUTHENTICATED),void r(Error("User must be authenticated before signing with a Privy wallet"));let h=d.address,p=null!==(i=d.walletIndex)&&void 0!==i?i:0,{entropyId:f,entropyIdVerifier:m}=(0,v.g)(x,d),y=(0,g.d)(d);if("string"!=typeof a||a.length<1)return(0,qn.e)(ce,"signMessage","onError",w.b.INVALID_MESSAGE),void r(Error("Message must be a non-empty string"));let A=async()=>{let t;if(!de)throw Error("User must be authenticated before signing with a Privy wallet");let n=await Z_();if(!J||!n||!await Be.recoverEmbeddedWallet({address:h}))throw Error("Unable to connect to wallet");if(c.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:h,requesterAppId:o}}
2),y){let r=(0,Ln.q)(e.message,{strict:!0}),i=await(0,u._)(l,async e=>{let{message:t}=e;return await J.signWithUserSigner({accessToken:n,requesterAppId:o,message:t})},{chain_type:"ethereum",method:"personal_sign",params:r?{message:a.slice(2),encoding:"hex"}:{message:a,encoding:"utf-8"},wallet_id:d.id});if(!i.data||!("signature"in i.data))throw new b.P("Unable to sign message");t=i.data.signature}else{let{response:e}=await J.rpc({accessToken:n,entropyId:f,entropyIdVerifier:m,chainType:"ethereum",hdWalletIndex:p,requesterAppId:o,request:{method:"personal_sign",params:[a,h]}});t=e.data}return c.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:h,requesterAppId:o}}),t};if(ye({showWalletUIs:null===t||void 0===t||null===(s=t.uiOptions)||void 0===s?void 0:s.showWalletUIs}))try{let e=await A();(0,qn.e)(ce,"signMessage","onSuccess",{signature:e}),n({signature:e})}catch(e){(0,qn.e)(ce,"signMessage","onError",w.b.UNABLE_TO_SIGN),r(null!==e&&void 0!==e?e:new b.P("Unable to sign message"))}else X({signMessage:{method:"personal_sign",data:a,confirmAndSign:A,onSuccess:e=>{(0,qn.e)(ce,"signMessage","onSuccess",{signature:e}),n({signature:e})},onFailure:e=>{(0,qn.e)(ce,"signMessage","onError",w.b.UNABLE_TO_SIGN),r(e)},uiOptions:(null===t||void 0===t?void 0:t.uiOptions)||{}},connectWallet:{recoveryMethod:d.recoveryMethod,connectingWalletAddress:h,entropyId:f,entropyIdVerifier:m,onCompleteNavigateTo:"SignRequestScreen",isUnifiedWallet:y,onFailure:e=>{(0,qn.e)(ce,"signMessage","onError",w.b.UNKNOWN_CONNECT_WALLET_ERROR),r(e)}}}),ve("EmbeddedWalletConnectingScreen")}),signTypedData:(e,t)=>new Promise(async(n,r)=>{var i,s;let{requesterAppId:o}=(null===t||void 0===t?void 0:t.uiOptions)||{},a=null!==t&&void 0!==t&&t.address?(0,g.h)(x,t.address):(0,g.b)(x);if(!a&&null!==t&&void 0!==t&&t.address){let i=(0,g.k)(YE(),t.address);if(i)try{let t=await i.getEthereumProvider(),r=(0,y.m)(e),s=await t.request({method:"eth_signTypedData_v4",params:[i.address,r]});return(0,qn.e)(ce,"signTypedData","onSuccess",{signature:s}),void n({signature:s})}catch(e){return(0,qn.e)(ce,"signTypedData","onError",w.b.UNABLE_TO_SIGN),void r(null!==e&&void 0!==e?e:new b.P("Unable to sign typed data "+e))}}if(!a)throw new w.a("No embedded or connected wallet found for address.");if(!de||!x)return(0,qn.e)(ce,"signTypedData","onError",w.b.MUST_BE_AUTHENTICATED),void r(Error("User must be authenticated before signing with a Privy wallet"));let d=a.address,h=null!==(i=a.walletIndex)&&void 0!==i?i:0,{entropyId:p,entropyIdVerifier:f}=(0,v.g)(x,a),m=(0,g.d)(a),A=(0,y.m)(e),_=async()=>{let e;if(!de)throw Error("User must be authenticated before signing with a Privy wallet");let t=await Z_();if(!J||!t||!await Be.recoverEmbeddedWallet({address:d}))throw Error("Unable to connect to wallet");if(c.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:d,requesterAppId:o}}),m){let{domain:n,types:r,primaryType:i,message:s}=A,c=await(0,u._)(l,async e=>{let{message:n}=e;return await J.signWithUserSigner({accessToken:t,requesterAppId:o,message:n})},{chain_type:"ethereum",method:"eth_signTypedData_v4",params:{typed_data:{domain:n,types:r,primary_type:i,message:s}},wallet_id:a.id});if(!c.data||!("signature"in c.data))throw new b.P("Unable to sign message");e=c.data.signature}else{let{response:n}=await J.rpc({accessToken:t,entropyId:p,entropyIdVerifier:f,chainType:"ethereum",hdWalletIndex:h,requesterAppId:o,request:{method:"eth_signTypedData_v4",params:[d,A]}});e=n.data}return c.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:d,requesterAppId:o}}),e};if(ye({showWalletUIs:null===t||void 0===t||null===(s=t.uiOptions)||void 0===s?void 0:s.showWalletUIs}))try{let e=await _();(0,qn.e)(ce,"signTypedData","onSuccess",{signature:e}),n({signature:e})}catch(e){(0,qn.e)(ce,"signTypedData","onError",w.b.UNABLE_TO_SIGN),r(null!==e&&void 0!==e?e:new b.P("Unable to sign message"))}else X({signMessage:{method:"eth_signTypedData_v4",data:A,confirmAndSign:_,onSuccess:e=>{(0,qn.e)(ce,"signTypedData","onSuccess",{signature:e}),n({signature:e})},onFailure:e=>{(0,qn.e)(ce,"signTypedData","onError",w.b.UNABLE_TO_SIGN),r(e)},uiOptions:(null===t||void 0===t?void 0:t.uiOptions)||{}},connectWallet:{recoveryMethod:a.recoveryMethod,connectingWalletAddress:a.address,entropyId:p,isUnifiedWallet:m,entro
2pyIdVerifier:f,onCompleteNavigateTo:"SignRequestScreen",onFailure:e=>{(0,qn.e)(ce,"signMessage","onError",w.b.UNKNOWN_CONNECT_WALLET_ERROR),r(e)}}}),ve("EmbeddedWalletConnectingScreen")}),sendTransaction:async(e,t)=>await Pe({transaction:e,sponsor:null===t||void 0===t?void 0:t.sponsor,uiOptions:null===t||void 0===t?void 0:t.uiOptions,fundWalletConfig:null===t||void 0===t?void 0:t.fundWalletConfig,address:null===t||void 0===t?void 0:t.address,signOnly:!1}),signTransaction:async(e,t)=>({signature:(await Pe({transaction:e,uiOptions:null===t||void 0===t?void 0:t.uiOptions,address:null===t||void 0===t?void 0:t.address,signOnly:!0})).hash}),exportWallet:t=>new Promise(async(n,r)=>{var i;if(!de||!x)return void r(Error("User must be authenticated before exporting their Privy wallet"));t&&"target"in t&&t&&(t=void 0);let s=null!==(i=t)&&void 0!==i&&i.address?(0,g.h)(x,t.address):(0,g.b)(x);if(!s)return void r(new w.a("User must have an embedded wallet."));let o=s.address,{entropyId:a,entropyIdVerifier:l}=(0,v.g)(x,s),u=(0,g.d)(s);if(!o)return void r(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));if(!(0,Bn.P)(o))return void r(Error("Must provide a valid Ethereum address."));let d={recoveryMethod:s.recoveryMethod,connectingWalletAddress:s.address,isUnifiedWallet:u,entropyId:a,entropyIdVerifier:l,onCompleteNavigateTo:"EmbeddedWalletKeyExportScreen",onFailure:r,shouldForceMFA:!0};X(Y),await Z_()&&J?J?(0,b.i)(s)?(X({keyExport:{appId:e.appId,appClientId:e.clientId,origin:c.apiUrl,address:s.address,entropyId:a,entropyIdVerifier:l,hdWalletIndex:s.walletIndex,chainType:s.chainType,walletId:s.id,isUnifiedWallet:u,imported:s.imported,onSuccess:n,onFailure:r},connectWallet:d}),ve("EmbeddedWalletConnectingScreen")):r(Error("Export is not supported for ".concat(s.chainType," wallets"))):r(Error("Must have a Privy wallet before exporting")):r(Error("Must have valid access token to enroll in MFA"))}),promptMfa:Oe,async init(e){switch(e){case"sms":return void await c.initMfaSmsVerification();case"passkey":return await c.initMfaPasskeyVerification();case"totp":return;default:throw Error("Unsupported MFA method: ".concat(e))}},async submit(e,t){var r,i,s;switch(e){case"totp":case"sms":if("string"!=typeof t)throw new w.a("Invalid MFA code");null!==(r=oe.current)&&void 0!==r&&r.resolve({mfaMethod:e,mfaCode:t,relyingParty:window.origin}),await new Promise((e,t)=>{ae.current={resolve:e,reject:t}});break;case"passkey":if("string"==typeof t)throw new w.a("Invalid authenticator response");let o=await n.e(4949).then(n.bind(n,84949)),a=ZE(await o.startAuthentication({optionsJSON:t}));null!==(i=oe.current)&&void 0!==i&&i.resolve({mfaMethod:e,mfaCode:a,relyingParty:window.origin}),await new Promise((e,t)=>{ae.current={resolve:e,reject:t}});break;default:throw null!==(s=oe.current)&&void 0!==s&&s.reject(new w.a("Unsupported MFA method")),new w.a("Unsupported MFA method: ".concat(e))}},cancel(){var e;null===(e=oe.current)||void 0===e||e.reject(new w.a("MFA canceled"))},async initEnrollmentWithSms(e){let t=await Z_();if(!t||!J)throw Error("Must have valid access token to enroll in MFA");await J.initEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber})},enrollInMfa:e=>new Promise((t,n)=>{if(!e)return Be.closePrivyModal(),void t();h.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),X({mfaEnrollmentFlow:{mfaMethods:h.mfa.methods,shouldUnlinkOnUnenrollMfa:h.passkeys.shouldUnlinkOnUnenrollMfa,onSuccess:t,onFailure:n}}),ve("MfaEnrollmentFlowScreen")}),async initEnrollmentWithTotp(){let e=await Z_();if(!e||!J)throw Error("Must have valid access token to enroll in MFA");let t=await J.initEnrollMfa({method:"totp",accessToken:e});return{secret:t.secret,authUrl:t.authUrl}},async submitEnrollmentWithSms(e){let t=await Z_();if(!t||!J)throw Error("Must have valid access token to enroll in MFA");await J.submitEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber,code:e.mfaCode}),E(await c.getAuthenticatedUser())},async submitEnrollmentWithTotp(e){let t=await Z_();
2if(!t||!J)throw Error("Must have valid access token to enroll in MFA");await J.submitEnrollMfa({method:"totp",accessToken:t,code:e.mfaCode}),E(await c.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey(e){let{credentialIds:t}=e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=await Z_();if(!r||!J)throw Error("Must have valid access token to enroll in MFA");await J.submitEnrollMfa({method:"passkey",accessToken:r,credentialIds:t,removeForLogin:n.removeForLogin}),E(await c.getAuthenticatedUser())},async unenroll(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=await Z_();if(!n||!J)throw Error("Must have valid access token to remove MFA");"passkey"===e?await J.submitEnrollMfa({method:"passkey",accessToken:n,credentialIds:[],removeForLogin:t.removeForLogin}):await J.unenrollMfa({method:e,accessToken:n}),E(await c.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{var e;let t=await Z_(),n=null===x||void 0===x?void 0:x.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType);if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!J||!n)throw Error("Must have an embedded wallet to use Farcaster signers");if((0,g.d)(n))throw new w.a("Farcaster signers are only supported for on-device execution and this app uses TEE execution. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");if(null===x||void 0===x||null===(e=x.farcaster)||void 0===e||!e.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await Be.recoverEmbeddedWallet({address:n.address}))throw Error("Unable to connect to wallet");let r=await J.initFarcasterSigner({address:n.address,hdWalletIndex:null,accessToken:t,mfaCode:null,mfaMethod:null,relyingParty:window.origin});"approved"===r.status&&E(await c.getAuthenticatedUser()||x||null),X({farcasterSigner:r}),ve("FarcasterSignerStatusScreen")},getFarcasterSignerPublicKey:async()=>{var e,t;let n,r=await Z_(),i=null===x||void 0===x?void 0:x.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType);if(!r)throw Error("Must have valid access token to connect with Farcaster");if(!J||!i)throw Error("Must have an embedded wallet to use Farcaster signers");if((0,g.d)(i))throw new w.a("Farcaster signers are only supported for on-device execution and this app uses TEE execution. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");if(null===x||void 0===x||null===(e=x.farcaster)||void 0===e||!e.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await Be.recoverEmbeddedWallet({address:i.address}))throw Error("Unable to connect to wallet");if(null===(t=x.farcaster)||void 0===t||!t.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");return n=x.farcaster.signerPublicKey.slice(2),Uint8Array.from(n.match(/.{1,2}/g).map(e=>parseInt(e,16)))},signFarcasterMessage:async e=>{var t,r;let i=await Z_(),s=null===x||void 0===x?void 0:x.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType);if(!i)throw Error("Must have valid access token to connect with Farcaster");if(!J||!s)throw Error("Must have an embedded wallet to use Farcaster signers");if((0,g.d)(s))throw new w.a("Farcaster signers are only supported for on-device execution and this app uses TEE execution. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");if(null===x||void 0===x||null===(t=x.farcaster)||void 0===t||!t.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await Be.recoverEmbeddedWallet({address:s.address}))throw Error("Unable to connect to wallet");if(null===(r=x.farcaster)||void 0===r||!r.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");let o=await n.e(4949).then(n.bind(n,84949)),a=await J.signFarcasterMessage({address:s.address,hdWalletIndex:null,accessToken:i,mfaCode:null,mfaMethod:null,payload:{hash:o.bufferToBase64URLString(e)},fid:BigInt(x.farcaster.fid),relyingParty:window.origin});return new Uint8Array(o.base64URLStringToBuffer(a.signature))},signMessageWithCrossAppWallet(e,t){let{address:n,chainId:r}=t,i=null===x||void 0===x?void 0:x.linkedAccounts.some(e=>
2"cross_app"===e.type&&e.smartWallets.some(e=>e.address===n));return OE({user:x,client:c,address:n,requesterAppId:h.id,request:{method:i?"privy_signSmartWalletMessage":"personal_sign",params:[e,n],chainId:r},reconnect:Ue})},signTypedDataWithCrossAppWallet(e,t){let{address:n,chainId:r}=t,i=null===x||void 0===x?void 0:x.linkedAccounts.some(e=>"cross_app"===e.type&&e.smartWallets.some(e=>e.address===n)),s=(0,y.m)(e);return OE({user:x,client:c,address:n,requesterAppId:h.id,request:{method:i?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[n,s],chainId:r},reconnect:Ue})},sendTransactionWithCrossAppWallet(e,t){let{address:n}=t,r=null===x||void 0===x?void 0:x.linkedAccounts.some(e=>"cross_app"===e.type&&e.smartWallets.some(e=>e.address===n));return OE({user:x,client:c,address:n,requesterAppId:h.id,request:{method:r?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[e],chainId:e.chainId},reconnect:Ue})},signTransactionWithCrossAppWallet(e,t){let{address:n}=t,r=null===x||void 0===x?void 0:x.linkedAccounts.some(e=>"cross_app"===e.type&&e.smartWallets.some(e=>e.address===n));return OE({user:x,client:c,address:n,requesterAppId:h.id,request:{method:r?"privy_signSmartWalletTx":"eth_signTransaction",params:[e],chainId:e.chainId},reconnect:Ue})},isModalOpen:p||!!m,mfaMethods:h.mfa.methods};rk=Le.signMessage,ik=Le.signTypedData,ok=async(e,t)=>await Pe((0,i.A)((0,i.A)({transaction:e},t),{},{signOnly:!1})),sk=async(e,t)=>({signature:(await Pe((0,i.A)((0,i.A)({transaction:e},t),{},{signOnly:!0}))).hash});let Be={privy:l,setAuthenticated:pe,setUser:E,setIsNewUser:C,isNewUserThisSession:T,pendingTransaction:null,walletConnectionStatus:M,setWalletConnectionStatus:U,connectors:null!==(r=null===(s=c.connectors)||void 0===s?void 0:s.walletConnectors)&&void 0!==r?r:[],rpcConfig:h.rpcConfig,chains:h.chains,appId:e.appId,showFiatPrices:"native-token"!==h.embeddedWallets.priceDisplay.primary,clientAnalyticsId:c.clientAnalyticsId,onCustomAuthAuthenticated:we,hideWalletUIs:me,isHeadlessSigning:(0,a.useCallback)(ye,[h.embeddedWallets.showWalletUIs]),emailOtpState:D,setEmailOtpState:j,smsOtpState:F,setSmsOtpState:z,oAuthState:H,setOAuthState:V,telegramAuthState:G,setTelegramAuthState:K,siweState:W,setSiweState:q,isHeadlessOAuthLoading:N,baseAccountSdk:S,setBaseAccountSdk:I,nativeTokenSymbolForChainId:e=>{var t;return null===(t=h.chains.find(t=>t.id===Number(e)))||void 0===t?void 0:t.nativeCurrency.symbol},initializeWalletProxy:async e=>{if(J)return J;let t=new Promise(e=>{te.current=e}),n=new Promise(t=>setTimeout(()=>t(null),e)),r=await Promise.race([t,n]);return te.current=null,r},getAuthFlow:()=>c.authFlow,getAuthMeta:()=>{var e;return null===(e=c.authFlow)||void 0===e?void 0:e.meta},client:c,closePrivyModal:async function(){let t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldCallAuthOnSuccess:!0,isSuccess:!1},r=A&&de&&x;if(r&&fe.current&&(t=Ne(x)),"login"===ge.current)n.shouldCallAuthOnSuccess&&r&&fe.current?(0,qn.e)(ce,"login","onComplete",{user:x,isNewUser:T,wasAlreadyAuthenticated:!1,loginMethod:fe.current,loginAccount:null!==t&&void 0!==t?t:null}):(0,qn.e)(ce,"login","onError",w.b.USER_EXITED_AUTH_FLOW);else if("link"===ge.current&&t)n.isSuccess&&r&&fe.current?(0,qn.e)(ce,"linkAccount","onSuccess",{user:x,linkMethod:fe.current,linkedAccount:t}):fe.current&&(0,qn.e)(ce,"linkAccount","onError",w.b.USER_EXITED_LINK_FLOW,{linkMethod:fe.current});else if("update"===ge.current&&t)n.isSuccess&&r&&fe.current?(0,qn.e)(ce,"update","onSuccess",{user:x,updateMethod:fe.current,updatedAccount:t}):fe.current&&(0,qn.e)(ce,"update","onError",w.b.USER_EXITED_UPDATE_FLOW,{linkMethod:fe.current});else if("connect-or-create"===ge.current){let e=YE();e[0]?(0,qn.e)(ce,"connectOrCreateWallet","onSuccess",{wallet:e[0]}):(0,qn.e)(ce,"connectOrCreateWallet","onError",w.b.USER_EXITED_AUTH_FLOW)}let s=P&&DE.has(P),o="ErrorScreen"===P&&Y.errorModalData&&DE.has(Y.errorModalData.previousScreen);if((s||o)&&Y.funding){var a,l;let t,n=null!==(a=DE.get(P))&&void 0!==a?a:null;if(o&&null!==(l=Y.funding)&&void 0!==l&&l.onError){var u,p,g;
2let e=null===(u=Y.errorModalData)||void 0===u?void 0:u.error,t=(null===e||void 0===e?void 0:e.privyErrorCode)||w.b.UNKNOWN_FUNDING_ERROR,n=new w.a((null===e||void 0===e?void 0:e.message)||"Funding failed",e,t);null===(p=Y.funding)||void 0===p||null===(g=p.onError)||void 0===g||g.call(p,n)}if("solana"===Y.funding.chainType){let e=h.solanaRpcs[Y.funding.chain];if(!e)return void console.warn("Unable to load solana rpc, skipping balance");if(d(zn.S))try{t=await FE({rpc:e.rpc,address:Y.funding.address})}catch(m){console.error("Unable to pull wallet balance")}else console.warn("Unable to load solana plugin, skipping balance");(0,qn.e)(ce,"fundSolanaWallet","onUserExited",{address:Y.funding.address,fundingMethod:n,chain:Y.funding.chain,balance:t})}else{let r=(0,C_.g)(Y.funding.chain.id,h.chains,h.rpcConfig,{appId:e.appId});try{t=await r.getBalance({address:Y.funding.address})}catch(y){console.error("Unable to pull wallet balance")}(0,qn.e)(ce,"fundWallet","onUserExited",{address:Y.funding.address,chain:Y.funding.chain,fundingMethod:n,balance:t}),function(e,t){if(e.onComplete)switch(t){case"external":e.fundingResult?e.onComplete((0,i.A)((0,i.A)({},e.fundingResult),{},{fundingMethod:t})):e.onComplete({status:"cancelled",address:e.address,fundingMethod:t,amount:e.amount});break;case null:e.onComplete({status:"cancelled",address:e.address,fundingMethod:void 0,amount:e.amount});break;default:e.onComplete({status:"completed",address:e.address,fundingMethod:t,amount:e.amount})}}(Y.funding,n)}}X(e=>(0,i.A)((0,i.A)({},e),{},{externalConnectWallet:{}})),ge.current=null,fe.current=null,C(!1),f(!1),U({status:"disconnected",connectedWallet:null,connector:null,connectError:null,connectRetry:()=>{}}),setTimeout(()=>{c.authFlow=void 0},200)},openPrivyModal:ve,connectWallet:xe,initLoginWithWallet:async(e,t,n,r)=>{(0,y.f)(e)?(fe.current="siwe",Ee(e,t,n)):(fe.current="siws",ke(e,t,n,r))},loginWithWallet:async()=>{let e,t,n;if(!A)throw new w.g;if(c.authFlow instanceof _x?e="siwe":c.authFlow instanceof xx&&(e="siws"),!e)throw new w.a("Must initialize SIWE/SIWS flow first.");if(null!==await c.getAccessToken())try{({user:t}=await c.link()),fe.current=e}catch(t){throw(0,qn.e)(ce,"linkAccount","onError",t.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{({user:t,isNewUser:n}=await c.authenticate()),fe.current=e}catch(e){throw(0,qn.e)(ce,"login","onError",e.privyErrorCode||w.b.GENERIC_CONNECT_WALLET_ERROR),e}E(t||x||null),C(n||!1),pe(!0)},delegateWallet:async e=>{let{address:t,chainType:n,showDelegationUIs:r}=e;return new Promise(async(e,i)=>{var s;let o=await Z_();if(!de||!x||!o)throw new w.a("User must be authenticated and have an embedded wallet to delegate actions.");if("solana"!==n&&"ethereum"!==n)throw new w.a("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let a=null!==(s=Be.walletProxy)&&void 0!==s?s:await Be.initializeWalletProxy(15e3);if(!a)throw new w.a("Wallet proxy not initialized.");if((e=>{let{address:t,user:n}=e;return!!SE(n).find(e=>e.address===t)})({address:t,user:x}))return e();let c=(0,g.h)(x,t);if(!c)throw new w.a("Address to delegate is not associated with current user.");if((0,g.d)(c))throw new w.a("useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");let l=EE({address:t,user:x}),u=kE({address:t,user:x}),d=async()=>{await a.createDelegatedAction({accessToken:o,rootWallet:u,delegatedWallets:[l]}),await Be.refreshSessionAndUser()};if(await Be.recoverEmbeddedWallet({address:t}),r)X({delegatedActions:{consent:{address:t,onDelegate:d,onSuccess:async()=>{e()},onError:async e=>{i(e)}}}}),ve("DelegatedActionsConsentScreen");else try{await d(),e()}catch(t){i(t)}})},revokeDelegatedWallets:async e=>{let{showDelegationUIs:t}=e;return new Promise(async(e,n)=>{if(!de||!x)throw new w.a("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");let r=SE(x);
2if(0===r.length)throw new w.a("User has no delegated wallets to revoke.");if(r.some(g.d))throw new w.a("useDelegatedActions is only supported for on-device execution and this app uses TEE execution. Use the useSessionSigners hook to provision server side access on behalf of your users. Learn more at https://docs.privy.io/recipes/tee-wallet-migration-guide");let i=async()=>{await c.revokeDelegatedWallet(),await Be.refreshSessionAndUser()};if(t)X({delegatedActions:{revoke:{onRevoke:i,onSuccess:async()=>{e()},onError:async e=>{n(e)}}}}),ve("DelegatedActionsRevokeScreen");else try{await i(),e()}catch(t){n(t)}})},initLoginWithFarcaster:async(e,t)=>{let n=new cx(e,t);c.startAuthFlow(n);try{fe.current="farcaster",await n.initializeFarcasterConnect()}catch(e){throw"login"===ge.current?(0,qn.e)(ce,"login","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR):"link"===ge.current&&(0,qn.e)(ce,"linkAccount","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),e}},loginWithFarcaster:async()=>{let e,t;if(!A)throw new w.g;if(!(c.authFlow instanceof cx))throw new w.a("Must initialize Farcaster flow first.");if(null!==await c.getAccessToken())try{({user:e}=await c.link()),fe.current="farcaster"}catch(e){throw(0,qn.e)(ce,"linkAccount","onError",e.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),e}else try{({user:e,isNewUser:t}=await c.authenticate()),fe.current="farcaster"}catch(e){throw(0,qn.e)(ce,"login","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),e}E(e||null),C(t||!1),pe(!0)},async crossAppAuthFlow(e){let{appId:t,popup:n,action:r}=e,i="privy:".concat(t);fe.current=i;let{url:s,stateCode:o,codeVerifier:a}=await async function(e){let{api:t,appId:n}=e,r=fx(),i=gx(),s=await mx(r);try{let{url:e}=await t.post(jn.h,{provider:"privy:".concat(n),redirect_to:window.location.href,code_challenge:s,state_code:i});return{url:e,stateCode:i,codeVerifier:r}}catch(t){throw(0,w.f)(t)}}({api:c.api,appId:t});if(!s)throw c.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:t}}),new w.a("No authorization URL returned for cross-app auth.");try{let e=await async function(e){let{url:t,popup:n}=e;return n.location=t,new Promise((e,t)=>{let r,i=setTimeout(()=>{t(new w.a("Authorization request timed out after 2 minutes.")),s()},12e4);function s(){null!==n&&void 0!==n&&n.close(),window.removeEventListener("message",a)}let o=setInterval(()=>{(null===n||void 0===n?void 0:n.closed)&&!r&&(s(),clearInterval(o),clearTimeout(i),t(new w.a("User rejected request")))},300);function a(n){n.data&&("PRIVY_OAUTH_RESPONSE"===n.data.type&&n.data.stateCode&&n.data.authorizationCode&&(clearTimeout(i),e(n.data),s()),"PRIVY_OAUTH_ERROR"===n.data.type&&(clearTimeout(i),t(new w.a(n.data.error)),s()),n.data.type===TE&&((r=new BroadcastChannel(IE)).onmessage=a))}window.addEventListener("message",a)})}({url:s,popup:n,provider:i}),l=e.stateCode,u=e.authorizationCode;if(l!==o)throw c.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:i,storedStateCode:null!==o&&void 0!==o?o:"",returnedStateCode:null!==l&&void 0!==l?l:""}}),new w.a("Unexpected auth flow. This may be a phishing attempt.",void 0,w.b.OAUTH_UNEXPECTED);let d=await async function(e){let{appId:t,stateCode:n,codeVerifier:r,authorizationCode:i,action:s,client:o}=e;if(!i||!n)throw new w.a("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===i)throw new w.a("User denied confirmation during cross-app auth flow");try{var a;let e=new CE({authorizationCode:i,stateCode:n,codeVerifier:r,provider:"privy:".concat(t)});o.startAuthFlow(e);let c=null===(a=("link"===s?await o.link():await o.authenticate()).oAuthTokens)||void 0===a?void 0:a.accessToken;return console.debug(),c}catch(t){let e=(0,w.f)(t);if(e.privyErrorCode===w.b.ACCOUNT_TRANSFER_REQUIRED)throw e;if(e.privyErrorCode)throw new w.a(e.message||"Invalid code during cross-app auth flow.",void 0,e.privyErrorCode);if("User denied confirmation during cross-app auth flow"===e.message)throw new w.a("Invalid code during cross-app auth flow.",void 0,w.b.OAUTH_USER_DENIED);throw new w.a("Invalid code during cross-app auth flow.",void 0,w.b.UNKNOWN_AUTH_ERROR)}}({appId:t,codeVerifier:a,stateCode:l,authorizationCode:u,action:r,client:c});d&&c.storeProviderAccessToken(t,d);let h=await Be.refreshSessionAndUser();if(!h)throw new w.a("Unable to update user");return c.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:t}}),h}catch(t){throw c.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:t.toString(),provider:i}}),t}},async initLoginWithOAuth(e,t,n){if(fe.current=e,!(0,b.e)())return void ve("InAppBrowserLoginNotPossible");if("google"===e&&!h.allowOAuthInEmbeddedBrowsers&&jE(window.navigator.userAgent))return void ve("InAppBrowserLoginNotPossible");"twitter"===e&&window.opener&&window.opener.postMessage({type:TE},"*"),b.u.del(On.H),b.u.del(On.O);let r=new yx({provider:e,disableSignup:!!n,withPrivyUi:!0,customOAuthRedirectUrl:h.customOAuthRedirectUrl});t&&r.addCaptchaToken(t),c.startAuthFlow(r);let i=await c.authFlow.getAuthorizationUrl();if(i&&i.url)if("twitter"===e&&Rn.m0&&(i.url=i.url.replace("x.com","twitter.com")),"chrome-extension:"===window.location.protocol&&dx())try{let{privyOAuthCode:e,privyOAuthState:t}=await hx(i.url);ve("OAuthStatusScreen"),r.meta.stateCode=t,r.meta.authorizationCode=e}catch(e){throw console.error("OAuth in chrome extension flow failed:",e),e}else window.location.assign(i.url)},async initLoginWithTelegram(e,t){if(!A)throw new w.g;fe.current="telegram";let n=new Px(e,t);c.startAuthFlow(n),K({status:"loading"}),n.meta.telegramWebAppData=void 0,n.meta.telegramAuthResult=await new Promise((e,t)=>
2h.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:h.loginConfig.telegramAuthConfiguration.botId,request_access:!0},n=>n?e(n):("link"===ge.current?(0,qn.e)(ce,"linkAccount","onError",w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}):"login"===ge.current?(0,qn.e)(ce,"login","onError",w.b.INVALID_CREDENTIALS):"update"===ge.current&&(0,qn.e)(ce,"login","onError",w.b.FAILED_TO_UPDATE_ACCOUNT),t(new w.a("Telegram auth failed or was canceled by the client")))):t(new w.a("Telegram was not initialized")):t(new w.a("Telegram Auth configuration is not loaded")))},async loginWithTelegram(e){var t,n;let r,i;if(!(c.authFlow instanceof Px))throw new w.a("Must initialize Telegram flow before calling loginWithTelegram");(t=c.authFlow.meta).captchaToken||(t.captchaToken=null===e||void 0===e?void 0:e.captchaToken);let s=await Z_(),o=(null===e||void 0===e?void 0:e.intent)||ge.current;if("login"===o)try{let e=await c.authenticate();r=e.user,i=e.isNewUser,fe.current="telegram"}catch(e){throw(0,qn.e)(ce,"login","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),e}else{if("link"!==o)throw new w.a("Unknown auth intent");try{r=(await c.link()).user,fe.current="telegram"}catch(e){throw(0,qn.e)(ce,"linkAccount","onError",e.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),e}}E(r),C(i||!1),pe(!0),K({status:"done"});let a=(null===(n=r)||void 0===n?void 0:n.linkedAccounts.find(e=>{let{type:t}=e;return"telegram"===t}))||null;return{user:r,isNewUser:i||!1,wasAlreadyAuthenticated:!!s,loginAccount:a}},async loginWithOAuth(e){let t,n,r;if(!(c.authFlow instanceof yx))throw new w.a("Must initialize OAuth flow before calling loginWithOAuth");let i=b.u.get(On.S),s=c.authFlow.meta.stateCode;if(i!==s)throw c.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:null!==i&&void 0!==i?i:"",returnedStateCode:null!==s&&void 0!==s?s:""}}),new w.a("Unexpected auth flow. This may be a phishing attempt.",void 0,w.b.OAUTH_UNEXPECTED);if(null!==await c.getAccessToken())try{let n=await c.link();t=n.user,r=n.oAuthTokens,fe.current=e}catch(t){throw(0,qn.e)(ce,"linkAccount","onError",t.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{let i=await c.authenticate();t=i.user,n=i.isNewUser,r=i.oAuthTokens,fe.current=e}catch(t){throw"login"===ge.current?(0,qn.e)(ce,"login","onError",t.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR):"link"===ge.current&&(0,qn.e)(ce,"linkAccount","onError",t.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}return E(t),C(n||!1),pe(!0),r&&t&&(0,qn.e)(ce,"oAuthAuthorization","onOAuthTokenGrant",{oAuthTokens:r,user:t}),r},passkeyAuthState:L,setPasskeyAuthState:B,async initSignupWithPasskey(e){var t;let{captchaToken:n,withPrivyUi:r}=e,i=new bx({captchaToken:n,setPasskeyAuthState:B,hints:null===(t=h.passkeys.registration)||void 0===t?void 0:t.hints});c.startAuthFlow(i),ge.current="login";try{fe.current="passkey",B({status:"generating-challenge"}),await i.initRegisterFlow(r),B({status:"awaiting-passkey"})}catch(n){throw B({status:"error",error:n}),(0,qn.e)(ce,"login","onError",n.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),n}},async signupWithPasskey(){var e;let t,n;if(!A)throw new w.g;if(!(c.authFlow instanceof bx))throw new w.a("Must initialize Passkey flow first.");if("passkey"!==fe.current){let e=new w.a("Must init login with Passkey flow first.");throw B({status:"error",error:e}),e}let r=await Z_();try{fe.current="passkey",B({status:"awaiting-passkey"}),({user:t,isNewUser:n}=await c.authenticate())}catch(t){throw B({status:"error",error:t}),(0,qn.e)(ce,"login","onError",t.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),t}E(t),C(n||!1),pe(!0),B({status:"done"});let i=(null===(e=t)||void 0===e?void 0:e.linkedAccounts.find(e=>{let{type:t}=e;return"passkey"===t}))||null;return{user:t,isNewUser:n||!1,wasAlreadyAuthenticated:!!r,loginAccount:i}},async initLoginWithPasskey(e){let{captchaToken:t,withPrivyUi:n}=e,r=new bx({captchaToken:t,setPasskeyAuthState:B,hints:void 0});c.startAuthFlow(r),ge.current="login";try{fe.current="passkey",B({status:"generating-challenge"}),await r.initAuthenticationFlow(n),B({status:"awaiting-passkey"})}catch(t){throw B({status:"error",error:t}),(0,qn.e)(ce,"login","onError",t.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),t}},async loginWithPasskey(e){var t;let n,r;if(!A)throw new w.g;if(!(c.authFlow instanceof bx))throw new w.a("Must initialize Passkey flow first.");if(null!==e&&void 0!==e&&e.credentialIds&&(c.authFlow.meta.allowedCredentialsIds=e.credentialIds),"passkey"!==fe.current){let e=new w.a("Must init login
2with Passkey flow first.");throw B({status:"error",error:e}),e}let i=await Z_();try{fe.current="passkey",B({status:"awaiting-passkey"}),({user:n,isNewUser:r}=await c.authenticate())}catch(e){throw B({status:"error",error:e}),(0,qn.e)(ce,"login","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),e}E(n),C(r||!1),pe(!0),B({status:"done"});let s=(null===(t=n)||void 0===t?void 0:t.linkedAccounts.find(e=>{let{type:t}=e;return"passkey"===t}))||null;return{user:n,isNewUser:r||!1,wasAlreadyAuthenticated:!!i,loginAccount:s}},async initLinkWithPasskey(e){var t;let n=new bx({captchaToken:e,hints:null===(t=h.passkeys.registration)||void 0===t?void 0:t.hints});c.startAuthFlow(n),ge.current="link",fe.current="passkey",B({status:"generating-challenge"});try{await n.initLinkFlow(),B({status:"awaiting-passkey"})}catch(e){throw(0,qn.e)(ce,"linkAccount","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),B({status:"error",error:e}),e}},async linkWithPasskey(){let e;if(!A)throw new w.g;if(!(c.authFlow instanceof bx))throw new w.a("Must initialize Passkey flow first.");if("passkey"!==fe.current)throw new w.a("Must init login with Passkey flow first.");try{fe.current="passkey",({user:e}=await c.link())}catch(e){throw(0,qn.e)(ce,"linkAccount","onError",e.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),e}return E(e||x||null),B({status:"done"}),e},async initLoginWithHeadlessOAuth(e,t,n){if(!(0,b.e)())throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");if("google"===e&&!h.allowOAuthInEmbeddedBrowsers&&jE(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let r=new yx({provider:e,withPrivyUi:!1,disableSignup:null!==n&&void 0!==n&&n,customOAuthRedirectUrl:h.customOAuthRedirectUrl});t&&r.addCaptchaToken(t),V({status:"loading"});let i=await c.startAuthFlow(r).getAuthorizationUrl();if(null!==i&&void 0!==i&&i.url)if("chrome-extension:"===window.location.protocol&&dx())try{let{privyOAuthCode:e,privyOAuthState:t}=await hx(i.url);r.meta.stateCode=t,r.meta.authorizationCode=e,await this.loginWithHeadlessOAuth(r.meta)}catch(e){throw V({status:"error",error:e}),e}else window.location.assign(i.url)},async loginWithHeadlessOAuth(e){let t,n,r;R(!0),V({status:"loading"}),c.startAuthFlow(new yx((0,i.A)((0,i.A)({},e),{},{customOAuthRedirectUrl:h.customOAuthRedirectUrl})));let s=b.u.get(On.S),o=e.stateCode;if(s!==o)throw c.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e.provider,storedStateCode:null!==s&&void 0!==s?s:"",returnedStateCode:null!==o&&void 0!==o?o:""}}),R(!1),new w.a("Unexpected auth flow. This may be a phishing attempt.",void 0,w.b.OAUTH_UNEXPECTED);if(null!==await c.getAccessToken())try{({user:t,oAuthTokens:r}=await c.link()),fe.current=e.provider;let n=Ne(t);t&&n&&(0,qn.e)(ce,"linkAccount","onSuccess",{user:t,linkMethod:fe.current,linkedAccount:n})}catch(t){throw R(!1),(0,qn.e)(ce,"linkAccount","onError",t.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:e.provider}),t}else try{({user:t,isNewUser:n,oAuthTokens:r}=await c.authenticate()),fe.current=e.provider;let i=Ne(t);t&&i&&void 0!==n&&(0,qn.e)(ce,"login","onComplete",{user:t,isNewUser:n,wasAlreadyAuthenticated:!1,loginMethod:fe.current,loginAccount:i})}catch(e){throw R(!1),V({status:"error",error:e}),(0,qn.e)(ce,"login","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),e}return E(t),C(n||!1),pe(!0),R(!1),V({status:"done"}),r&&t&&(0,qn.e)(ce,"oAuthAuthorization","onOAuthTokenGrant",{oAuthTokens:r,user:t}),null!==t&&void 0!==t?t:void 0},initLoginWithEmail:async e=>{let{email:t,captchaToken:n,disableSignup:r,withPrivyUi:i}=e,s=new X_({email:t,captchaToken:n,disableSignup:r});c.startAuthFlow(s);try{fe.current="email",j({status:"sending-code"});let e=await s.sendCodeEmail({withPrivyUi:i});if(null!==e&&void 0!==e&&e.ssoRedirectUrl)return window.location.href=e.ssoRedirectUrl,void await(0,y.k)(1e4);j({status:"awaiting-code-input"})}catch(t){throw j({status:"error",error:t}),"login"===ge.current?(0,qn.e)(ce,"login","onError",t.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR):"link"===ge.current&&(0,qn.e)(ce,"linkAccount","onError",t.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),t}},initUpdateEmail:async e=>{let{oldAddress:t,newAddress:n,captchaToken:r}=e,i=new $_(t,n,r);c.startAuthFlow(i);try{await i.sendCodeEmail({withPrivyUi:!0})}catch(t){throw(0,qn.e)(ce,"update","onError",t.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR,{linkMethod:fe.current}),t}},initUpdatePhone:async(e,t,n)=>{let r=new kx(e,t,n);c.startAuthFlow(r);try{await r.sendSmsCode({withPrivyUi:!0})}catch(e){(0,qn.e)(ce,"update","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR,{linkMethod:fe.current})}},initLoginWithSms:async e=>{let{phoneNumber:t,captchaToken:n,disableSignup:r,withPrivyUi:i}=e;z({status:"sending-code"});let s=new Ex({phoneNumber:t,captchaToken:n,disableSignup:r});c.startAuthFlow(s);try{fe.current="sms",await s.sendSmsCode({withPrivyUi:i}),z({status:"awaiting-code-input"})}catch(t){throw z({status:"error",error:t}),"login"===ge.current?(0,qn.e)(ce,"login","onError",t.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR):"link"===ge.current&&(0,qn.e)(ce,"linkAccount","onError",t.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),t}},resendEmailCode:async()=>{var e;await(null===(e=c.authFlow)||void 0===e?void 0:e.sendCodeEmail({withPrivyUi:!0}))},resendSmsCode:async()=>{var e;await(null===(e=c.authFlow)||void 0===e?void 0:e.sendSmsCode({withPrivyUi:!0}))},loginWithCode:async e=>{let t,n;function r(e){c.authFlow instanceof X_?j(e):c.authFlow instanceof Ex&&z(e)}if(r({status:"submitting-code"}),!A){let e=new w.g;throw r({status:"error",error:e}),e}if(c.authFlow instanceof X_)c.authFlow.meta.emailCode=e.trim();else{if(!(c.authFlow instanceof Ex)){let e=new w.a("Must initialize a passwordless code flow first");throw r({status:"error",error:e}),e}c.authFlow.meta.smsCode=e.trim()}let i=await Z_();if("link"===ge.current)try{({user:t}=await c.link())}catch(e){throw r({status:"error",error:e}),(0,qn.e)(ce,"linkAccount","onError",e.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:fe.current}),e}else if("update"===ge.current)try{({user:t}=await c.link())}catch(e){throw r({status:"error",error:e}),(0,qn.e)(ce,"update","onError",e.privyErrorCode||w.b.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:fe.current}),e}else try{({user:t,isNewUser:n}=await c.authenticate())}catch(e){throw r({status:"error",error:e}),(0,qn.e)(ce,"login","onError",e.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),e}let s=t||x;E(s||null),C(n||!1),pe(!0),r({status:"done"});let o=null;return c.authFlow instanceof X_?o=(null===s||void 0===s?void 0:s.linkedAccounts.find(e=>{let{type:t}=e;return"email"===t}))||null:c.authFlow instanceof Ex&&(o=(null===s||void 0===s?void 0:s.linkedAccounts.find(e=>{let{type:t}=e;return"phone"===t}))||null),{user:s,isNewUser:n||!1,wasAlreadyAuthenticated:!!i,linkedAccount:o}},generateSiweMessage:async e=>{let{address:t,chainId:n,captchaToken:r}=e;ge.current=de?"link":"login",fe.current="siwe",q({status:"generating-message"});let i=await c.generateSiweNonce({address:t,captchaToken:r});return q({status:"awaiting-signature"}),Ax({address:t,chainId:n.replace("eip155:",""),nonce:i})},generateSiweMessageForSmartWallet:async e=>{let{address:t,chainId:n}=e,r=await c.generateSiweNonce({address:t});return Ax({address:t,chainId:n.replace("eip155:",""),nonce:r})},linkSmartWallet:async e=>{var t;let n,{message:r,signature:i,smartWalletType:s,smartWalletVersion:o}=e;n=await c.linkSmartWallet({message:r,signature:i,smartWalletType:s,smartWalletVersion:o}),E((n=null!==(t=await Be.refreshSessionAndUser())&&void 0!==t?t:n)||x||null)},loginWithSiwe:async e=>{let t,{message:n,signature:r,captchaToken:i,disableSignup:s,walletClientType:o,connectorType:a}=e,l=null;try{if(x)throw Error("User already authenticated");let e=new _x(c,void 0,i,s,{message:n,signature:r,walletClientType:o,connectorType:a});c.startAuthFlow(e),fe.current="siwe",ge.current="login",q({status:"submitting-signature"});let u=await c.authenticate();if(({user:l,isNewUser:t}=u),!l)throw Error("Authentication failed - no user returned")}catch(n){throw(0,qn.e)(ce,"login","onError",n.privyErrorCode||w.b.UNKNOWN_AUTH_ERROR),q({status:"error",error:n}),n}return E(l),C(t||!1),pe(!0),q({status:"done"}),ge.current=null,fe.current=null,{user:l,isNewUser:t||!1}},linkWithSiwe:async e=>{let t,{message:n,signature:r,chainId:i,walletClientType:s,connectorType:o}=e;Ie("siwe");let a=null;try{var l;q({status:"submitting-signature"}),t=await c.linkWithSiwe({message:n,signature:r,chainId:i,walletClientType:s,connectorType:o}),t=null!==(l=await Be.refreshSessionAndUser())&&void 0!==l?l:t,q({status:"done"}),(a=Ne(t)||null)&&(0,qn.e)(ce,"linkAccount","onSuccess",{user:t,linkMethod:"siwe",linkedAccount:a})}catch(n){throw(0,qn.e)(ce,"linkAccount","onError",n.privyErrorCode||w.b.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),ge.current=null,fe.current=null,q({status:"error",error:n}),n}let u=t||x;return E(u||null),ge.current=null,fe.current=null,{user:u,linkedAccount:a}},refreshSessionAndUser:async()=>{let e=await c.getAuthenticatedUser();return pe(!!e),E(e),e},walletProxy:J,createAnalyticsEvent:e=>{let{eventName:t,payload:n,timestamp:r}=e;return c.createAnalyticsEvent({eventName:t,payload:n,timestamp:r})},acceptTerms:async()=>{let e=await c.acceptTerms();return E(e),e},getUsdTokenPrice:e=>c.getUsdTokenPrice(e),getUsdPriceForSol:()=>c.getUsdPriceForSol(),getSplTokenMetadata:e=>
2c.getSplTokenMetadata(e),recoverEmbeddedWallet:async e=>new Promise(async(t,n)=>{if(!x)return void t(!0);let r=null!==e&&void 0!==e&&e.address?(0,g.h)(x,e.address):(0,g.g)(x)||(0,g.f)(x).at(0)||(0,g.j)(x).at(0);if(!r||(0,g.d)(r))return void t(!0);let i=await Z_();if(!i||!J||!r)return void n(Error("Must have valid access token and Privy wallet to recover wallet"));let{entropyId:s,entropyIdVerifier:o}=(0,v.g)(x,r);try{await J.connect({accessToken:i,entropyId:s,entropyIdVerifier:o}),t(!0)}catch(e){if(cE(e)&&"privy"===r.recoveryMethod){let a;c.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:r.address}});try{a=await J.recover({entropyId:s,entropyIdVerifier:o,accessToken:i})}catch(e){return void n(e)}a.entropyId||n(Error("Unable to recover wallet")),c.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r.address}}),t(!0)}else cE(e)&&"privy"!==r.recoveryMethod&&"privy-v2"!==r.recoveryMethod?(X({recoverWallet:{entropyId:s,entropyIdVerifier:o,onFailure:n,onSuccess:()=>t(!0)},recoveryOAuthStatus:{provider:r.recoveryMethod,action:"recover",shouldCreateEth:!1,shouldCreateSol:!1}}),ve(LE(r.recoveryMethod))):n(e)}}),setReadyToTrue:e=>{_(!0),null===$||void 0===$||$(e)},updateWallets:()=>Ce(),fundWallet:async(e,t)=>{let n="FundingMethodSelectionScreen";return new Promise((r,s)=>{X({funding:(0,i.A)({},(0,b.p)({address:e,appConfig:h,fundWalletConfig:t,methodScreen:n,onComplete:r,onError:s}))}),ve(n)})},openModal:ve,requestFarcasterSignerStatus:async e=>{var t;let n=await Z_(),r=null===x||void 0===x?void 0:x.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType);if(!n)throw Error("Must have valid access token to connect with Farcaster");if(!J||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(null===x||void 0===x||null===(t=x.farcaster)||void 0===t||!t.fid)throw Error("Must have Farcaster account to use Farcaster signers");let i=await c.requestFarcasterSignerStatus(e);return"approved"===i.status&&E(await c.getAuthenticatedUser()||x||null),i},connectCoinbaseSmartWallet:async()=>{var e,t;h.externalWallets.coinbaseWallet.config.preference=(0,i.A)((0,i.A)({},h.externalWallets.coinbaseWallet.config.preference),{},{options:"smartWalletOnly"});let n=(null===(e=c.connectors)||void 0===e?void 0:e.findWalletConnector("coinbase_wallet","coinbase_smart_wallet"))||(null===(t=c.connectors)||void 0===t?void 0:t.findWalletConnector("coinbase_wallet","coinbase_wallet"));if(n)return n.updateConnectionPreference("smartWalletOnly"),xe(n);await _e("coinbase_wallet","coinbase_smart_wallet")},connectBaseAccount:async()=>{var e;let t=null===(e=c.connectors)||void 0===e?void 0:e.findWalletConnector("base_account","base_account");if(t)return xe(t);await _e("base_account","base_account")},initiateAccountTransfer:async e=>{let{nonce:t,account:n,accountType:r,externalWalletMetadata:i,telegramAuthResult:s,telegramWebAppData:o,farcasterEmbeddedAddress:a,oAuthUserInfo:l}=e,u=await c.sendAccountTransferRequest({nonce:t,account:n,accountType:r,externalWalletMetadata:i,telegramAuthResult:s,telegramWebAppData:o,farcasterEmbeddedAddress:a,oAuthUserInfo:l});return E(u),u},inProgressAuthFlowRef:ge,inProgressLoginOrLinkMethodRef:fe};ak=Be.recoverEmbeddedWallet,Be.recoverEmbeddedWallet;let De=(0,a.useMemo)(()=>({wallets:k,ready:ne&&le}),[k,ne,le]),je=c.authFlow instanceof Px,{enabled:Fe,siteKey:ze,provider:We}=h.captcha,qe=!h.headless&&Fe&&!de&&(A||je);return(0,o.jsx)(nk.Provider,{value:!0,children:(0,o.jsx)(g.P.Provider,{value:Le,children:(0,o.jsx)(qn.P.Provider,{value:ce,children:(0,o.jsx)(v.U.Provider,{value:De,children:(0,o.jsx)(Tx,{appId:h.id,captchaEnabled:Fe,captchaSiteKey:ze,captchaProvider:We,children:(0,o.jsxs)(w.I.Provider,{value:Be,children:[(0,o.jsx)(y.R,{children:(0,o.jsxs)(g.M,{data:Y,setModalData:X,setInitialScreen:O,initialScreen:P,authenticated:de,open:p,children:[e.children,(0,o.jsx)(tk,{customAuth:h.customAuth}),qe&&(0,o.jsx)(Lx,{delayedExecution:!1}),(0,o.jsx)(rE,{}),(0,o.jsx)(JE,{disabled:h.embeddedWallets.disableAutomaticMigration}),(0,o.jsx)(jx,{palette:h.appearance.palette||{}}),!h.render.standalone&&(0,o.jsx)(Xx,{open:p})]})}),(0,o.jsx)(xE,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:c.clientAnalyticsId,origin:c.apiUrl,mfaMethods:null===x||void 0===x?void 0:x.mfaMethods,mfaProm
2ise:oe,mfaSubmitPromise:ae,onLoad:Z,onLoadFailed:()=>null}),h.loginConfig.telegramAuthConfiguration&&(0,o.jsx)(y.H,{$if:!0,children:(0,o.jsx)(nE,{scriptHost:e.apiUrl||On.D,botUsername:h.loginConfig.telegramAuthConfiguration.botName})})]})})})})})})};class lk extends Error{constructor(e,t,n){super(e),this.code=t,this.data=n}}class uk extends m.A{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new lk("Invalid params for ".concat(e.method),4200);let t=e.params[0];if(!await Z_()||!this.address)throw new lk("Disconnected",4900);let{hash:n}=await((e,t)=>ok(e,t))(t,{address:this.address});return n}async handleSignTransaction(e){if(!e.params||!Array.isArray(e.params))throw new lk("Invalid params for ".concat(e.method),4200);let t=e.params[0];if(!await Z_()||!this.address)throw new lk("Disconnected",4900);let{signature:n}=await((e,t)=>sk(e,t))(t,{address:this.address});return n}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new lk("Invalid params for ".concat(e.method),4200);if("string"==typeof e.params[0])t=e.params[0];else{if(!("chainId"in e.params[0])||"string"!=typeof e.params[0].chainId)throw new lk("Invalid params for ".concat(e.method),4200);t=e.params[0].chainId}this.chainId=Number(t),this.publicClient=(0,C_.g)(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",t)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let t=e.params[0],n=e.params[1],{signature:r}=await((e,t)=>rk(e,t))({message:t},{address:n});return r}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let t=e.params[0],n="string"==typeof e.params[1]?JSON.parse(e.params[1]):e.params[1],{signature:r}=await((e,t)=>ik(e,t))((0,y.m)(n),{address:t});return r}async handleEstimateGas(e){var t;if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let n=(0,i.A)((0,i.A)({},e.params[0]),{},{chainId:(0,y.t)(this.chainId)});return await this.publicClient.estimateGas((0,i.A)({account:null!==(t=n.from)&&void 0!==t?t:this.address},(0,Pn._)(n)))}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return(0,y.t)(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"eth_signTransaction":return this.handleSignTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!(e=>Q_.includes(e))(e.method))return this.publicClient.request({method:e.method,params:e.params});{let t=await Z_();if(await(e=>ak(e))({address:this.address}),!t||!this.address)throw new lk("Disconnected",4900);try{let n={method:e.method,params:e.params},r=this.walletAccount;return r&&(0,g.d)(r)?this.handleWalletApiRequest(n,r,t):(await this.walletProxy.rpc({accessToken:t,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:n})).response.data}catch(e){throw console.error(e),new lk("Disconnected",4900)}}}async handleWalletApiRequest(e,t,n){let r=this.privyClient;if(!r)throw new lk("Disconnected",4900);if("secp256k1_sign"===e.method){let i=await(0,u._)(r,async e=>{let{message:t}=e;return this.walletProxy.signWithUserSigner({accessToken:n,message:t})},{chain_type:"ethereum",method:"secp256k1_sign",wallet_id:t.id,params:{hash:e.params[0]}});if("secp256k1_sign"!==i.method)throw new lk("Invalid params for ".concat(e.method),4200);return i.data.signature}throw new lk("Method not supported: ".concat(e.method),4200)}constructor(e){let{walletProxy:t,address:n,entropyId:r,entropyIdVerifier:i,rpcConfig:s,chains:o,appId:a,chainId:c=1,walletIndex:l,privyClient:u,walletAccount:d}=e;super(),this.walletProxy=t,this.address=n,this.entropyId=r,this.entropyIdVerifier=i,this.chainId=c,this.rpcConfig=s,this.chains=o,this.publicClient=(0,C_.g)(c,this.chains,s,{appId:a}),this.rpcTimeoutDuration=(0,y.c)(s,"privy"),this.appId=a,this.walletIndex=l,this.privyClient=u,this.walletAccount=d}}const dk=e=>{let{style:t}=e,n=(0,s.A)(e,M_);return(0,o.jsx)("svg",(0,i.A)((0,i.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:(0,i.A)({},t)},n),{},{children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}))},hk=e=>{let{style:t}=e,n=(0,s.A)(e,U_);return(0,o.jsxs)("svg",(0,i.A)((0,i.A)({xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:(0,i.A)({height:"28px",width:"28px"},t)},n),{},{children:[(0,o.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]}))};function pk(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var fk=0;class gk extends y.E{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit
2("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn("Programmatic disconnect with ".concat(this.providerDetail.info.name," is not yet supported."))}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new w.P("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(Qe){throw(0,b.f)(Qe)}}constructor(e,t,n,r,i){super(i||"unknown",e,t,n),this.connectorType="injected",this.proxyProvider=new y.P(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=r;let s=r.provider;this.proxyProvider.setWalletProvider(s)}}var mk="__private_"+fk+++"__walletBranding";class yk extends y.E{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){var e;return null!==(e=pk(this,mk)[mk])&&void 0!==e?e:{name:"Browser Extension",icon:dk,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new w.P("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(Qe){throw(0,b.f)(Qe)}}constructor(e,t,n,r,i){super(null!==i&&void 0!==i?i:"unknown",e,t,n),Object.defineProperty(this,mk,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new y.P(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(r),"metamask"===i?pk(this,mk)[mk]={name:"MetaMask",icon:y.M,id:"io.metamask"}:"phantom"===i&&(pk(this,mk)[mk]={name:"Phantom",icon:hk,id:"phantom"})}}class vk extends gk{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Rn.Fr||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new w.P("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(Qe){throw(0,b.f)(Qe)}}}class wk extends m.A{get wallets(){let e=new Set;return this.walletConnectors.flatMap(e=>e.wallets).sort((e,t)=>e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0).filter(t=>{let n="".concat(t.address).concat(t.walletClientType).concat(t.connectorType).concat(t.meta.id);return!e.has(n)&&(e.add(n),!0)})}async initialize(e){var t,n,r;if(this.initialized&&!e||(e&&this.removeAllConnectors(),this.externalWalletConfig.disableAllExternalWallets))return;let i=(0,y.o)({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then(e=>{e.forEach(e=>{let{type:t,eip6963InjectedProvider:n,legacyInjectedProvider:r}=e;this.createEthereumWalletConnector({connectorType:"injected",walletClientType:t,providers:{eip6963InjectedProvider:n,legacyInjectedProvider:r}})})});for(let c of(this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector({connectorType:"coinbase_wallet",walletClientType:"coinbase_wallet"}),this.walletList.includes("base_account")&&this.createEthereumWalletConnector({connectorType:"base_account",walletClientType:"base_account"}),Object.values(y.q)))!c.isInstalled&&this.walletList.includes(c.client)&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&c.chainTypes.includes("ethereum")&&this.createEthereumWalletConnector({connectorType:"null",walletClientType:c.client,walletConfig:c}),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&c.chainTypes.includes("solana")&&this.addSolanaWalletConnector(new y.S({id:c.client,name:c.name})));this.externalWalletConfig.walletConnect.enabled&&(this.walletList.includes("wallet_connect_qr")||(0,y.e)(this.walletList))&&"solana-only"!==this.walletChainType&&this.createEthereumWalletConnector({connectorType:"wallet_connect_v2",walletClientType:"unknown"});let s=this.walletList.includes("wallet_connect_qr_solana"),o=(null===(t=this.externalWalletConfig.solana.connectors)||void 0===t?void 0:t.get())||[],a=async e=>{if(!s)return;let t=e.find(e=>{var t;return"walletconnect_solana"===(null===(t=e.walletBranding)||void 0===t?void 0:t.id)});t&&t.wallet&&await t.wallet.initialize({walletConnectCloudProjectId:this.walletConnectCloudProjectId,privyAppName:this.privyAppName})};a(o),o.filter(e=>{var t;return s||"walletconnect_solana"!==(null===(t=e.walletBranding)||void 0===t?void 0:t.id)}
2).forEach(this.addSolanaWalletConnector),null!==(n=this.externalWalletConfig.solana.connectors)&&void 0!==n&&null!==(r=n._setOnConnectorsUpdated)&&void 0!==r&&r.call(n,e=>{a(e),null===e||void 0===e||e.filter(e=>{var t;return s||"walletconnect_solana"!==(null===(t=e.walletBranding)||void 0===t?void 0:t.id)}).forEach(this.addSolanaWalletConnector)}),await i,this.initialized=!0}findWalletConnector(e,t,n){var r,i;return"wallet_connect_v2"===e?null!==(r=this.walletConnectors.filter(y.r).find(t=>t.connectorType===e&&(!n||t.wallets.some(e=>e.address===n))))&&void 0!==r?r:null:null!==(i=this.walletConnectors.filter(y.r).find(r=>r.connectorType===e&&r.walletClientType===t&&(!n||r.wallets.some(e=>e.address===n))))&&void 0!==i?i:null}findSolanaWalletConnector(e){var t;return null!==(t=this.walletConnectors.filter(y.v).find(t=>"unknown"===t.walletClientType?t.walletBranding.id===e:t.walletClientType===e))&&void 0!==t?t:null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter(e=>"embedded"===e.connectorType)}findImportedWalletConnectors(){return this.walletConnectors.filter(e=>"embedded_imported"===e.connectorType)}onInitialized(e){e.wallets.forEach(e=>{let t=this.storedConnections.find(t=>t.address===e.address&&t.connectorType===e.connectorType&&("solana"===e.type&&"unknown"===t.walletClientType&&"unknown"===e.walletClientType?e.meta.id===t.id:t.walletClientType===e.walletClientType));t&&(e.connectedAt=t.connectedAt)}),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&this.emit("walletsUpdated")}addEmbeddedWalletConnectors(e){let{walletProxy:t,user:n,embeddedWallets:r,defaultChain:i,appId:s,privyClient:o}=e,{entropyId:a,entropyIdVerifier:c}=(0,v.g)(n);for(let l of r){let e=this.findEmbeddedWalletConnectors().find(e=>e.walletIndex===l.walletIndex);if(e&&(0,y.r)(e))e.proxyProvider.walletProxy=t;else{let e=new J_({provider:new uk({walletProxy:t,address:l.address,entropyId:a,entropyIdVerifier:c,rpcConfig:this.rpcConfig,chains:this.chains,appId:s,chainId:i.id,walletIndex:l.walletIndex,privyClient:o,walletAccount:l}),chains:this.chains,defaultChain:i,rpcConfig:this.rpcConfig,imported:!1,walletIndex:l.walletIndex});this.addWalletConnector(e)}}}addImportedWalletConnector(e,t,n,r){let i=this.findWalletConnector("embedded_imported","privy",t);if(i&&(0,y.r)(i))i.proxyProvider.walletProxy=e;else{let i=new J_({provider:new uk({walletProxy:e,address:t,entropyId:t,entropyIdVerifier:"ethereum-address-verifier",walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:r,chainId:n.id}),chains:this.chains,walletIndex:0,defaultChain:n,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(i)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter(e=>"embedded"!==e.connectorType),this.storedConnections=(0,b.l)(),this.emit("walletsUpdated")}removeImportedWalletConnectors(){let e=this.findImportedWalletConnectors();e.length&&(e.forEach(e=>{let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1)}),this.storedConnections=(0,b.l)(),this.emit("walletsUpdated"))}
2async createEthereumWalletConnector(e){let{connectorType:t,walletClientType:n,providers:r,walletConfig:i}=e,s=this.findWalletConnector(t,n);if(s&&(0,y.r)(s))return s instanceof iE&&s.resetConnection(n),s;let o=(()=>"injected"!==t?"coinbase_wallet"===t?new G_(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig.coinbaseWallet.config):"base_account"===t?new H_(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig.baseAccount.config,this.setBaseAccountSdk):"null"!==t?new iE({walletConnectCloudProjectId:this.walletConnectCloudProjectId,rpcConfig:this.rpcConfig,chains:this.chains,defaultChain:this.defaultChain,shouldEnforceDefaultChainOnConnect:this.shouldEnforceDefaultChainOnConnect,privyAppId:this.privyAppId,privyAppName:this.privyAppName,walletClientType:n}):i?new y.w({id:i.client,name:i.name,defaultChain:this.defaultChain,walletClientType:i.client}):null:"metamask"===n&&null!==r&&void 0!==r&&r.eip6963InjectedProvider?new vk(this.chains,this.defaultChain,this.rpcConfig,null===r||void 0===r?void 0:r.eip6963InjectedProvider,"metamask"):"metamask"===n&&null!==r&&void 0!==r&&r.legacyInjectedProvider?new yk(this.chains,this.defaultChain,this.rpcConfig,null===r||void 0===r?void 0:r.legacyInjectedProvider,"metamask"):"phantom"===n&&null!==r&&void 0!==r&&r.legacyInjectedProvider?new yk(this.chains,this.defaultChain,this.rpcConfig,null===r||void 0===r?void 0:r.legacyInjectedProvider,"phantom"):null!==r&&void 0!==r&&r.legacyInjectedProvider&&"unknown_browser_extension"===n?new yk(this.chains,this.defaultChain,this.rpcConfig,null===r||void 0===r?void 0:r.legacyInjectedProvider):null!==r&&void 0!==r&&r.eip6963InjectedProvider?new gk(this.chains,this.defaultChain,this.rpcConfig,null===r||void 0===r?void 0:r.eip6963InjectedProvider,n):void 0)();return o&&this.addWalletConnector(o),o||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",()=>this.onInitialized(e)),e.on("walletsUpdated",()=>this.onWalletsUpdated(e)),e.initialize().catch(e=>{console.debug("Failed to initialize connector",e)})}setWalletList(e){this.walletList=e,this.initialized&&this.initialize(!0).catch(console.error)}removeAllConnectors(){for(let e of this.walletConnectors)e.removeAllListeners();this.walletConnectors=[]}constructor(e,t,n,r,i,s,o,a,c,l,u,d){super(),this.addSolanaWalletConnector=async e=>{let t=this.findSolanaWalletConnector(e.walletClientType);if(!t||"null"===t.connectorType){if("null"===(null===t||void 0===t?void 0:t.connectorType)){let e=this.walletConnectors.indexOf(t);this.walletConnectors.splice(e,1)}this.addWalletConnector(e)}},this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=n,this.chains=r,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=s,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=a,this.externalWalletConfig=c,this.privyAppName=l,this.walletChainType=d||"ethereum-only",this.setBaseAccountSdk=u,this.storedConnections=(0,b.l)()}}const bk=(0,Hn.v)(()=>({identityToken:null}));let Ak=[jn.z,jn.A,jn.B];class _k{async get(e,t){try{return await this.baseFetch(e,t)}catch(e){throw(0,w.f)(e)}}async post(e,t,n){try{return await this.baseFetch(e,(0,i.A)((0,i.A)({method:"POST"},t?{body:t}:{}),n))}catch(e){throw(0,w.f)(e)}}async delete(e,t){try{return await this.baseFetch(e,(0,i.A)({method:"DELETE"},t))}catch(e){throw(0,w.f)(e)}}constructor(e){let{appId:t,appClientId:n,client:r,defaults:i}=e;this.appId=t,this.appClientId=n,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=On.V,this.client=r,this.defaults=i,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=P_.OT.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async e=>{let{request:t,options:n}=e,r=new Headers(n.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client","react-auth:".concat(this.sdkVersion));let i=Ak.includes(t.toString());if(!r.has("authorization")){let e=await this.client.getAccessToken({disableAutoRefresh:i});null!==e&&r.set("authorization","Bearer ".concat(e))}n.headers=r,n.retryDelay&&"number"==typeof n.retryDelay&&(n.retryDelay=3*n.retryDelay)},onRequestError:e=>{let{error:t}=e;if(t instanceof DOMException&&"AbortError"===t.name)throw new w.h}})}}const xk=e=>{var t,n,r,i;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:(null===(t=e.allow_credentials)||void 0===t?void 0:t.map(e=>({id:e.id,type:e.type,transports:e.transports})))||[],timeout:e.timeout,extensions:{appid:null===(n=e.extensions)||void 0===n?void 0:n.app_id,credProps:null===(r=e.extensions)||void 0===r?void 0:r.cred_props,hmacCreateSecret:null===(i=e.extensions)||void 0===i?void 0:i.hmac_create_secret},userVerification:e.user_verification}};class Ek{getOrCreateGuestCredential(e){let t=(0,On.g)(e);
2if((0,b.e)()){if(b.u.get(t))return b.u.get(t);{let e=f.l(px(32));return b.u.put(t,e),e}}return f.l(px(32))}async authenticate(){if(!this.api)throw new w.a("Auth flow has no API instance");try{return await this.api.post(jn.C,{guest_credential:this.meta.guestCredential})}catch(Qe){throw(0,w.f)(Qe)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}}function kk(){return!(Rn.nr&&window.location.origin.startsWith("http://localhost"))}var Sk,Ik=((Sk={}).PRIVY="privy_access_token",Sk.CUSTOMER="customer_access_token",Sk);class Tk{get token(){return this.privyAccessToken||this.customerAccessToken}getToken(e){return"privy_access_token"===e?this.privyAccessToken:this.customerAccessToken}get customerAccessToken(){return this._getToken(On.C)}get privyAccessToken(){return this._getToken(On.P)}_getToken(e){try{let t=b.u.get(e);return"string"==typeof t?B_.throwIfNotWellFormedJwt(t):null}catch(e){return console.error(e),this.destroyLocalState(),null}}get refreshToken(){try{let e=b.u.get(On.R);return"string"==typeof e?e:null}catch(Qe){return console.error(Qe),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let t=b.u.get((0,On.e)(e));if("string"!=typeof t)return null;{let n=new B_(t);return n.isExpired()?(b.u.del((0,On.e)(e)),null):n.value}}catch(e){return console.error(e),null}}get mightHaveServerCookies(){try{let e=O_.A.get(On.f);return void 0!==e&&e.length>0}catch(Qe){console.error(Qe)}return!1}hasRefreshCredentials(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"privy_access_token",t="string"==typeof this.getToken(e),n="string"==typeof this.refreshToken&&this.refreshToken!==On.h;return this.mightHaveServerCookies||t&&n}hasActiveAccessToken(e){let t=B_.parse(this.getToken(e));return null!==t&&!t.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,t){"string"==typeof t?b.u.put((0,On.e)(e),t):b.u.del((0,On.e)(e))}updateIdentityToken(e){"string"==typeof e?this.storeIdentityToken(e):this.clearIdentityToken()}async _authenticate(e){try{let t=await e.authenticate(),{user:n,is_new_user:r,oauth_tokens:i}=t;this.handleTokenResponse(t);let s=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0;return this._trackAuthenticateEvents(e,r),{user:(0,g.l)(n),isNewUser:r,oAuthTokens:s}}catch(e){throw console.warn("Error authenticating session"),(0,w.i)(e)}}_trackAuthenticateEvents(e,t){let n=function(e){return e instanceof X_?"email":e instanceof Ex?"sms":e instanceof _x?"siwe":e instanceof Ek?"guest":e instanceof XE?"custom_auth":e instanceof yx?e.meta.provider:null}(e);n&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:n,isNewUser:t}}),"siwe"===n&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}})}async _link(e){try{let t=await e.link(),n=t.oauth_tokens,r=n?{provider:n.provider,accessToken:n.access_token,accessTokenExpiresInSeconds:n.access_token_expires_in_seconds,refreshToken:n.refresh_token,refreshTokenExpiresInSeconds:n.refresh_token_expires_in_seconds,scopes:n.scopes}:void 0;return{user:(0,g.l)(t),oAuthTokens:r}}catch(e){throw console.warn("Error linking account"),(0,w.i)(e)}}async _refresh(){if(!this.api)throw new w.a("Session has no API instance");if(!this.client)throw new w.a("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,t=this.refreshToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(!(e&&t||this.mightHaveServerCookies))return null;{let r={};e&&(r.authorization="Bearer ".concat(e)),n=await this.api.post(jn.z,t?{refresh_token:t}:{},{headers:r})}return this.handleTokenResponse(n),(0,g.l)(n.user)}catch(e){if(e instanceof w.e&&e.privyErrorCode===w.b.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw(0,w.i)(e)}}handleTokenResponse(e){e.session_update_action&&"set"!==e.session_update_action?"clear"===e.session_update_action?this.destroyLocalState():"ignore"===e.session_update_action&&(e.token&&(this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token)),e.identity_token&&this.storeIdentityToken(e.identity_token)):this._storeAllTokens(e)}_storeAllTokens(e){this.storeRefreshToken(e.refresh_token),this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token),e.identity_token&&this.storeIdentityToken(e.identity_token)}async _destroy(){try{var e;await(null===(e=this.api)||void 0===e?void 0:e.post(jn.A,{refresh_token:this.refreshToken}
2))}catch(Qe){console.warn("Error destroying session")}this.destroyLocalState()}destroyLocalState(){this.storeRefreshToken(null),this.storeCustomerAccessToken(null),this.storePrivyAccessToken(null),this.clearIdentityToken()}storeCustomerAccessToken(e){var t,n;if("string"==typeof e){var r,i,s;let t=b.u.get(On.C);if(b.u.put(On.C,e),null===(r=this.client)||void 0===r||!r.useServerCookies){var o;let t=null===(o=B_.parse(e))||void 0===o?void 0:o.expiration;O_.A.set(On.i,e,{sameSite:"Strict",secure:kk(),expires:t?new Date(1e3*t):void 0})}t!==e&&(null===(i=this.client)||void 0===i||null===(s=i.onStoreCustomerAccessToken)||void 0===s||s.call(i,e))}else b.u.del(On.C),O_.A.remove(On.i),null===(t=this.client)||void 0===t||null===(n=t.onDeleteCustomerAccessToken)||void 0===n||n.call(t)}storeRefreshToken(e){var t;"string"==typeof e?(b.u.put(On.R,e),(null===(t=this.client)||void 0===t?void 0:t.useServerCookies)||O_.A.set(On.f,"t",{sameSite:"Strict",secure:kk(),expires:30})):(b.u.del(On.R),O_.A.remove(On.j),O_.A.remove(On.f))}storePrivyAccessToken(e){"string"==typeof e?b.u.put(On.P,e):b.u.del(On.P)}storeIdentityToken(e){var t,n;if(bk.setState({identityToken:e}),null!==(t=this.client)&&void 0!==t&&t.useServerCookies)return;b.u.put(On.I,e);let r=null===(n=B_.parse(e))||void 0===n?void 0:n.expiration;O_.A.set(On.k,e,{sameSite:"Strict",secure:kk(),expires:r?new Date(1e3*r):void 0})}clearIdentityToken(){b.u.del(On.I),bk.setState({identityToken:null}),O_.A.remove(On.k)}constructor(){this.authenticateOnce=new ax(async e=>this._authenticate(e)),this.linkOnce=new ax(async e=>this._link(e)),this.refreshOnce=new ax(this._refresh.bind(this)),this.destroyOnce=new ax(this._destroy.bind(this))}}let Ck,Pk;var Ok=0,Nk="__private_"+Ok+++"__getOrGenerateClientAnalyticsId";class Rk{getAppId(){return this.appId}initializeConnectorManager(e){let{walletConnectCloudProjectId:t,rpcConfig:n,chains:r,defaultChain:i,store:s,walletList:o,shouldEnforceDefaultChainOnConnect:a,externalWalletConfig:c,appName:l,walletChainType:u,setBaseAccountSdk:d}=e;this.connectors||(this.connectors=new wk(this.appId,t,n,r,i,s,o,a,c,l,d,u))}generateApi(){let e=new _k({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new w.a("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new w.a("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter(e=>"cross_app"===e.type).forEach(e=>{this.storeProviderAccessToken(e.providerApp.id,null)})}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(jn.D,{action:"verify"})}catch(Qe){throw(0,w.f)(Qe)}}async initMfaPasskeyVerification(){try{let e=await this.api.post(jn.E,{});return xk(e.options)}catch(Qe){throw(0,w.f)(Qe)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get("/api/v1/apps/".concat(e,"/cross-app/details"))),this._cachedProviderAppDetails[e]}catch(e){console.error("Error fetching cross app provider details",e)}}async acceptTerms(){try{let e=await this.api.post(jn.F,{});return(0,g.l)(e)}catch(Qe){throw(0,w.i)(Qe)}}async unlinkEmail(e){try{var t;let n=await this.api.post(jn.G,{address:e});return null!==(t=await this.getAuthenticatedUser())&&void 0!==t?t:(0,g.l)(n)}catch(e){throw(0,w.i)(e)}}async unlinkPhone(e){try{var t;let n=await this.api.post(jn.H,{phoneNumber:e});return null!==(t=await this.getAuthenticatedUser())&&void 0!==t?t:(0,g.l)(n)}catch(e){throw(0,w.i)(e)}}async unlinkEthereumWallet(e){try{var t;let n=await this.api.post(jn.I,{address:e});return null!==(t=await this.getAuthenticatedUser())&&void 0!==t?t:(0,g.l)(n)}catch(e){throw(0,w.i)(e)}}async unlinkSolanaWallet(e){try{var t;let n=await this.api.post(jn.J,{address:e});return null!==(t=await this.getAuthenticatedUser())&&void 0!==t?t:(0,g.l)(n)}catch(e){throw(0,w.i)(e)}}async unlinkOAuth(e,t){try{var n;let r=await this.api.post(jn.K,{provider:e,subject:t});return null!==(n=await this.getAuthenticatedUser())&&void 0!==n?n:(0,g.l)(r)}catch(e){throw(0,w.i)(e)}}async unlinkFarcaster(e){try{var t;let n=await this.api.post(jn.L,{fid:e});return null!==(t=await this.getAuthenticatedUser())&&void 0!==t?t:(0,g.l)(n)}catch(e){throw(0,w.i)(e)}}async unlinkTelegram(e){try{var t;let n=await this.api.post(jn.M,{telegram_user_id:e});return null!==(t=await this.getAuthenticatedUser())&&void 0!==t?t:(0,g.l)(n)}catch(e){throw(0,w.i)(e)}}async revokeDelegatedWallet(){try{await this.api.post(jn.N,{})}catch(Qe){throw(0,w.i)(Qe)}}async createAnalyticsEvent(e){let{eventName:t,payload:n,timestamp:r,options:s}=e;if("undefined"!=typeof window)try{var o;this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(jn.B,{event_name:t,client_id:this.clientAnalyticsId,payload:(0,i.A)((0,i.A)({},n||{}),{},{clientTimestamp:r?r.toISOString():(new Date).toISOString()})},{retry:-1,keepalive:null!==(o=null===s||void 0===s?void 0:s.keepAlive)&&void 0!==o&&o})}catch(t){console.log("Unable to submit event. This is not an issue.")}}async signMoonpayOnRampUrl(e){try{return this.api.post(jn.O,e)}catch(e){throw(0,w.i)(e)}}async initCoinbaseOnRamp(e){try{return this.api.post(jn.P,e)}catch(e){throw(0,w.i)(e)}}async getCoinbaseOnRampStatus(e){let{partnerUserId:t}=e;try{return this.api.get("".concat(jn.Q,"?partnerUserId=").concat(t))}catch(t){throw(0,w.i)(t)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(Ik.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(Ik.PRIVY,e)}async _getToken(e,t){var n;return this.session.getToken(e)?this.session.hasActiveAccessToken(e)?this.session.hasRefreshCredentials(e)?(null===(n=D_.parse(this.session.getToken(e)))||void 0===n?void 0:n.appId)!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null):null!==t&&void 0!==t&&t.disableAutoRefresh||!this.session.hasRefreshCredentials(e)?null:(await this.session.refresh(),this.session.getToken(e)):null}async getUsdTokenPrice(e){try{return(await this.api.get("/api/v1/token_price?chainId=".concat(e.id,"&tokenSymbol=").concat(e.nativeCurrency.symbol))).usd}catch(t){return void console.error("Unable to fetch token price for chain with id ".concat(e.id))}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch(Qe){return void console.error("Unable to fetch token price for SOL")}}async getSplTokenMetadata(e){let{mintAddress:t,cluster:n}=e;try{return await this.api.get("/api/v1/spl_token_info?mint_address=".concat(t,"&cluster=").concat(n))}catch(He){return void console.error("Unable to fetch token metadata for ".concat(n,":").concat(t))}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async generateSiweNonce(e){let{address:t,captchaToken:n}=e;try{return(await this.api.post(jn.R,{address:t,token:n})).nonce}catch(t){throw(0,w.i)(t)}}async authenticateWithSiweInternal(e){let{message:t,signature:n,chainId:r,walletClientType:i,connectorType:s,mode:o}=e;return await this.api.post(jn.S,{message:t,signature:n,chainId:r,walletClientType:i,connectorType:s,mode:o})}async linkWithSiweInternal(e){let{message:t,signature:n,chainId:r,walletClientType:i,connectorType:s}=e;return await this.api.post(jn.T,{message:t,signature:n,chainId:r,walletClientType:i,connectorType:s})}async linkSmartWallet(e){let{message:t,signature:n,smartWalletType:r,smartWalletVersion:i}=e;try{let e=await this.api.post(jn.U,{message:t,signature:n,smart_wallet_type:r,smart_wallet_version:i});return(0,g.l)(e)}catch(t){throw(0,w.i)(t)}}async linkWithSiwe(e){let{message:t,signature:n,chainId:r,walletClientType:i,connectorType:s}=e;try{let e=await this.linkWithSiweInternal({message:t,signature:n,chainId:r,walletClientType:i,connectorType:s});return(0,g.l)(e)}catch(t){throw(0,w.i)(t)}}async generateSiwsNonce(e){let{address:t,captchaToken:n}=e;try{return(await this.api.post(jn.V,{address:t,token:n})).nonce}catch(t){throw(0,w.i)(t)}}async authenticateWithSiwsInternal(e){let{message:t,signature:n,walletClientType:r,connectorType:i,mode:s,messageType:
2o="plain"}=e;return await this.api.post(jn.W,{message:t,signature:n,walletClientType:r,connectorType:i,mode:s,message_type:o})}async authenticateWithSiws(e){let{message:t,signature:n,walletClientType:r,connectorType:i,mode:s,messageType:o="plain"}=e,a=await this.authenticateWithSiwsInternal({message:t,signature:n,walletClientType:r,connectorType:i,mode:s,messageType:o});this.session.handleTokenResponse(a);let c=(0,g.l)(a.user);if(!c)throw Error("Authentication failed - no user returned");return{user:c,isNewUser:a.is_new_user||!1}}async sendAccountTransferRequest(e){let{nonce:t,account:n,accountType:r,externalWalletMetadata:s,telegramAuthResult:o,telegramWebAppData:a,farcasterEmbeddedAddress:c,oAuthUserInfo:l}=e;try{var u;let e,d;switch(r){case"email":e=jn.a1,d={nonce:t,email:n};break;case"sms":e=jn.a0,d={nonce:t,phoneNumber:n};break;case"siwe":if(e=jn.$,!s)throw Error("Wallet parameters must be defined");d=(0,i.A)({nonce:t,address:n},s);break;case"farcaster":e=jn._,d={nonce:t,farcaster_id:n,farcaster_embedded_address:c};break;case"telegram":e=jn.Z,d={nonce:t,telegram_auth_result:o,telegram_web_app_data:a};break;case"siws":e=jn.Y,d=(0,i.A)({nonce:t,address:n},s);break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:e=jn.X,d={nonce:t,userInfo:l}}let h=await this.api.post(e,d);return null!==(u=await this.getAuthenticatedUser())&&void 0!==u?u:(0,g.l)(h)}catch(t){throw(0,w.i)(t)}}async linkWithSiwsInternal(e){let{message:t,signature:n,walletClientType:r,connectorType:i,messageType:s="plain"}=e;return await this.api.post(jn.a2,{message:t,signature:n,walletClientType:r,connectorType:i,message_type:s})}async linkWithSiws(e){let{message:t,signature:n,walletClientType:r,connectorType:i,messageType:s="plain"}=e;try{let e=await this.linkWithSiwsInternal({message:t,signature:n,walletClientType:r,connectorType:i,messageType:s});return(0,g.l)(e)}catch(t){throw(0,w.i)(t)}}async updateUserAndIdToken(){try{let e=await this.api.get(jn.a3);return this.session.updateIdentityToken(e.identity_token),(0,g.l)(e.user)}catch(Qe){throw(0,w.i)(Qe)}}async scanTransaction(e){try{return await this.api.post(jn.a4,e)}catch(e){throw(0,w.i)(e)}}constructor(e){let{apiUrl:t=On.D,appId:n,appClientId:r,timeout:i=On.l}=e;Object.defineProperty(this,Nk,{value:Mk}),this._cachedProviderAppDetails={},this.apiUrl=t,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=t!==On.D&&t.startsWith("https://privy."),this.timeout=i,this.appId=n,this.appClientId=r,this.clientAnalyticsId=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}(this,Nk)[Nk](),Ck||(Ck=new Tk),this.session=Ck,this.api=this.generateApi(),this.session.client=this}}function Mk(){if("undefined"==typeof window)return null;try{let e=b.u.get(On.d);if("string"==typeof e&&e.length>0)return e}catch(e){}let e=(0,h.A)();try{return b.u.put(On.d,e),e}catch(t){return e}}function Uk(){if(!Pk)throw new w.a("No global PrivyClient instance found. Please ensure you have initialized the PrivyProvider.");return Pk}const Lk=e=>{let{config:t}=e,n=(0,s.A)(e,L_);(()=>{if((0,a.useContext)(nk))throw new w.a("Multiple PrivyProvider instances found","Found multiple instances of PrivyProvider, ensure there is only one mounted in your application tree.")})(),function(){if("undefined"==typeof window)return;let e=["localhost","127.0.0.1"].includes(window.location.hostname),t="https:"===window.location.protocol||"chrome-extension:"===window.location.protocol;if(!e&&!t)throw new w.a("Embedded wallet is only available over HTTPS")}(),function(e){if("string"!=typeof e||25!==e.length)throw new w.a("Cannot initialize the Privy provider with an invalid Privy app ID")}(n.appId),function(e){Pk||(Pk=new Rk({appId:e.appId,appClientId:e.clientId,apiUrl:e.apiUrl}))}(n);let r=(0,a.useMemo)(()=>new d.A({appId:n.appId,clientId:n.clientId,storage:b.u,baseUrl:n.apiUrl,sdkVersion:"react-auth:3.8.1"}),[]),c=Uk(),l=Object.assign({},t);return(0,o.jsx)(On.m,{client:r,legacyClient:c,appClientId:n.clientId,clientConfig:l,children:(0,o.jsx)(zn.P,{children:(0,o.jsx)(ck,(0,i.A)((0,i.A)({},n),{},{client:c,privy:r}))})})};function Bk(){let{promptMfa:e,init:t,submit:n,cancel:r,mfaMethods:i}=(0,a.useContext)(g.P);return{promptMfa:e,init:t,submit:n,cancel:r,mfaMethods:i}}function Dk(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:n,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:s,unenroll:o,enrollInMfa:c}=(0,a.useContext)(g.P);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:n,submitEnrollmentWithSms:r,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:s,unenrollWithSms:()=>o("sms"),unenrollWithTotp:()=>o("totp"),unenrollWithPasskey:e=>o("passkey",e),showMfaEnrollmentModal:()=>c(!0),closeMfaEnrollmentModal:()=>c(!1)}}},78203:(e,t,n)=>{"use strict";n.d(t,{V:()=>s});var r=n(14061),i=n(34651);const s=e=>(0,r.di)((0,i.k)(e),0,4)},78686:(e,t,n)=>{"use strict";n.d(t,{m:()=>a});var r=n(18656),i=n(73183),s=n(70759);const o="/docs/contract/encodeDeployData";function a(e){const{abi:t,args:n,bytecode:a}=e;if(!n||0===n.length)return a;const c=t.find(e=>"type"in e&&"constructor"===e.type);if(!c)throw new r.YW({docsPath:o});if(!("inputs"in c))throw new r.YF({docsPath:o});if(!c.inputs||0===c.inputs.length)throw new r.YF({docsPath:o});const l=(0,s.h)(c.inputs,n);return(0,i.aP)([a,l])}},79221:(e,t,n)=>{"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;const r=n(79482);t.toMiliseconds=function(e){return e*r.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/r.ONE_THOUSAND)}},79482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1598);r.__exportStar(n(31012),t),r.__exportStar(n(54989),t)},80028:(e,t,n)=>{"use strict";n.d(t,{s:()=>a});var r=n(63736),i=n(6806),s=n(91638),o=n(652);function a(e,t){const n=t||"hex",a=(0,r.sc)((0,i.q)(e,{strict:!1})?(0,s.ZJ)(e):e);return"bytes"===n?a:(0,o.nj)(a)}},80595:(e,t,n)=>{"use strict";n.d(t,{OT:()=>c});var r=n(66398);const i=function(){if("undefined"!==typeof globalThis)return globalThis;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("unable to locate global object")}(),s=i.fetch?function(){return i.fetch(...arguments)}:()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),o=i.Headers,a=i.AbortController,c=(0,r.c)({fetch:s,Headers:o,AbortController:a})},80681:(e,t,n)=>{"use strict";n.d(t,{T:()=>f});var r=n(47563),i=n(36954);const s=32,o=4096,a=s*o,c=6*a-1-1*o*6;var l=n(4983),u=n(32326),d=n(1490),h=n(91638),p=n(652);function f(e){var t,n,f;const{data:g,kzg:m,to:y}=e,v=null!==(t=e.blobs)&&void 0!==t?t:function(e){var t;const n=null!==(t=e.to)&&void 0!==t?t:"string"===typeof e.data?"hex":"bytes",r="string"===typeof e.data?(0,h.aT)(e.data):e.data,i=(0,d.E)(r);if(!i)throw new l.zF;if(i>c)throw new l.iq({maxSize:c,size:i});const f=[];let g=!0,m=0;for(;g;){const e=(0,u.l)(new Uint8Array(a));let t=0;for(;t<o;){const n=r.slice(m,m+(s-1));if(e.pushByte(0),e.pushBytes(n),n.length<31){e.pushByte(128),g=!1;break}t++,m+=31}f.push(e)}return"bytes"===n?f.map(e=>e.bytes):f.map(e=>(0,p.My)(e.bytes))}({data:g,to:y}),w=null!==(n=e.commitments)&&void 0!==n?n:(0,r.S)({blobs:v,kzg:m,to:y}),b=null!==(f=e.proofs)&&void 0!==f?f:(0,i.t)({blobs:v,commitments:w,kzg:m,to:y}),A=[];for(let r=0;r<v.length;r++)A.push({blob:v[r],commitment:w[r],proof:b[r]});return A}},81152:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(45482);function i(e){return function(){return new s(e.apply(this,arguments))}}function s(e){var t,n;function i(t,n){try{var o=e[t](n),a=o.value,c=a instanceof r.A;Promise.resolve(c?a.v:a).then(function(n){if(c){var r="return"===t?"return":"next";if(!a.k||n.done)return i(r,n);n=e[r](n).value}s(o.done?"return":"normal",n)},function(e){i("throw",e)})}catch(e){s("throw",e)}}function s(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise(function(s,o){var a={key:e,arg:r,resolve:s,reject:o,next:null};n?n=n.next=a:(t=n=a,i(e,r))})},"function"!=typeof e.return&&(this.return=void 0)}s.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(e){return this._invoke("next",e)},s.prototype.throw=function(e){return this._invoke("throw",e)},s.prototype.return=function(e){return this._invoke("return",e)}},81232:(e,t,n)=>{"use strict";function r(e,t){const n=e.exec(t);return null===n||void 0===n?void 0:n.groups}n.d(t,{BD:()=>i,Ge:()=>s,Yv:()=>r,wj:()=>o});const i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,o=/^\(.+?\).*?$/},81705:(e,t,n)=>{const r=n(67735);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function s(e,t,n,r,i,s){l[e]=l[e]+l[t]+i,l[r]=o(l[r]^l[e],16),l[n]=l[n]+l[r],l[t]=o(l[t]^l[n],12),l[e]=l[e]+l[t]+s,l[r]=o(l[r]^l[e],8),l[n]=l[n]+l[r],l[t]=o(l[t]^l[n],7)}function o(e,t){return e>>>t^e<<32-t}const a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([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,
26,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]),l=new Uint32Array(16),u=new Uint32Array(16);function d(e,t){let n=0;for(n=0;n<8;n++)l[n]=e.h[n],l[n+8]=a[n];for(l[12]^=e.t,l[13]^=e.t/4294967296,t&&(l[14]=~l[14]),n=0;n<16;n++)u[n]=i(e.b,4*n);for(n=0;n<10;n++)s(0,4,8,12,u[c[16*n+0]],u[c[16*n+1]]),s(1,5,9,13,u[c[16*n+2]],u[c[16*n+3]]),s(2,6,10,14,u[c[16*n+4]],u[c[16*n+5]]),s(3,7,11,15,u[c[16*n+6]],u[c[16*n+7]]),s(0,5,10,15,u[c[16*n+8]],u[c[16*n+9]]),s(1,6,11,12,u[c[16*n+10]],u[c[16*n+11]]),s(2,7,8,13,u[c[16*n+12]],u[c[16*n+13]]),s(3,4,9,14,u[c[16*n+14]],u[c[16*n+15]]);for(n=0;n<8;n++)e.h[n]^=l[n]^l[n+8]}function h(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const n=t?t.length:0;if(t&&!(n>0&&n<=32))throw new Error("Incorrect key length, should be in [1, 32]");const r={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return r.h[0]^=16842752^n<<8^e,n>0&&(p(r,t),r.c=64),r}function p(e,t){for(let n=0;n<t.length;n++)64===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[n]}function f(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;d(e,!0);const t=new Uint8Array(e.outlen);for(let n=0;n<e.outlen;n++)t[n]=e.h[n>>2]>>8*(3&n)&255;return t}function g(e,t,n){n=n||32,e=r.normalizeInput(e);const i=h(n,t);return p(i,e),f(i)}e.exports={blake2s:g,blake2sHex:function(e,t,n){const i=g(e,t,n);return r.toHex(i)},blake2sInit:h,blake2sUpdate:p,blake2sFinal:f}},81946:(e,t,n)=>{"use strict";n.d(t,{p:()=>l});var r=n(24107),i=n(15882),s=n(14764),o=n(41226),a=n(66320);const c=["docsPath"];function l(e,t){let{docsPath:n}=t,l=(0,i.A)(t,c);const u=(()=>{const t=(0,a.l)(e,l);return t instanceof s.RM?e:t})();return new o.$s(u,(0,r.A)({docsPath:n},l))}},82028:(e,t,n)=>{"use strict";n.d(t,{PUP:()=>v,Q7D:()=>A,YsN:()=>d,_mM:()=>g});var r=n(24107),i=n(41684),s=n(64740),o=n(69314),a=n(5708),c=n(24464),l=n(86954);var u="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";var d="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";function h(e){if(!e)throw new Error("Expected a Address.");return"object"===typeof e&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function p(e,t){return t=>{if(!t.value)return Object.freeze({address:e,role:c.Uv.READONLY});const n=t.isWritable?c.Uv.WRITABLE:c.Uv.READONLY;return Object.freeze((0,r.A)({address:h(t.value),role:f(t.value)?(0,c.MR)(n):n},f(t.value)?{signer:t.value}:{}))}}function f(e){return!!e&&"object"===typeof e&&"address"in e&&(0,l.Pl)(e)}async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{programAddress:n="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"}=t;return await(0,a.o0)({programAddress:n,seeds:[(0,a.jw)().encode(e.owner),(0,a.jw)().encode(e.tokenProgram),(0,a.jw)().encode(e.mint)]})}var m=1;function y(){return(0,i.FU)((0,s.a5)([["discriminator",(0,o.Qe)()]]),e=>(0,r.A)((0,r.A)({},e),{},{discriminator:m}))}function v(e,t){var n,r,i,s,o,a,c;const l=null!==(n=null===t||void 0===t?void 0:t.programAddress)&&void 0!==n?n:u,d={payer:{value:null!==(r=e.payer)&&void 0!==r?r:null,isWritable:!0},ata:{value:null!==(i=e.ata)&&void 0!==i?i:null,isWritable:!0},owner:{value:null!==(s=e.owner)&&void 0!==s?s:null,isWritable:!1},mint:{value:null!==(o=e.mint)&&void 0!==o?o:null,isWritable:!1},systemProgram:{value:null!==(a=e.systemProgram)&&void 0!==a?a:null,isWritable:!1},tokenProgram:{value:null!==(c=e.tokenProgram)&&void 0!==c?c:null,isWritable:!1}};d.tokenProgram.value||(d.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),d.systemProgram.value||(d.systemProgram.value="11111111111111111111111111111111");const h=p(l);return Object.freeze({accounts:[h(d.payer),h(d.ata),h(d.owner),h(d.mint),h(d.systemProgram),h(d.tokenProgram)],data:y().encode({}),programAddress:l})}var w=3;function b(){return(0,i.FU)((0,s.a5)([["discriminator",(0,o.Qe)()],["amount",(0,o.eC)()]]),e=>(0,r.A)((0,r.A)({},e),{},{discriminator:w}))}function A(e,t){var n,i,s,o,a;const l=null!==(n=null===t||void 0===t?void 0:t.programAddress)&&void 0!==n?n:d,u={source:{value:null!==(i=e.source)&&void 0!==i?i:null,isWritable:!0},destination:{value:null!==(s=e.destination)&&void 0!==s?s:null,isWritable:!0},authority:{value:null!==(o=e.authority)&&void 0!==o?o:null,isWritable:!1}},h=(0,r.A)({},e),f=(null!==(a=h.multiSigners)&&void 0!==a?a:[]).map(e=>({address:e.address,role:c.Uv.READONLY_SIGNER,signer:e})),g=p(l);return Object.freeze({accounts:[g(u.source),g(u.destination),g(u.authority),...f],data:b().encode(h),programAddress:l})}},82281:(e,t,n)=>{"use strict";n.d(t,{zX:()=>y,bG:()=>v,M:()=>w,rR:()=>b,Po:()=>A,$S:()=>_});var r=n(25741),i=n(33809),s=n(58922),o=n(68419),a=n(73251);function c(e){let{abiItem:t,args:n,includeFunctionName:r=!0,includeName:i=!1}=e;
2if("name"in t&&"inputs"in t&&t.inputs)return"".concat(r?t.name:"","(").concat(t.inputs.map((e,t)=>"".concat(i&&e.name?"".concat(e.name,": "):"").concat("object"===typeof n[t]?(0,a.A)(n[t]):n[t])).join(", "),")")}var l=n(44270),u=n(62016),d=n(10802),h=n(18656),p=n(51659),f=n(85847),g=n(41226),m=n(31479);class y extends p.C{constructor(e,t){var n;let{account:i,docsPath:s,chain:o,data:a,gas:c,gasPrice:l,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,to:y,value:v,stateOverride:w}=t;const b=i?(0,r.J)(i):void 0;let A=(0,g.aO)({from:null===b||void 0===b?void 0:b.address,to:y,value:"undefined"!==typeof v&&"".concat((0,u.c)(v)," ").concat((null===o||void 0===o||null===(n=o.nativeCurrency)||void 0===n?void 0:n.symbol)||"ETH"),data:a,gas:c,gasPrice:"undefined"!==typeof l&&"".concat((0,d.Q)(l)," gwei"),maxFeePerGas:"undefined"!==typeof h&&"".concat((0,d.Q)(h)," gwei"),maxPriorityFeePerGas:"undefined"!==typeof p&&"".concat((0,d.Q)(p)," gwei"),nonce:m});w&&(A+="\n".concat((0,f.uj)(w))),super(e.shortMessage,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",A].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class v extends p.C{constructor(e,t){var n;let{abi:r,args:i,contractAddress:s,docsPath:a,functionName:u,sender:d}=t;const h=(0,l.iY)({abi:r,args:i,name:u}),p=h?c({abiItem:h,args:i,includeFunctionName:!1,includeName:!1}):void 0,f=h?(0,o.B)(h,{includeName:!0}):void 0,y=(0,g.aO)({address:s&&(0,m.R)(s),function:f,args:p&&"()"!==p&&"".concat([...Array(null!==(n=null===u||void 0===u?void 0:u.length)&&void 0!==n?n:0).keys()].map(()=>" ").join("")).concat(p),sender:d});super(e.shortMessage||'An unknown error occurred while executing the contract function "'.concat(u,'".'),{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],y&&"Contract Call:",y].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=i,this.cause=e,this.contractAddress=s,this.functionName=u,this.sender=d}}class w extends p.C{constructor(e){let t,n,r,a,l,{abi:u,data:d,functionName:p,message:f}=e;if(d&&"0x"!==d)try{n=(0,s.W)({abi:u,data:d});const{abiItem:e,errorName:t,args:l}=n;if("Error"===t)a=l[0];else if("Panic"===t){const[e]=l;a=i.fD[e]}else{var g;const n=e?(0,o.B)(e,{includeName:!0}):void 0,i=e&&l?c({abiItem:e,args:l,includeFunctionName:!1,includeName:!1}):void 0;r=[n?"Error: ".concat(n):"",i&&"()"!==i?" ".concat([...Array(null!==(g=null===t||void 0===t?void 0:t.length)&&void 0!==g?g:0).keys()].map(()=>" ").join("")).concat(i):""]}}catch(m){t=m}else f&&(a=f);t instanceof h.Wq&&(l=t.signature,r=['Unable to decode signature "'.concat(l,'" as it was not found on the provided ABI.'),"Make sure you are using the correct ABI and that the error exists on it.","You can look up the decoded signature here: https://openchain.xyz/signatures?query=".concat(l,".")]),super(a&&"execution reverted"!==a||l?['The contract function "'.concat(p,'" reverted with the following ').concat(l?"signature":"reason",":"),a||l].join("\n"):'The contract function "'.concat(p,'" reverted.'),{cause:t,metaMessages:r,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n,this.raw=d,this.reason=a,this.signature=l}}class b extends p.C{constructor(e){let{functionName:t}=e;super('The contract function "'.concat(t,'" returned no data ("0x").'),{metaMessages:["This could be due to any of the following:",' - The contract does not have the function "'.concat(t,'",')," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class A extends p.C{constructor(e){let{factory:t}=e;super("Deployment for counterfactual contract call failed".concat(t?' for factory "'.concat(t,'".'):""),{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class _ extends p.C{constructor(e){let{data:t,message:n}=e;super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}},82425:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}n.d(t,{A:()=>i});var i=function e(t,n){function i(e,i,s){if("undefined"!==typeof document){"number"===typeof(s=r({},n,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decode
2URIComponent).replace(/[()]/g,escape);var o="";for(var a in s)s[a]&&(o+="; "+a,!0!==s[a]&&(o+="="+s[a].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+o}}return Object.create({set:i,get:function(e){if("undefined"!==typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var s=n[i].split("="),o=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(r[a]=t.read(o,a),e===a)break}catch(c){}}return e?r[e]:r}},remove:function(e,t){i(e,"",r({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,r({},this.attributes,t))},withConverter:function(t){return e(r({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},82504:(e,t,n)=>{"use strict";n.d(t,{_:()=>i});var r=n(57722);function i(e){return(0,r.useMemo)(()=>e,Object.values(e))}},82595:(e,t,n)=>{"use strict";var r=n(24107),i=Object.defineProperty,s=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},o={84532:{usdcAddress:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",usdcName:"USDC"},8453:{usdcAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",usdcName:"USD Coin"},43113:{usdcAddress:"0x5425890298aed601595a70AB815c96711a31Bc65",usdcName:"USD Coin"},43114:{usdcAddress:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",usdcName:"USD Coin"},4689:{usdcAddress:"0xcdf79194c6c285077a58da47641d4dbe51f63542",usdcName:"Bridged USDC"},103:{usdcAddress:"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",usdcName:"USDC"},101:{usdcAddress:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",usdcName:"USDC"},1328:{usdcAddress:"0x4fcf1784b31630811181f670aea7a7bef803eaed",usdcName:"USDC"},1329:{usdcAddress:"0xe15fc38f6d8c56af07bbcbe3baf5708a2bf42392",usdcName:"USDC"},137:{usdcAddress:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",usdcName:"USD Coin"},80002:{usdcAddress:"0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582",usdcName:"USDC"},3338:{usdcAddress:"0xbbA60da06c2c5424f03f7434542280FCAd453d10",usdcName:"USDC"},2741:{usdcAddress:"0x84a71ccd554cc1b02749b35d22f684cc8ec987e1",usdcName:"Bridged USDC"},11124:{usdcAddress:"0xe4C7fBB0a626ed208021ccabA6Be1566905E2dFc",usdcName:"Bridged USDC"},1514:{usdcAddress:"0xF1815bd50389c46847f0Bda824eC8da914045D14",usdcName:"Bridged USDC"},41923:{usdcAddress:"0x12a272A581feE5577A5dFa371afEB4b2F3a8C2F8",usdcName:"Bridged USDC (Stargate)"},324705682:{usdcAddress:"0x2e08028E3C4c2356572E096d8EF835cD5C6030bD",usdcName:"Bridged USDC (SKALE Bridge)"}},a=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"authorizer",type:"address"},{indexed:!0,internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"AuthorizationUsed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"Blacklisted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newBlacklister",type:"address"}],name:"BlacklisterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"burner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newMasterMinter",type:"address"}],name:"MasterMinterChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"minter",type:"address"},{indexed:!1,internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"MinterConfigured",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldMinter",type:"address"}],name:"MinterRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"previousOwner",type:"address"},{indexed:!1,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[],name:"Pause",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newAddress",type:"address"}],name:"PauserChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newRescuer",type:"address"}],name:"RescuerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_account",type:"address"}],name:"UnBlacklisted",type:"event"},{anonymous:!1,inputs:[],name:"Unpause",type:"event"},{inputs:[],name:"CANCEL_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"RECEIVE_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_WITH_AUTHORIZATION_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"}],name:"authorizationState",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}
2],name:"blacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"blacklister",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"authorizer",type:"address"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"cancelAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"},{internalType:"uint256",name:"minterAllowedAmount",type:"uint256"}],name:"configureMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"currency",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"decrement",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"increment",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"tokenName",type:"string"},{internalType:"string",name:"tokenSymbol",type:"string"},{internalType:"string",name:"tokenCurrency",type:"string"},{internalType:"uint8",name:"tokenDecimals",type:"uint8"},{internalType:"address",name:"newMasterMinter",type:"address"},{internalType:"address",name:"newPauser",type:"address"},{internalType:"address",name:"newBlacklister",type:"address"},{internalType:"address",name:"newOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"newName",type:"string"}],name:"initializeV2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"lostAndFound",type:"address"}],name:"initializeV2_1",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address[]",name:"accountsToBlacklist",type:"address[]"},{internalType:"string",name:"newSymbol",type:"string"}],name:"initializeV2_2",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"isBlacklisted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"isMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"masterMinter",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"minterAllowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"pauser",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"receiveWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"minter",type:"address"}],name:"removeMinter",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20",name:"tokenContract",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"rescueERC20",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rescuer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"validAfter",type:"uint256"},{internalType:"uint256",name:"validBefore",type:"uint256"},{internalType:"bytes32",name:"nonce",type:"bytes32"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"transferWithAuthorization",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_account",type:"address"}],name:"unBlacklist",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newBlacklister",type:"address"}],name:"updateBlacklister",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newMasterMinter",type:"address"}],name:"updateMasterMinter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_newPauser",type:"address"}],name:"updatePauser",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRescuer",type:"address"}],name:"updateRescuer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"}];var c,l;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter(e=>
2"number"!==typeof t[t[e]]),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"===typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"===typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"===typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return e.map(e=>"string"===typeof e?"'".concat(e,"'"):e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"===typeof t?t.toString():t}(c||(c={})),function(e){e.mergeShapes=(e,t)=>(0,r.A)((0,r.A)({},e),t)}(l||(l={}));const u=c.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),d=e=>{switch(typeof e){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(e)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(e)?u.array:null===e?u.null:e.then&&"function"===typeof e.then&&e.catch&&"function"===typeof e.catch?u.promise:"undefined"!==typeof Map&&e instanceof Map?u.map:"undefined"!==typeof Set&&e instanceof Set?u.set:"undefined"!==typeof Date&&e instanceof Date?u.date:u.object;default:return u.unknown}}
2,h=c.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class p extends Error{get errors(){return this.issues}constructor(e){var t;super(),t=this,this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.issues=[...t.issues,...e]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof p))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,c.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e.message;const t={},n=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}p.create=e=>new p(e);const f=(e,t)=>{let n;switch(e.code){case h.invalid_type:n=e.received===u.undefined?"Required":"Expected ".concat(e.expected,", received ").concat(e.received);break;case h.invalid_literal:n="Invalid literal value, expected ".concat(JSON.stringify(e.expected,c.jsonStringifyReplacer));break;case h.unrecognized_keys:n="Unrecognized key(s) in object: ".concat(c.joinValues(e.keys,", "));break;case h.invalid_union:n="Invalid input";break;case h.invalid_union_discriminator:n="Invalid discriminator value. Expected ".concat(c.joinValues(e.options));break;case h.invalid_enum_value:n="Invalid enum value. Expected ".concat(c.joinValues(e.options),", received '").concat(e.received,"'");break;case h.invalid_arguments:n="Invalid function arguments";break;case h.invalid_return_type:n="Invalid function return type";break;case h.invalid_date:n="Invalid date";break;case h.invalid_string:"object"===typeof e.validation?"includes"in e.validation?(n='Invalid input: must include "'.concat(e.validation.includes,'"'),"number"===typeof e.validation.position&&(n="".concat(n," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?n='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?n='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):c.assertNever(e.validation):n="regex"!==e.validation?"Invalid ".concat(e.validation):"Invalid";break;case h.too_small:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):"number"===e.type||"bigint"===e.type?"Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):"date"===e.type?"Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):"Invalid input";break;case h.too_big:n="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"bigint"===e.type?"BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"date"===e.type?"Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):"Invalid input";break;case h.custom:n="Invalid input";break;case h.invalid_intersection_types:n="Intersection results could not be merged";break;case h.not_multiple_of:n="Number must be a multiple of ".concat(e.multipleOf);break;case h.not_finite:n="Number must be finite";break;default:n=t.defaultError,c.assertNever(e)}return{message:n}};let g=f;function m(){return g}var y;!function(e){e.errToObj=e=>"string"===typeof e?{message:e}:e||{},e.toString=e=>"string"===typeof e?e:null===e||void 0===e?void 0:e.message}(y||(y={}));const v=e=>{const{data:t,path:n,errorMaps:i,issueData:s}=e,o=[...n,...s.path||[]],a=(0,r.A)((0,r.A)({},s),{},{path:o});if(void 0!==s.message)return(0,r.A)((0,r.A)({},s),{},{path:o,message:s.message});let c="";const l=i.filter(e=>!!e).slice().reverse();for(const r of l)c=r(a,{data:t,defaultError:c}).message;return(0,r.A)((0,r.A)({},s),{},{path:o,message:c})};function w(e,t){const n=m(),r=v({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===f?void 0:f].filter(e=>!!e)});e.common.issues.push(r)}class b{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return A;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const e=await r.key,t=await r.value;n.push({key:e,value:t})}return b.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return A;if("aborted"===i.status)return A;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||"undefined"===typeof i.value&&!r.alwaysSet||(n[t.value]=i.value)}return{status:e.value,value:n}}}const A=Object.freeze({status:"aborted"}),_=e=>({status:"dirty",value:e}),x=e=>
2({status:"valid",value:e}),E=e=>"aborted"===e.status,k=e=>"dirty"===e.status,S=e=>"valid"===e.status,I=e=>"undefined"!==typeof Promise&&e instanceof Promise;class T{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const C=(e,t)=>{if(S(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new p(e.common.issues);return this._error=t,this._error}}};function P(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(t,i)=>{var s;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!==o&&void 0!==o?o:i.defaultError}:"undefined"===typeof i.data?{message:null!==(a=null!==o&&void 0!==o?o:r)&&void 0!==a?a:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!==(s=null!==o&&void 0!==o?o:n)&&void 0!==s?s:i.defaultError};var a},description:i}}class O{get description(){return this._def.description}_getType(e){return d(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:d(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:d(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(I(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null===t||void 0===t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null===t||void 0===t?void 0:t.errorMap},path:(null===t||void 0===t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d(e)},i=this._parseSync({data:e,path:r.path,parent:r});return C(r,i)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return S(n)?{value:n.value}:{issues:t.common.issues}}catch(r){var n;null!==r&&void 0!==r&&null!==(n=r.message)&&void 0!==n&&null!==(n=n.toLowerCase())&&void 0!==n&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>S(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null===t||void 0===t?void 0:t.errorMap,async:!0},path:(null===t||void 0===t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(I(r)?r:Promise.resolve(r));return C(n,i)}refine(e,t){return this._refinement((n,i)=>{const s=e(n),o=()=>i.addIssue((0,r.A)({code:h.custom},(e=>"string"===typeof t||"undefined"===typeof t?{message:t}:"function"===typeof t?t(e):t)(n)));return"undefined"!==typeof Promise&&s instanceof Promise?s.then(e=>!!e||(o(),!1)):!!s||(o(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue("function"===typeof t?t(n,r):t),!1))}_refinement(e){return new Ne({schema:this,typeName:ze.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Re.create(this,this._def)}nullable(){return Me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this)}promise(){return Oe.create(this,this._def)}or(e){return ye.create([this,e],this._def)}and(e){return Ae.create(this,e,this._def)}transform(e){return new Ne((0,r.A)((0,r.A)({},P(this._def)),{},{schema:this,typeName:ze.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){const t="function"===typeof e?e:()=>e;return new Ue((0,r.A)((0,r.A)({},P(this._def)),{},{innerType:this,defaultValue:t,typeName:ze.ZodDefault}))}brand(){return new De((0,r.A)({typeName:ze.ZodBranded,type:this},P(this._def)))}catch(e){const t="function"===typeof e?e:()=>e;return new Le((0,r.A)((0,r.A)({},P(this._def)),{},{innerType:this,catchValue:t,typeName:ze.ZodCatch}))}describe(e){return new(0,this.constructor)((0,r.A)((0,r.A)({},this._def),{},{description:e}))}pipe(e){return je.create(this,e)}readonly(){return Fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const N=/^c[^\s-]{8,}
2$/i,R=/^[0-9a-z]+$/,M=/^[0-9A-HJKMNP-TV-Z]{26}$/i,U=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L=/^[a-z0-9_-]{21}$/i,B=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,D=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,j=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let F;const z=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,W=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,q=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,H=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,V=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,G=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,K="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",J=new RegExp("^".concat(K,"$"));function Z(e){let t="[0-5]\\d";e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):null==e.precision&&(t="".concat(t,"(\\.\\d+)?"));const n=e.precision?"+":"?";return"([01]\\d|2[0-3]):[0-5]\\d(:".concat(t,")").concat(n)}function Q(e){return new RegExp("^".concat(Z(e),"$"))}function Y(e){let t="".concat(K,"T").concat(Z(e));const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(n.join("|"),")"),new RegExp("^".concat(t,"$"))}function X(e,t){return!("v4"!==t&&t||!z.test(e))||!("v6"!==t&&t||!q.test(e))}function $(e,t){if(!B.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return"object"===typeof i&&null!==i&&((!("typ"in i)||"JWT"===(null===i||void 0===i?void 0:i.typ))&&(!!i.alg&&(!t||i.alg===t)))}catch(n){return!1}}function ee(e,t){return!("v4"!==t&&t||!W.test(e))||!("v6"!==t&&t||!H.test(e))}class te extends O{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==u.string){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.string,received:t.parsedType}),A}const t=new b;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),w(n,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),w(n,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,s=e.data.length<i.value;(r||s)&&(n=this._getOrReturnCtx(e,n),r?w(n,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&w(n,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)j.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"email",code:h.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)F||(F=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),F.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"emoji",code:h.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)U.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"uuid",code:h.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)L.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"nanoid",code:h.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)N.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"cuid",code:h.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)R.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"cuid2",code:h.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)M.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"ulid",code:h.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),w(n,{validation:"url",code:h.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"regex",code:h.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("includes"===i.kind)e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),w(n,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty());else if("toLowerCase"===i.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===i.kind)e.data=e.data.toUpperCase();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),w(n,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),w(n,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){Y(i).test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{code:h.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else if("date"===i.kind){J.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{code:h.invalid_string,validation:"date",message:i.message}),t.dirty())}else if("time"===i.kind){Q(i).test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{code:h.invalid_string,validation:"time",message:i.message}),t.dirty())}else"duration"===i.kind?D.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"duration",code:h.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?X(e.data,i.version)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"ip",code:h.invalid_string,message:i.message}),t.dirty()):"jwt"===i.kind?$(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"jwt",code:h.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?ee(e.data,i.version)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"cidr",code:h.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?V.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"base64",code:h.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?G.test(e.data)||(n=this._getOrReturnCtx(e,n),w(n,{validation:"base64url",code:h.invalid_string,message:i.message}),t.dirty()):c.assertNever(i);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),(0,r.A)({validation:t,code:h.invalid_string},y.errToObj(n)))}_addCheck(e){return new te((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,e]}))}email(e){return this._addCheck((0,r.A)({kind:"email"},y.errToObj(e)))}url(e){return this._addCheck((0,r.A)({kind:"url"},y.errToObj(e)))}emoji(e){return this._addCheck((0,r.A)({kind:"emoji"},y.errToObj(e)))}uuid(e){return this._addCheck((0,r.A)({kind:"uuid"},y.errToObj(e)))}nanoid(e){return this._addCheck((0,r.A)({kind:"nanoid"},y.errToObj(e)))}cuid(e){return this._addCheck((0,r.A)({kind:"cuid"},y.errToObj(e)))}cuid2(e){return this._addCheck((0,r.A)({kind:"cuid2"},y.errToObj(e)))}ulid(e){return this._addCheck((0,r.A)({kind:"ulid"},y.errToObj(e)))}base64(e){return this._addCheck((0,r.A)({kind:"base64"},y.errToObj(e)))}base64url(e){return this._addCheck((0,r.A)({kind:"base64url"},y.errToObj(e)))}jwt(e){return this._addCheck((0,r.A)({kind:"jwt"},y.errToObj(e)))}ip(e){return this._addCheck((0,r.A)({kind:"ip"},y.errToObj(e)))}cidr(e){return this._addCheck((0,r.A)({kind:"cidr"},y.errToObj(e)))}datetime(e){var t,n;return"string"===typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck((0,r.A)({kind:"datetime",precision:"undefined"===typeof(null===e||void 0===e?void 0:e.precision)?null:null===e||void 0===e?void 0:e.precision,offset:null!==(t=null===e||void 0===e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null===e||void 0===e?void 0:e.local)&&void 0!==n&&n},y.errToObj(null===e||void 0===e?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"===typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck((0,r.A)({kind:"time",precision:"undefined"===typeof(null===e||void 0===e?void 0:e.precision)?null:null===e||void 0===e?void 0:e.precision},y.errToObj(null===e||void 0===e?void 0:e.message)))}duration(e){return this._addCheck((0,r.A)({kind:"duration"},y.errToObj(e)))}regex(e,t){return this._addCheck((0,r.A)({kind:"regex",regex:e},y.errToObj(t)))}includes(e,t){return this._addCheck((0,r.A)({kind:"includes",value:e,position:null===t||void 0===t?void 0:t.position},y.errToObj(null===t||void 0===t?void 0:t.message)))}startsWith(e,t){return this._addCheck((0,r.A)({kind:"startsWith",value:e},y.errToObj(t)))}endsWith(e,t){return this._addCheck((0,r.A)({kind:"endsWith",value:e},y.errToObj(t)))}min(e,t){return this._addCheck((0,r.A)({kind:"min",value:e},y.errToObj(t)))}max(e,t){return this._addCheck((0,r.A)({kind:"max",value:e},y.errToObj(t)))}length(e,t){return this._addCheck((0,r.A)({kind:"length",value:e},y.errToObj(t)))}nonempty(e){return this.min(1,y.errToObj(e))}trim(){return new te((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new te((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new te((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}
2get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ne(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}te.create=e=>{var t;return new te((0,r.A)({checks:[],typeName:ze.ZodString,coerce:null!==(t=null===e||void 0===e?void 0:e.coerce)&&void 0!==t&&t},P(e)))};class re extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==u.number){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.number,received:t.parsedType}),A}let t;const n=new b;for(const r of this._def.checks)if("int"===r.kind)c.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),w(t,{code:h.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==ne(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),w(t,{code:h.not_finite,message:r.message}),n.dirty()):c.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.toString(t))}setLimit(e,t,n,i){return new re((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:y.toString(i)}]}))}_addCheck(e){return new re((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&c.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}re.create=e=>new re((0,r.A)({checks:[],typeName:ze.ZodNumber,coerce:(null===e||void 0===e?void 0:e.coerce)||!1},P(e)));class ie extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(r){return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let t;const n=new b;for(const i of this._def.checks)if("min"===i.kind){(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty())}else if("max"===i.kind){(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty())}else"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):c.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.bigint,received:t.parsedType}),A}gte(e,t){return this.setLimit("min",e,!0,y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.toString(t))}setLimit(e,t,n,i){return new ie((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:y.toString(i)}]}))}_addCheck(e){return new ie((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,e]}))}
2positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ie.create=e=>{var t;return new ie((0,r.A)({checks:[],typeName:ze.ZodBigInt,coerce:null!==(t=null===e||void 0===e?void 0:e.coerce)&&void 0!==t&&t},P(e)))};class se extends O{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==u.boolean){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.boolean,received:t.parsedType}),A}return x(e.data)}}se.create=e=>new se((0,r.A)({typeName:ze.ZodBoolean,coerce:(null===e||void 0===e?void 0:e.coerce)||!1},P(e)));class oe extends O{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==u.date){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.date,received:t.parsedType}),A}if(Number.isNaN(e.data.getTime())){return w(this._getOrReturnCtx(e),{code:h.invalid_date}),A}const t=new b;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),w(n,{code:h.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),w(n,{code:h.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):c.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new oe((0,r.A)((0,r.A)({},this._def),{},{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:y.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:y.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}oe.create=e=>new oe((0,r.A)({checks:[],coerce:(null===e||void 0===e?void 0:e.coerce)||!1,typeName:ze.ZodDate},P(e)));class ae extends O{_parse(e){if(this._getType(e)!==u.symbol){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.symbol,received:t.parsedType}),A}return x(e.data)}}ae.create=e=>new ae((0,r.A)({typeName:ze.ZodSymbol},P(e)));class ce extends O{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.undefined,received:t.parsedType}),A}return x(e.data)}}ce.create=e=>new ce((0,r.A)({typeName:ze.ZodUndefined},P(e)));class le extends O{_parse(e){if(this._getType(e)!==u.null){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.null,received:t.parsedType}),A}return x(e.data)}}le.create=e=>new le((0,r.A)({typeName:ze.ZodNull},P(e)));class ue extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return x(e.data)}}ue.create=e=>new ue((0,r.A)({typeName:ze.ZodAny},P(e)));class de extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return x(e.data)}}de.create=e=>new de((0,r.A)({typeName:ze.ZodUnknown},P(e)));class he extends O{_parse(e){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.never,received:t.parsedType}),A}}he.create=e=>new he((0,r.A)({typeName:ze.ZodNever},P(e)));class pe extends O{_parse(e){if(this._getType(e)!==u.undefined){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.void,received:t.parsedType}),A}return x(e.data)}}pe.create=e=>new pe((0,r.A)({typeName:ze.ZodVoid},P(e)));class fe extends O{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==u.array)return w(t,{code:h.invalid_type,expected:u.array,received:t.parsedType}),A;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(w(t,{code:e?h.too_big:h.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(w(t,{code:h.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(w(t,{code:h.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new T(t,e,t.path,n)))).then(e=>b.mergeArray(n,e));const i=[...t.data].map((e,n)=>r.type._parseSync(new T(t,e,t.path,n)));return b.mergeArray(n,i)}
2get element(){return this._def.type}min(e,t){return new fe((0,r.A)((0,r.A)({},this._def),{},{minLength:{value:e,message:y.toString(t)}}))}max(e,t){return new fe((0,r.A)((0,r.A)({},this._def),{},{maxLength:{value:e,message:y.toString(t)}}))}length(e,t){return new fe((0,r.A)((0,r.A)({},this._def),{},{exactLength:{value:e,message:y.toString(t)}}))}nonempty(e){return this.min(1,e)}}function ge(e){if(e instanceof me){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Re.create(ge(r))}return new me((0,r.A)((0,r.A)({},e._def),{},{shape:()=>t}))}return e instanceof fe?new fe((0,r.A)((0,r.A)({},e._def),{},{type:ge(e.element)})):e instanceof Re?Re.create(ge(e.unwrap())):e instanceof Me?Me.create(ge(e.unwrap())):e instanceof _e?_e.create(e.items.map(e=>ge(e))):e}fe.create=(e,t)=>new fe((0,r.A)({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ze.ZodArray},P(t)));class me extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=c.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),A}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof he&&"strip"===this._def.unknownKeys))for(const a in n.data)i.includes(a)||s.push(a);const o=[];for(const a of i){const e=r[a],t=n.data[a];o.push({key:{status:"valid",value:a},value:e._parse(new T(n,t,n.path,a)),alwaysSet:a in n.data})}if(this._def.catchall instanceof he){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of s)o.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)s.length>0&&(w(n,{code:h.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=n.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new T(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of o){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>b.mergeObjectSync(t,e)):b.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return y.errToObj,new me((0,r.A)((0,r.A)({},this._def),{},{unknownKeys:"strict"},void 0!==e?{errorMap:(t,n)=>{var r,i,s,o;const a=null!==(r=null===(i=(s=this._def).errorMap)||void 0===i?void 0:i.call(s,t,n).message)&&void 0!==r?r:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=y.errToObj(e).message)&&void 0!==o?o:a}:{message:a}}}:{}))}strip(){return new me((0,r.A)((0,r.A)({},this._def),{},{unknownKeys:"strip"}))}passthrough(){return new me((0,r.A)((0,r.A)({},this._def),{},{unknownKeys:"passthrough"}))}extend(e){return new me((0,r.A)((0,r.A)({},this._def),{},{shape:()=>(0,r.A)((0,r.A)({},this._def.shape()),e)}))}merge(e){return new me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>(0,r.A)((0,r.A)({},this._def.shape()),e._def.shape()),typeName:ze.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new me((0,r.A)((0,r.A)({},this._def),{},{catchall:e}))}pick(e){const t={};for(const n of c.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new me((0,r.A)((0,r.A)({},this._def),{},{shape:()=>t}))}omit(e){const t={};for(const n of c.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new me((0,r.A)((0,r.A)({},this._def),{},{shape:()=>t}))}deepPartial(){return ge(this)}partial(e){const t={};for(const n of c.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new me((0,r.A)((0,r.A)({},this._def),{},{shape:()=>t}))}required(e){const t={};for(const n of c.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Re;)e=e._def.innerType;t[n]=e}return new me((0,r.A)((0,r.A)({},this._def),{},{shape:()=>t}))}keyof(){return Te(c.objectKeys(this.shape))}}me.create=(e,t)=>
2new me((0,r.A)({shape:()=>e,unknownKeys:"strip",catchall:he.create(),typeName:ze.ZodObject},P(t))),me.strictCreate=(e,t)=>new me((0,r.A)({shape:()=>e,unknownKeys:"strict",catchall:he.create(),typeName:ze.ZodObject},P(t))),me.lazycreate=(e,t)=>new me((0,r.A)({shape:e,unknownKeys:"strip",catchall:he.create(),typeName:ze.ZodObject},P(t)));class ye extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{const n=(0,r.A)((0,r.A)({},t),{},{common:(0,r.A)((0,r.A)({},t.common),{},{issues:[]}),parent:null});return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const n=e.map(e=>new p(e.ctx.common.issues));return w(t,{code:h.invalid_union,unionErrors:n}),A});{let e;const i=[];for(const o of n){const n=(0,r.A)((0,r.A)({},t),{},{common:(0,r.A)((0,r.A)({},t.common),{},{issues:[]}),parent:null}),s=o._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&i.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=i.map(e=>new p(e));return w(t,{code:h.invalid_union,unionErrors:s}),A}}get options(){return this._def.options}}ye.create=(e,t)=>new ye((0,r.A)({options:e,typeName:ze.ZodUnion},P(t)));const ve=e=>e instanceof Se?ve(e.schema):e instanceof Ne?ve(e.innerType()):e instanceof Ie?[e.value]:e instanceof Ce?e.options:e instanceof Pe?c.objectValues(e.enum):e instanceof Ue?ve(e._def.innerType):e instanceof ce?[void 0]:e instanceof le?[null]:e instanceof Re?[void 0,...ve(e.unwrap())]:e instanceof Me?[null,...ve(e.unwrap())]:e instanceof De||e instanceof Fe?ve(e.unwrap()):e instanceof Le?ve(e._def.innerType):[];class we extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return w(t,{code:h.invalid_type,expected:u.object,received:t.parsedType}),A;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(w(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const i=new Map;for(const r of t){const t=ve(r.shape[e]);if(!t.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(const n of t){if(i.has(n))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(n)));i.set(n,r)}}return new we((0,r.A)({typeName:ze.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i},P(n)))}}function be(e,t){const n=d(e),i=d(t);if(e===t)return{valid:!0,data:e};if(n===u.object&&i===u.object){const n=c.objectKeys(t),i=c.objectKeys(e).filter(e=>-1!==n.indexOf(e)),s=(0,r.A)((0,r.A)({},e),t);for(const r of i){const n=be(e[r],t[r]);if(!n.valid)return{valid:!1};s[r]=n.data}return{valid:!0,data:s}}if(n===u.array&&i===u.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=be(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===u.date&&i===u.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Ae extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(E(e)||E(r))return A;const i=be(e.value,r.value);return i.valid?((k(e)||k(r))&&t.dirty(),{status:t.value,value:i.data}):(w(n,{code:h.invalid_intersection_types}),A)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(e=>{let[t,n]=e;return r(t,n)}):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}
2Ae.create=(e,t,n)=>new Ae((0,r.A)({left:e,right:t,typeName:ze.ZodIntersection},P(n)));class _e extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.array)return w(n,{code:h.invalid_type,expected:u.array,received:n.parsedType}),A;if(n.data.length<this._def.items.length)return w(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&n.data.length>this._def.items.length&&(w(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new T(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>b.mergeArray(t,e)):b.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new _e((0,r.A)((0,r.A)({},this._def),{},{rest:e}))}}_e.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _e((0,r.A)({items:e,typeName:ze.ZodTuple,rest:null},P(t)))};class xe extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.object)return w(n,{code:h.invalid_type,expected:u.object,received:n.parsedType}),A;const r=[],i=this._def.keyType,s=this._def.valueType;for(const o in n.data)r.push({key:i._parse(new T(n,o,n.path,o)),value:s._parse(new T(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?b.mergeObjectAsync(t,r):b.mergeObjectSync(t,r)}get element(){return this._def.valueType}
2static create(e,t,n){return new xe(t instanceof O?(0,r.A)({keyType:e,valueType:t,typeName:ze.ZodRecord},P(n)):(0,r.A)({keyType:te.create(),valueType:e,typeName:ze.ZodRecord},P(t)))}}class Ee extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.map)return w(n,{code:h.invalid_type,expected:u.map,received:n.parsedType}),A;const r=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map((e,t)=>{let[s,o]=e;return{key:r._parse(new T(n,s,n.path,[t,"key"])),value:i._parse(new T(n,o,n.path,[t,"value"]))}});if(n.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of s){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return A;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of s){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return A;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Ee.create=(e,t,n)=>new Ee((0,r.A)({valueType:t,keyType:e,typeName:ze.ZodMap},P(n)));class ke extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.set)return w(n,{code:h.invalid_type,expected:u.set,received:n.parsedType}),A;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(w(n,{code:h.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(w(n,{code:h.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return A;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const o=[...n.data.values()].map((e,t)=>i._parse(new T(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>s(e)):s(o)}min(e,t){return new ke((0,r.A)((0,r.A)({},this._def),{},{minSize:{value:e,message:y.toString(t)}}))}max(e,t){return new ke((0,r.A)((0,r.A)({},this._def),{},{maxSize:{value:e,message:y.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ke.create=(e,t)=>new ke((0,r.A)({valueType:e,minSize:null,maxSize:null,typeName:ze.ZodSet},P(t)));class Se extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Se.create=(e,t)=>new Se((0,r.A)({getter:e,typeName:ze.ZodLazy},P(t)));class Ie extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return w(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Te(e,t){return new Ce((0,r.A)({values:e,typeName:ze.ZodEnum},P(t)))}Ie.create=(e,t)=>new Ie((0,r.A)({value:e,typeName:ze.ZodLiteral},P(t)));class Ce extends O{_parse(e){if("string"!==typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return w(t,{expected:c.joinValues(n),received:t.parsedType,code:h.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return w(t,{received:t.data,code:h.invalid_enum_value,options:n}),A}return x(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return Ce.create(e,(0,r.A)((0,r.A)({},this._def),t))}exclude(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return Ce.create(this.options.filter(t=>!e.includes(t)),(0,r.A)((0,r.A)({},this._def),t))}}Ce.create=Te;class Pe extends O{_parse(e){const t=c.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==u.string&&n.parsedType!==u.number){const e=c.objectValues(t);return w(n,{expected:c.joinValues(e),received:n.parsedType,code:h.invalid_type}),A}if(this._cache||(this._cache=new Set(c.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=c.objectValues(t);return w(n,{received:n.data,code:h.invalid_enum_value,options:e}),A}return x(e.data)}get enum(){return this._def.values}}Pe.create=(e,t)=>
2new Pe((0,r.A)({values:e,typeName:ze.ZodNativeEnum},P(t)));class Oe extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&!1===t.common.async)return w(t,{code:h.invalid_type,expected:u.promise,received:t.parsedType}),A;const n=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return x(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Oe.create=(e,t)=>new Oe((0,r.A)({type:e,typeName:ze.ZodPromise},P(t)));class Ne extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{w(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===r.type){const e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return A;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?A:"dirty"===r.status||"dirty"===t.value?_(r.value):r});{if("aborted"===t.value)return A;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?A:"dirty"===r.status||"dirty"===t.value?_(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?A:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?A:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!S(e))return A;const s=r.transform(e.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>S(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):A)}c.assertNever(r)}}Ne.create=(e,t,n)=>new Ne((0,r.A)({schema:e,typeName:ze.ZodEffects,effect:t},P(n))),Ne.createWithPreprocess=(e,t,n)=>new Ne((0,r.A)({schema:t,effect:{type:"preprocess",transform:e},typeName:ze.ZodEffects},P(n)));class Re extends O{_parse(e){return this._getType(e)===u.undefined?x(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Re.create=(e,t)=>new Re((0,r.A)({innerType:e,typeName:ze.ZodOptional},P(t)));class Me extends O{_parse(e){return this._getType(e)===u.null?x(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(e,t)=>new Me((0,r.A)({innerType:e,typeName:ze.ZodNullable},P(t)));class Ue extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===u.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ue.create=(e,t)=>new Ue((0,r.A)({innerType:e,typeName:ze.ZodDefault,defaultValue:"function"===typeof t.default?t.default:()=>t.default},P(t)));class Le extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=(0,r.A)((0,r.A)({},t),{},{common:(0,r.A)((0,r.A)({},t.common),{},{issues:[]})}),i=this._def.innerType._parse({data:n.data,path:n.path,parent:(0,r.A)({},n)});return I(i)?i.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new p(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new p(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Le.create=(e,t)=>
2new Le((0,r.A)({innerType:e,typeName:ze.ZodCatch,catchValue:"function"===typeof t.catch?t.catch:()=>t.catch},P(t)));class Be extends O{_parse(e){if(this._getType(e)!==u.nan){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:u.nan,received:t.parsedType}),A}return{status:"valid",value:e.data}}}Be.create=e=>new Be((0,r.A)({typeName:ze.ZodNaN},P(e)));Symbol("zod_brand");class De extends O{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class je extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),_(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new je({in:e,out:t,typeName:ze.ZodPipeline})}}class Fe extends O{_parse(e){const t=this._def.innerType._parse(e),n=e=>(S(e)&&(e.value=Object.freeze(e.value)),e);return I(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}Fe.create=(e,t)=>new Fe((0,r.A)({innerType:e,typeName:ze.ZodReadonly},P(t)));me.lazycreate;var ze;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ze||(ze={}));const We=te.create,qe=re.create,He=(Be.create,ie.create,se.create),Ve=oe.create,Ge=(ae.create,ce.create,le.create,ue.create),Ke=(de.create,he.create,pe.create,fe.create),Je=me.create,Ze=(me.strictCreate,ye.create),Qe=we.create,Ye=(Ae.create,_e.create,xe.create),Xe=(Ee.create,ke.create,Se.create,Ie.create),$e=Ce.create,et=(Pe.create,Oe.create,Ne.create,Re.create,Me.create,Ne.createWithPreprocess,je.create,e=>re.create((0,r.A)((0,r.A)({},e),{},{coerce:!0})));var tt=n(75581),nt=n(46755),rt=n(63679),it=n(70822),st=n(89272),ot=n(63015),at=n(91638),ct=n(652),lt=n(29213),ut=n(71226),dt=n(47e3),ht=n(96550),pt=n(56523),ft=n(43069);const gt=50000n,mt=32n*ft.Au,yt={block:(0,lt.R)({format(e){var t;const n=null===(t=e.transactions)||void 0===t?void 0:t.map(e=>{var t;if("string"===typeof e)return e;const n=null===(t=yt.transaction)||void 0===t?void 0:t.format(e);return"0x71"===n.typeHex?n.type="eip712":"0xff"===n.typeHex&&(n.type="priority"),n});return{l1BatchNumber:e.l1BatchNumber?(0,ot.uU)(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?(0,ot.uU)(e.l1BatchTimestamp):null,transactions:n}}}),transaction:(0,dt.gU)({format(e){const t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),(0,r.A)((0,r.A)({},t),{},{l1BatchNumber:e.l1BatchNumber?(0,ot.uU)(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?(0,ot.uU)(e.l1BatchTxIndex):null})}}),transactionReceipt:(0,ht.WB)({format:e=>({l1BatchNumber:e.l1BatchNumber?(0,ot.uU)(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?(0,ot.uU)(e.l1BatchTxIndex):null,logs:e.logs.map(e=>(0,r.A)((0,r.A)({},(0,ut.e)(e)),{},{l1BatchNumber:e.l1BatchNumber?(0,ot.uU)(e.l1BatchNumber):null,transactionLogIndex:(0,ot.ME)(e.transactionLogIndex),logType:e.logType})),l2ToL1Logs:e.l2ToL1Logs.map(e=>({blockNumber:(0,ot.uU)(e.blockHash),blockHash:e.blockHash,l1BatchNumber:e.l1BatchNumber?(0,ot.uU)(e.l1BatchNumber):null,transactionIndex:(0,ot.uU)(e.transactionIndex),shardId:(0,ot.uU)(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:(0,ot.uU)(e.logIndex)}))})}),transactionRequest:(0,pt.bm)({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:(0,r.A)((0,r.A)((0,r.A)((0,r.A)({},e.gasPerPubdata?{gasPerPubdata:(0,ct.nj)(e.gasPerPubdata)}:{gasPerPubdata:(0,ct.nj)(gt)}),e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from((0,at.aT)(e.paymasterInput))}}:{}),e.factoryDeps?{factoryDeps:e.factoryDeps.map(e=>Array.from((0,at.aT)(e)))}:{}),e.customSignature?{customSignature:Array.from((0,at.aT)(e.customSignature))}:{}),type:"0x71"}:{}})};var vt=n(73183),wt=n(175),bt=n(41226),At=n(15882);const _t=["chainId","nonce"];var xt=n(47563),Et=n(36954),kt=n(38314),St=n(80681),It=n(65747),Tt=n(75408),Ct=n(23422),Pt=n(51659),Ot=n(4983),Nt=n(52763),Rt=n(14764),Mt=n(27133),Ut=n(1490),Lt=n(14061);function Bt(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:i}=e;if(t<=0)throw new Nt.qD({chainId:t});if(i&&!(0,Mt.P)(i))throw new Ct.M({address:i});if(r&&r>ft.Ao)throw new Rt.BG({maxFeePerGas:r});if(n&&r&&n>r)throw new Rt.lN({maxFeePerGas:r,maxPriorityFeePerGas:n})}var Dt=n(41773);function jt(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:i}=e[n];for(let e=0;e<i.length;e++)if(i[e].length-2!==64)throw new bt.fZ({storageKey:i[e]});if(!(0,Mt.P)(r,{strict:!1}))throw new Ct.M({address:r});t.push([r,i])}return t}function Ft(e,t){const n=(0,Dt.L)(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:r,nonce:i,to:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,data:u}=e;Bt(e);const d=jt(l),h=[(0,ct.cK)(n),i?(0,ct.cK)(i):"0x",c?(0,ct.cK)(c):"0x",a?(0,ct.cK)(a):"0x",r?(0,ct.cK)(r):"0x",null!==s&&void 0!==s?s:"0x",o?(0,ct.cK)(o):"0x",null!==u&&void 0!==u?u:"0x",d,...zt(e,t)];return(0,vt.aP)(["0x02",(0,wt.EQ)(h)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:r,data:i,nonce:s,to:o,value:a,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:s}=e;if(t<=0)throw new Nt.qD({chainId:t});if(s&&!(0,Mt.P)(s))throw new Ct.M({address:s});if(n||i)throw new Pt.C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>ft.Ao)throw new Rt.BG({maxFeePerGas:r})}(e);const u=jt(c),d=[(0,ct.cK)(n),s?(0,ct.cK)(s):"0x",l?(0,ct.cK)(l):"0x",r?(0,ct.cK)(r):"0x",null!==o&&void 0!==o?o:"0x",a?(0,ct.cK)(a):"0x",null!==i&&void 0!==i?i:"0x",u,...zt(e,t)];return(0,vt.aP)(["0x01",(0,wt.EQ)(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:r,nonce:i,to:s,value:o,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new Ot.zF;for(const e of t){const t=(0,Ut.E)(e),n=(0,ot.ME)((0,Lt.di)(e,0,1));if(32!==t)throw new Ot.uP({hash:e,size:t});if(n!==Tt.E)throw new Ot.PK({hash:e,version:n})}}Bt(e)}(e);let h=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&("undefined"===typeof h||"undefined"===typeof p)){const t="string"===typeof e.blobs[0]?e.blobs:e.blobs.map(e=>(0,ct.My)(e)),n=e.kzg,r=(0,xt.S)({blobs:t,kzg:n});if("undefined"===typeof h&&(h=(0,kt.d)({commitments:r})),"undefined"===typeof p){const e=(0,Et.t)({blobs:t,commitments:r,kzg:n});p=(0,St.T)({blobs:t,commitments:r,proofs:e})}}const f=jt(u),g=[(0,ct.cK)(n),i?(0,ct.cK)(i):"0x",l?(0,ct.cK)(l):"0x",c?(0,ct.cK)(c):"0x",r?(0,ct.cK)(r):"0x",null!==s&&void 0!==s?s:"0x",o?(0,ct.cK)(o):"0x",null!==d&&void 0!==d?d:"0x",f,a?(0,ct.cK)(a):"0x",null!==h&&void 0!==h?h:[],...zt(e,t)],m=[],y=[],v=[];
2if(p)for(let w=0;w<p.length;w++){const{blob:e,commitment:t,proof:n}=p[w];m.push(e),y.push(t),v.push(n)}return(0,vt.aP)(["0x03",p?(0,wt.EQ)([g,m,y,v]):(0,wt.EQ)(g)])}(e,t):"eip7702"===n?function(e,t){const{authorizationList:n,chainId:r,gas:i,nonce:s,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:e}=n,t=n.address;if(!(0,Mt.P)(t))throw new Ct.M({address:t});if(e<0)throw new Nt.qD({chainId:e})}Bt(e)}(e);const h=jt(u),p=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const{chainId:e,nonce:r}=n,i=(0,At.A)(n,_t),s=n.address;t.push([e?(0,ct.nj)(e):"0x",s,r?(0,ct.nj)(r):"0x",...zt({},i)])}return t}(n);return(0,vt.aP)(["0x04",(0,wt.EQ)([(0,ct.cK)(r),s?(0,ct.cK)(s):"0x",l?(0,ct.cK)(l):"0x",c?(0,ct.cK)(c):"0x",i?(0,ct.cK)(i):"0x",null!==o&&void 0!==o?o:"0x",a?(0,ct.cK)(a):"0x",null!==d&&void 0!==d?d:"0x",h,p,...zt(e,t)])])}(e,t):function(e,t){const{chainId:n=0,gas:r,data:i,nonce:s,to:o,value:a,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:s}=e;if(s&&!(0,Mt.P)(s))throw new Ct.M({address:s});if("undefined"!==typeof t&&t<=0)throw new Nt.qD({chainId:t});if(n||i)throw new Pt.C("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>ft.Ao)throw new Rt.BG({maxFeePerGas:r})}(e);let l=[s?(0,ct.cK)(s):"0x",c?(0,ct.cK)(c):"0x",r?(0,ct.cK)(r):"0x",null!==o&&void 0!==o?o:"0x",a?(0,ct.cK)(a):"0x",null!==i&&void 0!==i?i:"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new bt.zW({v:t.v});return e})(),r=(0,It.B)(t.r),i=(0,It.B)(t.s);l=[...l,(0,ct.cK)(e),"0x00"===r?"0x":r,"0x00"===i?"0x":i]}else n>0&&(l=[...l,(0,ct.cK)(n),"0x","0x"]);return(0,wt.EQ)(l)}(e,t)}function zt(e,t){const n=null!==t&&void 0!==t?t:e,{v:r,yParity:i}=n;if("undefined"===typeof n.r)return[];if("undefined"===typeof n.s)return[];if("undefined"===typeof r&&"undefined"===typeof i)return[];const s=(0,It.B)(n.r),o=(0,It.B)(n.s);return["number"===typeof i?i?(0,ct.cK)(1):"0x":0n===r?"0x":1n===r?(0,ct.cK)(1):27n===r?"0x":(0,ct.cK)(1),"0x00"===s?"0x":s,"0x00"===o?"0x":o]}class Wt extends Pt.C{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join("\n"),{name:"InvalidEip712TransactionError"})}}function qt(e){return"eip712"===e.type||!!("customSignature"in e&&e.customSignature||"paymaster"in e&&e.paymaster||"paymasterInput"in e&&e.paymasterInput||"gasPerPubdata"in e&&"bigint"===typeof e.gasPerPubdata||"factoryDeps"in e&&e.factoryDeps)}function Ht(e){const{chainId:t,to:n,from:r,paymaster:i,paymasterInput:s}=e;if(!qt(e))throw new Wt;if(!t||t<=0)throw new Nt.qD({chainId:t});if(n&&!(0,Mt.P)(n))throw new Ct.M({address:n});if(r&&!(0,Mt.P)(r))throw new Ct.M({address:r});if(i&&!(0,Mt.P)(i))throw new Ct.M({address:i});if(i&&!s)throw new Pt.C("`paymasterInput` must be provided when `paymaster` is defined");if(!i&&s)throw new Pt.C("`paymaster` must be provided when `paymasterInput` is defined")}const Vt={transaction:function(e,t){return qt(e)?function(e){const{chainId:t,gas:n,nonce:r,to:i,from:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:h,gasPerPubdata:p,data:f}=e;Ht(e);const g=[r?(0,ct.nj)(r):"0x",c?(0,ct.nj)(c):"0x",a?(0,ct.nj)(a):"0x",n?(0,ct.nj)(n):"0x",null!==i&&void 0!==i?i:"0x",o?(0,ct.nj)(o):"0x",null!==f&&void 0!==f?f:"0x",(0,ct.nj)(t),(0,ct.nj)(""),(0,ct.nj)(""),(0,ct.nj)(t),null!==s&&void 0!==s?s:"0x",p?(0,ct.nj)(p):(0,ct.nj)(gt),null!==u&&void 0!==u?u:[],null!==l&&void 0!==l?l:"0x",d&&h?[d,h]:[]];return(0,vt.aP)(["0x71",(0,wt.EQ)(g)])}(e):Ft(e,t)}};var Gt=n(61398),Kt=n(80028);class Jt extends Pt.C{constructor(e){let{givenLength:t,maxBytecodeSize:n}=e;super("Bytecode cannot be longer than ".concat(n," bytes. Given length: ").concat(t),{name:"BytecodeLengthExceedsMaxSizeError"})}}class Zt extends Pt.C{constructor(e){let{givenLengthInWords:t}=e;super("Bytecode length in 32-byte words must be odd. Given length in words: ".concat(t),{name:"BytecodeLengthInWordsMustBeOddError"})}}class Qt extends Pt.C{constructor(e){let{givenLength:t}=e;super("The bytecode length in bytes must be divisible by 32. Given length: ".concat(t),{name:"BytecodeLengthMustBeDivisibleBy32Error"})}}function Yt(e){const t=(0,at.ZJ)(e);if(t.length%32!==0)throw new Qt({givenLength:t.length});if(t.length>mt)throw new Jt({givenLength:t.length,maxBytecodeSize:mt});const n=(0,Kt.s)(t),r=(0,at.ZJ)(n),i=t.length/32;if(i%2===0)throw new Zt({givenLengthInWords:i});const s=(0,at.ZJ)(i),o=(0,Gt.eV)(s,{size:2}),a=new Uint8Array([1,0]);return r.set(a,0),r.set(o,2),r}const Xt={blockTime:1e3,formatters:yt,serializers:Vt,custom:{getEip712Domain:e=>{Ht(e);const t=function(e){var t;const{gas:n,nonce:r,to:i,from:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,factoryDeps:l,paymaster:u,paymasterInput:d,gasPerPubdata:h,data:p}=e;return{txType:113n,from:BigInt(s),to:i?BigInt(i):0n,gasLimit:null!==n&&void 0!==n?n:0n,gasPerPubdataByteLimit:null!==h&&void 0!==h?h:gt,maxFeePerGas:null!==a&&void 0!==a?a:0n,maxPriorityFeePerGas:null!==c&&void 0!==c?c:0n,paymaster:u?BigInt(u):0n,nonce:r?BigInt(r):0n,value:null!==o&&void 0!==o?o:0n,data:null!==p&&void 0!==p?p:"0x",factoryDeps:null!==(t=null===l||void 0===l?void 0:l.map(e=>(0,ct.nj)(Yt(e))))&&void 0!==t?t:[],paymasterInput:d||"0x"}}(e);return{domain:{name:"zkSync",version:"2",chainId:e.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:t}}}},$t=(0,st.x)((0,r.A)((0,r.A)({},Xt),{},{blockTime:200,id:2741,name:"Abstract",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://api.mainnet.abs.xyz"],webSocket:["wss://api.mainnet.abs.xyz/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://abscan.org"},native:{name:"Abstract Explorer",url:"https://explorer.mainnet.abs.xyz"}},contracts:{multicall3:{address:"0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7",blockCreated:5288},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:5263}}})),en=(0,st.x)((0,r.A)((0,r.A)({},Xt),{}
2,{blockTime:200,id:11124,name:"Abstract Testnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://api.testnet.abs.xyz"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.abscan.org"},native:{name:"Abstract Explorer",url:"https://explorer.testnet.abs.xyz"}},testnet:!0,contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963",blockCreated:358349},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:431682}}}));const tn={blockTime:2e3,contracts:{gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters:{block:(0,lt.R)({format(e){var t;return{transactions:null===(t=e.transactions)||void 0===t?void 0:t.map(e=>{if("string"===typeof e)return e;const t=(0,dt.uP)(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?(0,ot.uU)(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}),stateRoot:e.stateRoot}}}),transaction:(0,dt.gU)({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?(0,ot.uU)(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:(0,ht.WB)({format:e=>({l1GasPrice:e.l1GasPrice?(0,ot.uU)(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?(0,ot.uU)(e.l1GasUsed):null,l1Fee:e.l1Fee?(0,ot.uU)(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},serializers:{transaction:function(e,t){return function(e){return"deposit"===e.type||"undefined"!==typeof e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!(0,Mt.P)(t))throw new Ct.M({address:t});if(n&&!(0,Mt.P)(n))throw new Ct.M({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:i,isSystemTx:s,mint:o,to:a,value:c}=e,l=[t,r,null!==a&&void 0!==a?a:"0x",o?(0,ct.nj)(o):"0x",c?(0,ct.nj)(c):"0x",i?(0,ct.nj)(i):"0x",s?"0x1":"0x",null!==n&&void 0!==n?n:"0x"];return(0,vt.aP)(["0x7e",(0,wt.EQ)(l)])}(e):Ft(e,t)}}},nn=1,rn=(0,st.x)((0,r.A)((0,r.A)({},tn),{},{id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:(0,r.A)((0,r.A)({},tn.contracts),{},{disputeGameFactory:{[nn]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[nn]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[nn]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[nn]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}}),sourceId:1})),sn=((0,r.A)((0,r.A)({},rn),{},{experimental_preconfirmationTime:200,rpcUrls:{default:{http:["https://mainnet-preconf.base.org"]}}}),11155111),on=(0,st.x)((0,r.A)((0,r.A)({},tn),{},{id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://sepolia.basescan.org",apiUrl:"https://api-sepolia.basescan.org/api"}},contracts:(0,r.A)((0,r.A)({},tn.contracts),{},{disputeGameFactory:{[sn]:{address:"0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"}},l2OutputOracle:{[sn]:{address:"0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"}},portal:{[sn]:{address:"0x49f53e41452c74589e85ca1677426ba426459e85",blockCreated:4446677}},l1StandardBridge:{[sn]:{address:"0xfd0Bf71F60660E2f608ed56e1659C450eB113120",blockCreated:4446677}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1059647}}),testnet:!0,sourceId:sn})),an=((0,r.A)((0,r.A)({},on),{},{experimental_preconfirmationTime:200,rpcUrls:{default:{http:["https://sepolia-preconf.base.org"]}}}),(0,st.x)({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol
2:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}})),cn=(0,st.x)({id:43113,name:"Avalanche Fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://testnet.snowtrace.io",apiUrl:"https://api-testnet.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7096959}},testnet:!0}),ln=(0,st.x)({id:1329,name:"Sei Network",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc.sei-apis.com/"],webSocket:["wss://evm-ws.sei-apis.com/"]}},blockExplorers:{default:{name:"Seitrace",url:"https://seitrace.com",apiUrl:"https://seitrace.com/pacific-1/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}}}),un=(0,st.x)({id:1328,name:"Sei Testnet",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc-testnet.sei-apis.com"],webSocket:["wss://evm-ws-testnet.sei-apis.com"]}},blockExplorers:{default:{name:"Seitrace",url:"https://seitrace.com"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:98697651}},testnet:!0}),dn=(0,st.x)({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),hn=(0,st.x)({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api-amoy.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),pn=(0,st.x)({id:3338,name:"Peaq",nativeCurrency:{decimals:18,name:"peaq",symbol
2:"PEAQ"},rpcUrls:{default:{http:["https://quicknode1.peaq.xyz","https://quicknode2.peaq.xyz","https://quicknode3.peaq.xyz"],webSocket:["wss://quicknode1.peaq.xyz","wss://quicknode2.peaq.xyz","wss://quicknode3.peaq.xyz"]}},blockExplorers:{default:{name:"Subscan",url:"https://peaq.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3566354}}}),fn=(0,st.x)({id:1514,name:"Story",nativeCurrency:{decimals:18,name:"IP Token",symbol:"IP"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:340998},ensRegistry:{address:"0x5dc881dda4e4a8d312be3544ad13118d1a04cb17",blockCreated:648924},ensUniversalResolver:{address:"0xddfb18888a9466688235887dec2a10c4f5effee9",blockCreated:649114}},rpcUrls:{default:{http:["https://mainnet.storyrpc.io"]}},blockExplorers:{default:{name:"Story explorer",url:"https://storyscan.io",apiUrl:"https://storyscan.io/api/v2"}},ensTlds:[".ip"],testnet:!1}),gn=(0,st.x)({id:41923,name:"EDU Chain",nativeCurrency:{decimals:18,name:"EDU",symbol:"EDU"},rpcUrls:{default:{http:["https://rpc.edu-chain.raas.gelato.cloud"]}},blockExplorers:{default:{name:"EDU Chain Explorer",url:"https://educhain.blockscout.com/"}},testnet:!1}),mn=(0,st.x)({id:4689,name:"IoTeX",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.mainnet.iotex.io"],webSocket:["wss://babel-api.mainnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://iotexscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:22163670}}}),yn=(0,st.x)({id:4690,name:"IoTeX Testnet",nativeCurrency:{decimals:18,name:"IoTeX",symbol:"IOTX"},rpcUrls:{default:{http:["https://babel-api.testnet.iotex.io"],webSocket:["wss://babel-api.testnet.iotex.io"]}},blockExplorers:{default:{name:"IoTeXScan",url:"https://testnet.iotexscan.io"}},contracts:{multicall3:{address:"0xb5cecD6894c6f473Ec726A176f1512399A2e355d",blockCreated:24347592}},testnet:!0});var vn=n(7856);var wn=n(29668),bn=n(6806),An=n(17015);let _n=!1;async function xn(e){let{hash:t,privateKey:n,to:i="object"}=e;const{r:s,s:o,recovery:a}=vn.secp256k1.sign(t.slice(2),n.slice(2),{lowS:!0,extraEntropy:(0,bn.q)(_n,{strict:!1})?(0,at.aT)(_n):_n}),c={r:(0,ct.cK)(s,{size:32}),s:(0,ct.cK)(o,{size:32}),v:a?28n:27n,yParity:a};return"bytes"===i||"hex"===i?(0,An.h)((0,r.A)((0,r.A)({},c),{},{to:i})):c}var En=n(42509);var kn=n(26856);var Sn=n(59892);var In=n(44423);const Tn=["privateKey"];function Cn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{nonceManager:n}=t,i=(0,ct.nj)(vn.secp256k1.getPublicKey(e.slice(2),!1)),s=function(e){if("string"===typeof e){if(!(0,Mt.P)(e,{strict:!1}))throw new Ct.M({address:e});return{address:e,type:"json-rpc"}}if(!(0,Mt.P)(e.address,{strict:!1}))throw new Ct.M({address:e.address});return{address:e.address,nonceManager:e.nonceManager,sign:e.sign,signAuthorization:e.signAuthorization,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}({address:(0,wn.M)(i),nonceManager:n,async sign(t){let{hash:n}=t;return xn({hash:n,privateKey:e,to:"hex"})},signAuthorization:async t=>async function(e){var t;const{chainId:n,nonce:i,privateKey:s,to:o="object"}=e,a=null!==(t=e.contractAddress)&&void 0!==t?t:e.address,c=await xn({hash:(0,En.C)({address:a,chainId:n,nonce:i}),privateKey:s,to:o});return"object"===o?(0,r.A)({address:a,chainId:n,nonce:i},c):c}((0,r.A)((0,r.A)({},t),{},{privateKey:e})),async signMessage(t){let{message:n}=t;return async function(e){let{message:t,privateKey:n}=e;return await xn({hash:(0,kn.A)(t),privateKey:n,to:"hex"})}({message:n,privateKey:e})},async signTransaction(t){let{serializer:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async function(e){const{privateKey:t,transaction:n,serializer:i=Ft}=e,s="eip4844"===n.type?(0,r.A)((0,r.A)({},n),{},{sidecars:!1}):n,o=await xn({hash:(0,Sn.S)(await i(s)),privateKey:t});return await i(n,o)}({privateKey:e,transaction:t,serializer:n})},signTypedData:async t=>async function(e){const{privateKey:t}=e,n=(0,At.A)(e,Tn);return await xn({hash:(0,In.Zh)(n),privateKey:t,to:"hex"})}((0,r.A)((0,r.A)({},t),{},{privateKey:e}))});return(0,r.A)((0,r.A)({},s),{},{publicKey:i,source:"privateKey"})}var Pn=n(47197);var On=n(9953),Nn=n(18656),Rn=n(70759),Mn=n(76416);const Un=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"accountAddress",type:"address"},{indexed:!1,internalType:"enum IContractDeployer.AccountNonceOrdering",name:"nonceOrdering",type:"uint8"}],name:"AccountNonceOrderingUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"accountAddress",type:"address"},{indexed:!1,internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"aaVersion",type:"uint8"}],name:"AccountVersionUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"deployerAddress",type:"address"},{indexed:!0,internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"contractAddress",type:"address"}],name:"ContractDeployed",type:"event"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"create",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"create2",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_aaVersion",type:"uint8"}],name:"create2Account",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"},{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_aaVersion",type:"uint8"}],name:"createAccount",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"extendedAccountVersion",outputs:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_keccak256BytecodeHash",type:"bytes32"}],name:"forceDeployKeccak256",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{internalType:"address",name:"newAddress",type:"address"},{internalType:"bool",name:"callConstructor",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"input",type:"bytes"}],internalType:"struct ContractDeployer.ForceDeployment",name:"_deployment",type:"tuple"},{internalType:"address",name:"_sender",type:"address"}],name:"forceDeployOnAddress",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"bytes32",name:"bytecodeHash",type:"bytes32"},{internalType:"address",name:"newAddress",type:"address"},{internalType:"bool",name:"callConstructor",type:"bool"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"input",type:"bytes"}],internalType:"struct ContractDeployer.ForceDeployment[]",name:"_deployments",type:"tuple[]"}],name:"forceDeployOnAddresses",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_address",type:"address"}],name:"getAccountInfo",outputs:[{components:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"supportedAAVersion",type:"uint8"},{internalType:"enum IContractDeployer.AccountNonceOrdering",name:"nonceOrdering",type:"uint8"}],internalType:"struct IContractDeployer.AccountInfo",name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_sender",type:"address"},{internalType:"uint256",name:"_senderNonce",type:"uint256"}],name:"getNewAddressCreate",outputs:[{internalType:"address",name:"newAddress",type:"address"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_sender",type:"address"},{internalType:"bytes32",name:"_bytecodeHash",type:"bytes32"},{internalType:"bytes32",name:"_salt",type:"bytes32"},{internalType:"bytes",name:"_input",type:"bytes"}],name:"getNewAddressCreate2",outputs:[{internalType:"address",name:"newAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"enum IContractDeployer.AccountAbstractionVersion",name:"_version",type:"uint8"}],name:"updateAccountVersion",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"enum IContractDeployer.AccountNonceOrdering",name:"_nonceOrdering",type:"uint8"}],name:"updateNonceOrdering",outputs:[],stateMutability:"nonpayable",type:"function"}],Ln="/docs/contract/encodeDeployData";function Bn(e,t,n,r){const i=[t,n,r];
2return{create:{functionName:"create",argsContractDeployer:i},create2:{functionName:"create2",argsContractDeployer:i},createAccount:{functionName:"createAccount",argsContractDeployer:[...i,1]},create2Account:{functionName:"create2Account",argsContractDeployer:[...i,1]}}[e||"create"]}var Dn=n(25741),jn=n(97562),Fn=n(4386),zn=n(75470),Wn=n(3717),qn=n(84090),Hn=n(81946),Vn=n(44288),Gn=n(45226);function Kn(e){if(!qt(e))throw new Wt;(0,Gn.c)(e)}var Jn=n(36679),Zn=n(87315);const Qn=["account","chain"];async function Yn(e,t){return qt(t)?async function(e,t){var n,i,s;const{account:o=e.account,chain:a=e.chain}=t,c=(0,At.A)(t,Qn),l=o?(0,Dn.J)(o):e.account;if(!l)throw new Wn.T({docsPath:"/docs/actions/wallet/signTransaction"});if(Kn((0,r.A)({account:l,chain:a},t)),null===a||void 0===a||null===(n=a.custom)||void 0===n||!n.getEip712Domain)throw new Pt.C("`getEip712Domain` not found on chain.");if(null===a||void 0===a||null===(i=a.serializers)||void 0===i||!i.transaction)throw new Pt.C("transaction serializer not found on chain.");const u=await(0,Vn.T)(e,jn.T,"getChainId")({});null!==a&&(0,qn.v)({currentChainId:u,chain:a});const d=null===a||void 0===a?void 0:a.custom.getEip712Domain((0,r.A)((0,r.A)({},c),{},{chainId:u,from:l.address,type:"eip712"})),h=await(0,Zn.C)(e,(0,r.A)((0,r.A)({},d),{},{account:l}));return null===a||void 0===a||null===(s=a.serializers)||void 0===s?void 0:s.transaction((0,r.A)((0,r.A)({chainId:u},c),{},{customSignature:h,type:"eip712"}),{r:"0x0",s:"0x0",v:0n})}(e,t):await(0,Jn.W)(e,t)}async function Xn(e,t){const{account:n=e.account,chain:i=e.chain}=t,s=n?(0,Dn.J)(n):e.account;if(!s)throw new Wn.T({docsPath:"/docs/actions/wallet/sendTransaction"});try{Kn(t);const n=await(0,Fn.ft)(e,(0,r.A)((0,r.A)({},t),{},{nonceManager:s.nonceManager,parameters:["gas","nonce","fees"]}));let o;null!==i&&(o=await(0,Vn.T)(e,jn.T,"getChainId")({}),(0,qn.v)({currentChainId:o,chain:i}));const a=await Yn(e,(0,r.A)((0,r.A)({},n),{},{chainId:o}));return await(0,Vn.T)(e,zn.L,"sendRawTransaction")({serializedTransaction:a})}catch(o){throw(0,Hn.p)(o,(0,r.A)((0,r.A)({},t),{},{account:s,chain:i}))}}const $n=["abi","args","bytecode","deploymentType","salt"];function er(e,t){const{abi:n,args:i,bytecode:s,deploymentType:o,salt:a}=t,c=(0,At.A)(t,$n),l=function(e){const{abi:t,args:n,bytecode:r,deploymentType:i,salt:s}=e;if(!n||0===n.length){const{functionName:e,argsContractDeployer:t}=Bn(i,null!==s&&void 0!==s?s:On.t,(0,ct.nj)(Yt(r)),"0x");return(0,Mn.p)({abi:Un,functionName:e,args:t})}const o=t.find(e=>"type"in e&&"constructor"===e.type);if(!o)throw new Nn.YW({docsPath:Ln});if(!("inputs"in o))throw new Nn.YF({docsPath:Ln});if(!o.inputs||0===o.inputs.length)throw new Nn.YF({docsPath:Ln});const a=(0,Rn.h)(o.inputs,n),{functionName:c,argsContractDeployer:l}=Bn(i,null!==s&&void 0!==s?s:On.t,(0,ct.nj)(Yt(r)),a);return(0,Mn.p)({abi:Un,functionName:c,args:l})}({abi:n,args:i,bytecode:s,deploymentType:o,salt:a});return c.factoryDeps=c.factoryDeps||[],c.factoryDeps.includes(s)||c.factoryDeps.push(s),Xn(e,(0,r.A)((0,r.A)({},c),{},{data:l,to:"create2"===o||"create2Account"===o?"0x0000000000000000000000000000000000010000":"0x0000000000000000000000000000000000008006"}))}var tr=n(38254);async function nr(e,t){return qt(t)?Xn(e,t):(0,tr.v)(e,t)}var rr=n(86954),ir=n(15957),sr=n(10860);function or(e){return JSON.parse(function(e){const t=[];let n=!1;for(let r=0;r<e.length;r++){let i=!1;if("\\"===e[r]&&(t.push(e[r++]),i=!i),'"'!==e[r]){if(!n){const n=ar(e,r);if(null!==n&&void 0!==n&&n.length){r+=n.length-1,n.match(/\.|[eE]-/)?t.push(n):t.push(cr(n));continue}}t.push(e[r])}else t.push(e[r]),i||(n=!n)}return t.join("")}(e),(e,t)=>function(e){return!!e&&"object"===typeof e&&"$n"in e&&"string"===typeof e.$n}(t)?function(e){let{$n:t}=e;if(t.match(/[eE]/)){const[e,n]=t.split(/[eE]/);return BigInt(e)*BigInt(10)**BigInt(n)}return BigInt(t)}(t):t)}function ar(e,t){var n;if(null===(n=e[t])||void 0===n||!n.match(/[-\d]/))return null;const r=e.slice(t).match(/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/);return r?r[0]:null}function cr(e){return'{"$n":"'.concat(e,'"}')}var lr=0n;function ur(){const e=lr;return lr++,e.toString()}function dr(e){return{id:ur(),jsonrpc:"2.0",method:e.methodName,params:e.params}}function hr(e,t){return function(e){return e.replace(/\{\s*"\$n"\s*:\s*"(-?\d+)"\s*\}/g,"$1")}(JSON.stringify(e,(e,t)=>"bigint"===typeof t?function(e){return{$n:"".concat(e)}}(t):t,t))}function pr(e){return function(e){return new Proxy(e.api,{defineProperty:()=>!1,deleteProperty:()=>!1,get(t,n,r){if("then"!==n)return function(){const i=n.toString(),s=Reflect.get(t,i,r);for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];if(!s)throw new sr.tsw(sr._jo,{method:i,params:a});const l=s(...a);return function(e,t){let{transport:n}=e;return{send:async e=>await t.execute({signal:null===e||void 0===e?void 0:e.abortSignal,transport:n})}}(e,l)}}})}(e)}function fr(e){return null!=e&&"object"===typeof e&&!Array.isArray(e)&&("jsonrpc"in e&&"2.0"===e.jsonrpc&&"method"in e&&"string"===typeof e.method&&"params"in e)}var gr=n(31576),mr=n(2376);function yr(e){return"bigint"===typeof e?Number(e):e}var vr={};function wr(e){return function t(n,i){if(Array.isArray(n))return n.map((e,n)=>{const s=(0,r.A)((0,r.A)({},i),{},{keyPath:[...i.keyPath,n]});return t(e,s)});if("object"===typeof n&&null!==n){const e={};for(const s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;const o=(0,r.A)((0,r.A)({},i),{},{keyPath:[...i.keyPath,s]});e[s]=t(n[s],o)}return e}return e.reduce((e,t)=>
2t(e,i),n)}}function br(e,t){return n=>{const i=wr(e);return Object.freeze((0,r.A)((0,r.A)({},n),{},{params:i(n.params,t)}))}}function Ar(e){let{commitmentPropertyName:t,params:n,optionsObjectPositionInParams:i,overrideCommitment:s}=e;const o=n[i];if(void 0===o||o&&"object"===typeof o&&!Array.isArray(o))if(o&&t in o){if(!o[t]||"finalized"===o[t]){const e=[...n],{[t]:r}=o,s=(0,At.A)(o,[t].map(gr.A));return Object.keys(s).length>0?e[i]=s:i===e.length-1?e.length--:e[i]=void 0,e}}else if("finalized"!==s){const e=[...n];return e[i]=(0,r.A)((0,r.A)({},o),{},{[t]:s}),e}return n}function _r(e){return(t,n)=>{let{keyPath:r}=n;return"bigint"===typeof t&&e&&(t>Number.MAX_SAFE_INTEGER||t<-Number.MAX_SAFE_INTEGER)&&e(r,t),t}}var xr={accountNotifications:1,blockNotifications:1,getAccountInfo:1,getBalance:1,getBlock:1,getBlockHeight:0,getBlockProduction:0,getBlocks:2,getBlocksWithLimit:2,getEpochInfo:0,getFeeForMessage:1,getInflationGovernor:0,getInflationReward:1,getLargestAccounts:0,getLatestBlockhash:0,getLeaderSchedule:1,getMinimumBalanceForRentExemption:1,getMultipleAccounts:1,getProgramAccounts:1,getSignaturesForAddress:1,getSlot:0,getSlotLeader:0,getStakeMinimumDelegation:0,getSupply:0,getTokenAccountBalance:1,getTokenAccountsByDelegate:2,getTokenAccountsByOwner:2,getTokenLargestAccounts:1,getTokenSupply:1,getTransaction:1,getTransactionCount:0,getVoteAccounts:0,isBlockhashValid:1,logsNotifications:1,programNotifications:1,requestAirdrop:2,sendTransaction:1,signatureNotifications:1,simulateTransaction:1};function Er(e){const t=null===e||void 0===e?void 0:e.onIntegerOverflow;return n=>{return(0,mr.F)(n,t?(r=t,e=>{const t=br([_r(function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return r(e,...n)})],{keyPath:[]});return t(e)}):e=>e,br([yr],{keyPath:[]}),function(e){let{defaultCommitment:t,optionsObjectPositionByMethod:n}=e;return e=>{const{params:r,methodName:i}=e;if(!Array.isArray(r))return e;const s=n[i];return null==s?e:Object.freeze({methodName:i,params:Ar({commitmentPropertyName:"sendTransaction"===i?"preflightCommitment":"commitment",optionsObjectPositionInParams:s,overrideCommitment:t,params:r})})}}({defaultCommitment:null===e||void 0===e?void 0:e.defaultCommitment,optionsObjectPositionByMethod:xr}));var r}}function kr(e){return function(t,n){let{keyPath:r}=n;return"number"===typeof t&&Number.isInteger(t)||"bigint"===typeof t?function(e,t){return t.some(t=>{if(t.length!==e.length)return!1;for(let n=e.length-1;n>=0;n--){const r=e[n],i=t[n];if(i!==r&&(i!==vr||"number"!==typeof r))return!1}return!0})}(r,e)?Number(t):BigInt(t):t}}function Sr(e){return t=[kr(e)],n={keyPath:[]},e=>wr(t)(e,n);var t,n}function Ir(e){return(t,n)=>{const r=n.methodName,i=null!==e&&void 0!==e&&e.allowedNumericKeyPaths&&r?e.allowedNumericKeyPaths[r]:void 0;return(0,mr.F)(t,e=>(e=>{const t=e;if("error"in t)throw(0,sr.evr)(t.error);return t})(e),e=>e.result,e=>Sr(null!==i&&void 0!==i?i:[])(e,n))}}var Tr,Cr=[["data","parsed","info","tokenAmount","decimals"],["data","parsed","info","tokenAmount","uiAmount"],["data","parsed","info","rentExemptReserve","decimals"],["data","parsed","info","rentExemptReserve","uiAmount"],["data","parsed","info","delegatedAmount","decimals"],["data","parsed","info","delegatedAmount","uiAmount"],["data","parsed","info","extensions",vr,"state","olderTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",vr,"state","newerTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",vr,"state","preUpdateAverageRate"],["data","parsed","info","extensions",vr,"state","currentRate"]],Pr=[...Cr,["data","parsed","info","lastExtendedSlotStartIndex"],["data","parsed","info","slashPenalty"],["data","parsed","info","warmupCooldownRate"],["data","parsed","info","decimals"],["data","parsed","info","numRequiredSigners"],["data","parsed","info","numValidSigners"],["data","parsed","info","stake","delegation","warmupCooldownRate"],["data","parsed","info","exemptionThreshold"],["data","parsed","info","burnPercent"],["data","parsed","info","commission"],["data","parsed","info","votes",vr,"confirmationCount"]],Or=[["index"],["
2instructions",vr,"accounts",vr],["instructions",vr,"programIdIndex"],["instructions",vr,"stackHeight"]],Nr=[["addressTableLookups",vr,"writableIndexes",vr],["addressTableLookups",vr,"readonlyIndexes",vr],["header","numReadonlySignedAccounts"],["header","numReadonlyUnsignedAccounts"],["header","numRequiredSignatures"],["instructions",vr,"accounts",vr],["instructions",vr,"programIdIndex"],["instructions",vr,"stackHeight"]];function Rr(e){return function(e){return new Proxy({},{defineProperty:()=>!1,deleteProperty:()=>!1,get(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const[i,s]=n,o=s.toString();return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i=Object.freeze({methodName:o,params:n}),s=null!==e&&void 0!==e&&e.requestTransformer?null===e||void 0===e?void 0:e.requestTransformer(i):i;return Object.freeze({execute:async t=>{let{signal:n,transport:r}=t;const i=dr(s),o=await r({payload:i,signal:n});return null!==e&&void 0!==e&&e.responseTransformer?e.responseTransformer(o,s):o}})}}})}({requestTransformer:Er(e),responseTransformer:Ir({allowedNumericKeyPaths:Mr()})})}function Mr(){return Tr||(Tr={getAccountInfo:Pr.map(e=>["value",...e]),getBlock:[["transactions",vr,"meta","preTokenBalances",vr,"accountIndex"],["transactions",vr,"meta","preTokenBalances",vr,"uiTokenAmount","decimals"],["transactions",vr,"meta","postTokenBalances",vr,"accountIndex"],["transactions",vr,"meta","postTokenBalances",vr,"uiTokenAmount","decimals"],["transactions",vr,"meta","rewards",vr,"commission"],...Or.map(e=>["transactions",vr,"meta","innerInstructions",vr,...e]),...Nr.map(e=>["transactions",vr,"transaction","message",...e]),["rewards",vr,"commission"]],getClusterNodes:[[vr,"featureSet"],[vr,"shredVersion"]],getInflationGovernor:[["initial"],["foundation"],["foundationTerm"],["taper"],["terminal"]],getInflationRate:[["foundation"],["total"],["validator"]],getInflationReward:[[vr,"commission"]],getMultipleAccounts:Pr.map(e=>["value",vr,...e]),getProgramAccounts:Pr.flatMap(e=>[["value",vr,"account",...e],[vr,"account",...e]]),getRecentPerformanceSamples:[[vr,"samplePeriodSecs"]],getTokenAccountBalance:[["value","decimals"],["value","uiAmount"]],getTokenAccountsByDelegate:Cr.map(e=>["value",vr,"account",...e]),getTokenAccountsByOwner:Cr.map(e=>["value",vr,"account",...e]),getTokenLargestAccounts:[["value",vr,"decimals"],["value",vr,"uiAmount"]],getTokenSupply:[["value","decimals"],["value","uiAmount"]],getTransaction:[["meta","preTokenBalances",vr,"accountIndex"],["meta","preTokenBalances",vr,"uiTokenAmount","decimals"],["meta","postTokenBalances",vr,"accountIndex"],["meta","postTokenBalances",vr,"uiTokenAmount","decimals"],["meta","rewards",vr,"commission"],...Or.map(e=>["meta","innerInstructions",vr,...e]),...Nr.map(e=>["transaction","message",...e])],getVersion:[["feature-set"]],getVoteAccounts:[["current",vr,"commission"],["delinquent",vr,"commission"]],simulateTransaction:[["value","loadedAccountsDataSize"],...Pr.map(e=>["value","accounts",vr,...e]),...Or.map(e=>["value","innerInstructions",vr,...e])]}),Tr}var Ur=["getAccountInfo","getBalance","getBlock","getBlockCommitment","getBlockHeight","getBlockProduction","getBlocks","getBlocksWithLimit","getBlockTime","getClusterNodes","getEpochInfo","getEpochSchedule","getFeeForMessage","getFirstAvailableBlock","getGenesisHash","getHealth","getHighestSnapshotSlot","getIdentity","getInflationGovernor","getInflationRate","getInflationReward","getLargestAccounts","getLatestBlockhash","getLeaderSchedule","getMaxRetransmitSlot","getMaxShredInsertSlot","getMinimumBalanceForRentExemption","getMultipleAccounts","getProgramAccounts","getRecentPerformanceSamples","getRecentPrioritizationFees","getSignaturesForAddress","getSignatureStatuses","getSlot","getSlotLeader","getSlotLeaders","getStakeMinimumDelegation","getSupply","getTokenAccountBalance","getTokenAccountsByDelegate","getTokenAccountsByOwner","getTokenLargestAccounts","getTokenSupply","getTransaction","getTransactionCount","getVersion","getVoteAccounts","index","isBlockhashValid","minimumLedgerSlot","requestAirdrop","sendTransaction","simulateTransaction"];
2function Lr(e){return fr(e)&&Ur.includes(e.method)}function Br(e){return function(e){const{fromJson:t,headers:n,toJson:i,url:s}=e,o=n&&function(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}(n);return async function(e){let{payload:n,signal:a}=e;const c=i?i(n):JSON.stringify(n),l=(0,r.A)((0,r.A)({},void 0),{},{body:c,headers:(0,r.A)((0,r.A)({},o),{},{accept:"application/json","content-length":c.length.toString(),"content-type":"application/json; charset=utf-8"}),method:"POST",signal:a}),u=await fetch(s,l);if(!u.ok)throw new sr.tsw(sr._yh,{headers:u.headers,message:u.statusText,statusCode:u.status});return t?t(await u.text(),n):await u.json()}}((0,r.A)((0,r.A)({},e),{},{fromJson:(e,t)=>Lr(t)?or(e):JSON.parse(e),toJson:e=>Lr(e)?hr(e):JSON.stringify(e)}))}var Dr=Object.prototype.toString,jr=Object.keys||function(e){const t=[];for(const n in e)t.push(n);return t};function Fr(e,t){let n,r,i,s,o,a,c;if(!0===e)return"true";if(!1===e)return"false";switch(typeof e){case"object":if(null===e)return null;if("toJSON"in e&&"function"===typeof e.toJSON)return Fr(e.toJSON(),t);if(c=Dr.call(e),"[object Array]"===c){for(i="[",r=e.length-1,n=0;n<r;n++)i+=Fr(e[n],!0)+",";return r>-1&&(i+=Fr(e[n],!0)),i+"]"}if("[object Object]"===c){for(s=jr(e).sort(),r=s.length,i="",n=0;n<r;)o=s[n],a=Fr(e[o],!1),void 0!==a&&(i&&(i+=","),i+=JSON.stringify(o)+":"+a),n++;return"{"+i+"}"}return JSON.stringify(e);case"function":case"undefined":return t?null:void 0;case"bigint":return"".concat(e.toString(),"n");case"string":return JSON.stringify(e);default:return isFinite(e)?e:null}}function zr(e){const t=Fr(e,!1);if(void 0!==t)return""+t}function Wr(e,t,n){let i="";if("number"===typeof t[0]){const e=t[0]+1,n=e%10,r=e%100;i=1==n&&11!=r?e+"st":2==n&&12!=r?e+"nd":3==n&&13!=r?e+"rd":e+"th"}else i="`".concat(t[0].toString(),"`");const s=t.length>1?t.slice(1).map(e=>"number"===typeof e?"[".concat(e,"]"):e).join("."):void 0,o=new sr.tsw(sr.O7$,(0,r.A)({argumentLabel:i,keyPath:t,methodName:e,optionalPathLabel:s?" at path `".concat(s,"`"):"",value:n},void 0!==s?{path:s}:void 0));return(0,sr.rMr)(o,Wr),o}var qr,Hr={defaultCommitment:"confirmed",onIntegerOverflow(e,t,n){throw Wr(e.methodName,t,n)}},Vr=globalThis.AbortController;function Gr(e){return fr(e)?zr([e.method,e.params]):void 0}function Kr(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}function Jr(e){return(0,mr.F)(Br((0,r.A)((0,r.A)({},e),{},{headers:(0,r.A)((0,r.A)((0,r.A)({},!1),e.headers?Kr(e.headers):void 0),{"solana-client":"js/".concat("5.0.0")})})),e=>function(e,t){let n;return async function(i){const{payload:s,signal:o}=i,a=t(s);if(void 0===a)return await e(i);if(n||(queueMicrotask(()=>{n=void 0}),n={}),null==n[a]){const t=new Vr,s=(async()=>{try{return await e((0,r.A)((0,r.A)({},i),{},{signal:t.signal}))}catch(_i){if(_i===(qr||(qr={})))return;throw _i}})();n[a]={abortController:t,numConsumers:0,responsePromise:s}}const c=n[a];if(c.numConsumers++,o){const e=c.responsePromise;return await new Promise((t,n)=>{const r=e=>{o.removeEventListener("abort",r),c.numConsumers-=1,queueMicrotask(()=>{0===c.numConsumers&&c.abortController.abort(qr||(qr={}))}),n(e.target.reason)};o.addEventListener("abort",r),e.then(t).catch(n).finally(()=>{o.removeEventListener("abort",r)})})}return await c.responsePromise}}(e,Gr))}function Zr(e,t){return n=Jr((0,r.A)({url:e},t)),pr({api:Rr(Hr),transport:n});var n}var Qr,Yr=n(48106),Xr=n(31442),$r=n(81152),ei=globalThis.AbortController,ti=globalThis.EventTarget;function ni(){return Symbol(void 0)}var ri=Symbol();function ii(e){return{on(t,n,r){function i(e){if(e instanceof CustomEvent){const t=e.detail;n(t)}else n()}return e.addEventListener(t,i,r),()=>{e.removeEventListener(t,i)}}}}function si(e){return null!==e&&("object"===typeof e||"function"===typeof e)}function oi(e){const t=new Set,n={deferreds:t,settled:!1};return Promise.resolve(e).then(e=>{for(const{resolve:n}of t)n(e);t.clear(),n.settled=!0},e=>{for(const{reject:n}of t)n(e);t.clear(),n.settled=!0}),n}var ai=new WeakMap;async function ci(e){let t;const n=new Promise((n,r)=>{t={reject:r,resolve:n};for(const i of e){if(!si(i)){Promise.resolve(i).then(n,r);continue}let e=ai.get(i);void 0===e?(e=oi(i),e.deferreds.add(t),ai.set(i,e)):e.settled?Promise.resolve(i).then(n,r):e.deferreds.add(t)}});return await n.finally(()=>{for(const n of e)if(si(n)){ai.get(n).deferreds.delete(t)}})}function li(e){return new Proxy(e.api,{defineProperty:()=>!1,deleteProperty:()=>!1,get(t,n,i){if("then"!==n)return function(){const s=n.toString(),o=Reflect.get(t,s,i);if(!o)throw new sr.tsw(sr.uWs,{notificationName:s});const a=o(...arguments);return c=e.transport,l=a,{async subscribe(e){let{abortSignal:t}=e;return function(e){let{abortSignal:t,dataChannelName:n,dataPublisher:r,errorChannelName:i}=e;const s=new Map;function o(e){for(const[t,n]of s.entries())n.__hasPolled?(s.delete(t),n.onError(e)):n.publishQueue.push({__type:1,err:e})}const a=new ei;t.addEventListener("abort",()=>{a.abort(),o(Qr||(Qr=ni()))});const c={signal:a.signal};let l=ri;return r.on(i,e=>{l===ri&&(l=e,a.abort(),o(e))}
2,c),r.on(n,e=>{s.forEach((t,n)=>{if(t.__hasPolled){const{onData:r}=t;s.set(n,{__hasPolled:!1,publishQueue:[]}),r(e)}else t.publishQueue.push({__type:0,data:e})})},c),{[Symbol.asyncIterator]:()=>(0,$r.A)(function*(){if(t.aborted)return;if(l!==ri)throw l;const e=Symbol();s.set(e,{__hasPolled:!1,publishQueue:[]});try{for(;;){const t=s.get(e);if(!t)throw new sr.tsw(sr.LzQ);if(t.__hasPolled)throw new sr.tsw(sr.ibr);const n=t.publishQueue;try{if(n.length){t.publishQueue=[];for(const e of n){if(0!==e.__type)throw e.err;yield e.data}}else yield yield(0,Xr.A)(new Promise((t,n)=>{s.set(e,{__hasPolled:!0,onData:t,onError:n})}))}catch(_i){if(_i===(Qr||(Qr=ni())))return;throw _i}}}finally{s.delete(e)}})()}}({abortSignal:t,dataChannelName:"notification",dataPublisher:await c((0,r.A)({signal:t},l)),errorChannelName:"error"})}};var c,l}}})}var ui=globalThis.AbortController,di=new WeakMap;function hi(e,t,n){if(void 0===n)return;const r=function(e){let t=di.get(e);return t||di.set(e,t={}),t}(t);!r[n]&&e>0&&(r[n]=0);const i=e+r[n];return i<=0?delete r[n]:r[n]=i,i}var pi=new WeakMap;function fi(e,t,n){let i=pi.get(e);i||pi.set(e,i=new WeakMap);const s=null!==n&&void 0!==n?n:e;let o=i.get(s);return o||i.set(s,o=function(e,t,n){let i;const s=new ti,o=ii(s);return(0,r.A)((0,r.A)({},o),{},{on(r,a,c){if(!i){const r=e.on(t,e=>{const t=n(e);if(!t)return;const[r,i]=t;s.dispatchEvent(new CustomEvent(r,{detail:i}))});i={dispose:r,numSubscribers:0}}i.numSubscribers++;const l=o.on(r,a,c);let u=!0;function d(){u&&(u=!1,null===c||void 0===c||c.signal.removeEventListener("abort",d),i.numSubscribers--,0===i.numSubscribers&&(i.dispose(),i=void 0),l())}return null===c||void 0===c||c.signal.addEventListener("abort",d),d}})}(e,"message",e=>{const r=e;if(!("method"in r))return;const i=n?n(r.params.result,t):r.params.result;return["notification:".concat(r.params.subscription),i]})),o}async function gi(e){let t,{channel:n,responseTransformer:r,signal:i,subscribeRequest:s,unsubscribeMethodName:o}=e;n.on("error",()=>{t=void 0,di.delete(n)},{signal:i});const a=new Promise((e,r)=>{function s(){if(0===function(e,t){return hi(-1,e,t)}(n,t)){const e=dr({methodName:o,params:[t]});t=void 0,n.send(e).catch(()=>{})}r(this.reason)}i.aborted?s.call(i):i.addEventListener("abort",s)}),c=dr(s);await n.send(c);const l=new Promise((e,t)=>{const r=new ui;i.addEventListener("abort",r.abort.bind(r));const s={signal:r.signal};n.on("error",e=>{r.abort(),t(e)},s),n.on("message",n=>{n&&"object"===typeof n&&"id"in n&&n.id===c.id&&(r.abort(),"error"in n?t((0,sr.evr)(n.error)):e(n.result))},s)});if(t=await ci([a,l]),null==t)throw new sr.tsw(sr.aYZ);!function(e,t){hi(1,e,t)}(n,t);const u=fi(n,s,r),d="notification:".concat(t);return{on(e,t,r){switch(e){case"notification":return u.on(d,t,r);case"error":return n.on("error",t,r);default:throw new sr.tsw(sr.JOu,{channelName:e,supportedChannelNames:["notification","error"]})}}}}const mi=["request"];function yi(e){const t=Er(e),n=function(e){return(t,n)=>{const r=n.methodName,i=null!==e&&void 0!==e&&e.allowedNumericKeyPaths&&r?e.allowedNumericKeyPaths[r]:void 0;return(0,mr.F)(t,e=>Sr(null!==i&&void 0!==i?i:[])(e,n))}}({allowedNumericKeyPaths:bi()});return function(e){return new Proxy({},{defineProperty:()=>!1,deleteProperty:()=>!1,get(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];const[s,o]=n,a=o.toString();return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];const s={methodName:a,params:n},o=e.requestTransformer?e.requestTransformer(s):s;return{execute:t=>e.planExecutor((0,r.A)((0,r.A)({},t),{},{request:o})),request:o}}}})}({planExecutor(e){let{request:t}=e,i=(0,At.A)(e,mi);return gi((0,r.A)((0,r.A)({},i),{},{responseTransformer:n,subscribeRequest:(0,r.A)((0,r.A)({},t),{},{methodName:t.methodName.replace(/Notifications$/,"Subscribe")}),unsubscribeMethodName:t.methodName.replace(/Notifications$/,"Unsubscribe")}))},requestTransformer:t})}function vi(e){return yi(e)}var wi;function bi(){return wi||(wi={accountNotifications:Pr.map(e=>["value",...e]),blockNotifications:[["value","block","transactions",vr,"meta","preTokenBalances",vr,"accountIndex"],["value","block","transactions",vr,"meta","preTokenBalances",vr,"uiTokenAmount","decimals"],["value","block","transactions",vr,"meta","postTokenBalances",vr,"accountIndex"],["value","block","transactions",vr,"meta","postTokenBalances",vr,"uiTokenAmount","decimals"],["value","block","transactions",vr,"meta","rewards",vr,"commission"],["value","block","transactions",vr,"meta","innerInstructions",vr,"index"],["value","block","transactions",vr,"meta","innerInstructions",vr,"instructions",vr,"programIdIndex"],["value","block","transactions",vr,"meta","innerInstructions",vr,"instructions",vr,"accounts",vr],["value","block","transactions",vr,"transaction","message","addressTableLookups",vr,"writableIndexes",vr],["value","block","transactions",vr,"transaction","message","addressTableLookups",vr,"readonlyIndexes",vr],["value","block","transactions",vr,"transaction","message","instructions",vr,"programIdIndex"],["value","block","transactions",vr,"transaction","message","instructions",vr,"accounts",vr],["value","block","transactions",vr,"transaction","message","header","numReadonlySignedAccounts"],["value","block","transactions",vr,"transaction","message","header","numReadonlyUnsignedAccounts"],["value","block","transactions",vr,"transaction","message","header","numRequiredSignatures"],["value","block","rewards",vr,"commission"]],programNotifications:Pr.flatMap(e=>[["value",vr,"account",...e],[vr,"account",...e]])}),wi}var Ai=globalThis.EventTarget,_i=globalThis.WebSocket;const xi=["intervalMs"];function Ei(e,t,n){let i="";if("number"===typeof t[0]){const e=t[0]+1,n=e%10,r=e%100;i=1==n&&11!=r?e+"st":2==n&&12!=r?e+"nd":3==n&&13!=r?e+"rd":e+"th"}else i="`".concat(t[0].toString(),"`");const s=t.length>1?t.slice(1).map(e=>"number"===typeof e?"[".concat(e,"]"):e).join("."):void 0,o=new sr.tsw(sr.O7$,(0,r.A)({argumentLabel:i,keyPath:t,methodName:e,optionalPathLabel:s?" at path `".concat(s,"`"):"",value:n},void 0!==s?{path:s}:void 0));return(0,sr.rMr)(o,Ei),o}var ki={defaultCommitment:"confirmed",onIntegerOverflow(e,t,n){throw Ei(e.methodName,t,n)}},Si=globalThis.AbortController,Ii={jsonrpc:"2.0",method:"ping"};function Ti(e){return(0,mr.F)(e,e=>function(e,t){return Object.freeze((0,r.A)((0,r.A)({},e),{},{on:(n,r,i)=>"message"!==n?e.on(n,r,i):e.on("message",e=>r(t(e)),i)}))}(e,or),e=>function(e,t){return Object.freeze((0,r.A)((0,r.A)({},e),{},{send:n=>e.send(t(n))}))}(e,hr))}function Ci(e){return Pi((0,r.A)((0,r.A)({},e),{},{jsonSerializer:Ti}))}function Pi(e){var t,n;if(!1===/^wss?:/i.test(e.url)){const t=e.url.match(/^([^:]+):/);throw new DOMException(t?"Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '".concat(t[1],":' is not allowed."):"Failed to construct 'WebSocket': The URL '".concat(e.url,"' is invali
2d."))}const{intervalMs:i}=e,s=(0,At.A)(e,xi);return function(e,t){let{maxSubscriptionsPerChannel:n,minChannels:r}=t;const i={entries:[],freeChannelIndex:-1};function s(){var e,t;if(i.entries.length<r)return void(i.freeChannelIndex=-1);let s;for(let r=0;r<i.entries.length;r++){const e=(i.freeChannelIndex+r+2)%i.entries.length,t=i.entries[e];t.subscriptionCount<n&&(!s||s.subscriptionCount>=t.subscriptionCount)&&(s={poolIndex:e,subscriptionCount:t.subscriptionCount})}i.freeChannelIndex=null!==(e=null===(t=s)||void 0===t?void 0:t.poolIndex)&&void 0!==e?e:-1}return function(t){let n,{abortSignal:r}=t;function o(){const e=i.entries.findIndex(e=>e===n);i.entries.splice(e,1),n.dispose(),s()}if(-1===i.freeChannelIndex){const t=new Si,r=e({abortSignal:t.signal});r.then(e=>{e.on("error",o,{signal:t.signal})}).catch(o),n={channel:r,dispose(){t.abort()},subscriptionCount:0},i.entries.push(n)}else n=i.entries[i.freeChannelIndex];return n.subscriptionCount++,r.addEventListener("abort",function(){n.subscriptionCount--,0===n.subscriptionCount?o():-1!==i.freeChannelIndex&&(i.freeChannelIndex--,s())}),s(),n.channel}}(t=>{var n;let{abortSignal:o}=t;return function(e){let t,{sendBufferHighWatermark:n,signal:i,url:s}=e;if(i.aborted)return Promise.reject(i.reason);let o=!1;const a=new Set;function c(){a.forEach(e=>{e()}),a.clear()}function l(){c(),o||m(i.reason),g.readyState!==_i.CLOSED&&g.readyState!==_i.CLOSING&&g.close(1e3)}function u(e){if(!i.aborted&&!o){const t=new sr.tsw(sr.gF,{errorEvent:e});m(t),h.dispatchEvent(new CustomEvent("error",{detail:t}))}}function d(e){i.aborted||h.dispatchEvent(new CustomEvent("message",{detail:e.data}))}const h=new Ai,p=ii(h);function f(){o=!0,y((0,r.A)((0,r.A)({},p),{},{async send(e){if(g.readyState!==_i.OPEN)throw new sr.tsw(sr.pFb);if(!t&&g.bufferedAmount>n){let e;const r=new Promise((r,i)=>{const s=setInterval(()=>{g.readyState===_i.OPEN&&g.bufferedAmount>n||(clearInterval(s),t=void 0,r())},16);e=()=>{t=void 0,clearInterval(s),i(new sr.tsw(sr.UwC))}});t={onCancel:e,promise:r}}t&&(!ArrayBuffer.isView(e)||e instanceof DataView||(e=new(0,e.constructor)(e)),await t.promise),g.send(e)}}))}const g=new _i(s);let m,y;return i.addEventListener("abort",l),g.addEventListener("close",function e(n){var r;c(),null===(r=t)||void 0===r||r.onCancel(),i.removeEventListener("abort",l),g.removeEventListener("close",e),g.removeEventListener("error",u),g.removeEventListener("message",d),g.removeEventListener("open",f),i.aborted||n.wasClean&&1e3===n.code||h.dispatchEvent(new CustomEvent("error",{detail:new sr.tsw(sr.pFb,{cause:n})}))}),g.addEventListener("error",u),g.addEventListener("message",d),g.addEventListener("open",f),new Promise((e,t)=>{m=t,y=e})}((0,r.A)((0,r.A)({},s),{},{sendBufferHighWatermark:null!==(n=e.sendBufferHighWatermark)&&void 0!==n?n:131072,signal:o})).then(e.jsonSerializer).then(e=>function(e){let t,{abortSignal:n,channel:i,intervalMs:s}=e;function o(){i.send(Ii).catch(e=>{(0,sr.zbS)(e,sr.pFb)&&c.abort()})}function a(){clearInterval(t),t=setInterval(o,s)}const c=new Si;return c.signal.addEventListener("abort",()=>{clearInterval(t)}),n.addEventListener("abort",()=>{c.abort()}),i.on("error",()=>{c.abort()},{signal:c.signal}),i.on("message",a,{signal:c.signal}),globalThis.navigator.onLine&&a(),globalThis.addEventListener("offline",function(){clearInterval(t)},{signal:c.signal}),globalThis.addEventListener("online",function(){o(),a()},{signal:c.signal}),(0,r.A)((0,r.A)({},i),{},{send(){return c.signal.aborted||a(),i.send(...arguments)}})}({abortSignal:o,channel:e,intervalMs:null!==i&&void 0!==i?i:5e3}))},{maxSubscriptionsPerChannel:null!==(t=e.maxSubscriptionsPerChannel)&&void 0!==t?t:100,minChannels:null!==(n=e.minChannels)&&void 0!==n?n:1})}function Oi(e){let{createChannel:t}=e;return(0,mr.F)(function(e){return async t=>{let{execute:n,signal:r}=t;const i=await e({abortSignal:r});return await n({channel:i,signal:r})}}(t),e=>function(e){const t=new Map;return function(n){const{request:i,signal:s}=n,o=zr([i.methodName,i.params]);let a=t.get(o);if(!a){const i=new Si,s=e((0,r.A)((0,r.A)({},n),{},{signal:i.signal}));s.then(e=>{e.on("error",()=>{t.delete(o),i.abort()},{signal:i.signal})}).catch(()=>{}),t.set(o,a={abortController:i,dataPublisherPromise:s,numSubscribers:0})}return a.numSubscribers++,s.addEventListener("abort",()=>{a.numSubscribers--,0===a.numSubscribers&&queueMicrotask(()=>{0===a.numSubscribers&&(t.delete(o),a.abortController.abort())})},{signal:a.abortController.signal}),a.dataPublisherPromise}}(e))}function Ni(e,t){return function(e){return li({api:vi(ki),transport:e})}(Oi({createChannel:Ci((0,r.A)((0,r.A)({},t),{},{url:e}))}))}function Ri(e,t){return Ni(e,t)}var Mi=n(77654),Ui=n(60522),Li=n(14674),Bi=n(82028);var Di="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";new Uint8Array([250,166,180,250,13,12,184,70]);new Uint8Array([121,113,108,39,54,51,0,4]);new Uint8Array([152,32,222,176,223,237,116,134]);new Uint8Array([210,225,30,162,88,184,77,141]);new Uint8Array([234,18,32,56,89,141,37,181]);new Uint8Array([108,37,171,143,248,30,18,110]);new Uint8Array([161,105,88,1,237,221,216,203]);
2new Uint8Array([221,233,49,45,181,202,220,200]);new Uint8Array([215,228,166,228,84,100,86,123]);Ze([We().transform(e=>e.replace(/[^0-9.-]+/g,"")),qe()]).pipe(et().min(1e-4).max(999999999));var ji=$e(["abstract","abstract-testnet","base-sepolia","base","avalanche-fuji","avalanche","iotex","solana-devnet","solana","sei","sei-testnet","polygon","polygon-amoy","peaq","story","educhain","skale-base-sepolia"]),Fi=["abstract","abstract-testnet","base-sepolia","base","avalanche-fuji","avalanche","iotex","sei","sei-testnet","polygon","polygon-amoy","peaq","story","educhain","skale-base-sepolia"],zi=new Map([["abstract",2741],["abstract-testnet",11124],["base-sepolia",84532],["base",8453],["avalanche-fuji",43113],["avalanche",43114],["iotex",4689],["sei",1329],["sei-testnet",1328],["polygon",137],["polygon-amoy",80002],["peaq",3338],["story",1514],["educhain",41923],["skale-base-sepolia",324705682]]),Wi=["solana-devnet","solana"],qi=(Object.fromEntries([...Fi,...Wi].map(e=>[zi.get(e),e])),{id:324705682,name:"SKALE Base Sepolia",nativeCurrency:{name:"Credits",symbol:"CREDITS",decimals:18},rpcUrls:{default:{http:["https://base-sepolia-testnet.skalenodes.com/v1/jubilant-horrible-ancha"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia-testnet-explorer.skalenodes.com",apiUrl:"https://base-sepolia-testnet-explorer.skalenodes.com/api"}}});function Hi(e){const t=Xi(e);return(0,tt.l)({chain:t,transport:(0,nt.L)()}).extend(rt.$)}function Vi(){return Hi("base-sepolia")}function Gi(){return Hi("avalanche-fuji")}function Ki(e,t){const n=Xi(e),r=(0,it.F)({chain:n,transport:(0,nt.L)(),account:Cn(t)});return es(n)?r.extend(rt.$).extend(e=>({sendTransaction:t=>nr(e,t),signTransaction:t=>Yn(e,t),deployContract:t=>er(e,t),writeContract:t=>(0,Pn.E)(Object.assign(e,{sendTransaction:t=>nr(e,t)}),t)})):r.extend(rt.$)}function Ji(e){return Ki("base-sepolia",e)}function Zi(e){return Ki("avalanche-fuji",e)}function Qi(e){return"object"===typeof e&&null!==e&&"chain"in e&&"transport"in e}function Yi(e){const t=e;return"object"===typeof e&&null!==e&&"string"===typeof t.address&&"string"===typeof t.type&&"function"===typeof t.sign&&"function"===typeof t.signMessage&&"function"===typeof t.signTypedData&&"function"===typeof t.signTransaction}function Xi(e){if(!e)throw new Error("NETWORK environment variable is not set");switch(e){case"abstract":return $t;case"abstract-testnet":return en;case"base":return rn;case"base-sepolia":return on;case"avalanche":return an;case"avalanche-fuji":return cn;case"sei":return ln;case"sei-testnet":return un;case"polygon":return dn;case"polygon-amoy":return hn;case"peaq":return pn;case"story":return fn;case"educhain":return gn;case"iotex":return mn;case"iotex-testnet":return yn;case"skale-base-sepolia":return qi;default:throw new Error("Unsupported network: ".concat(e))}}var $i=new Set([2741,11124]);function es(e){return $i.has(e.id)}function ts(e){return Zr(e?(0,Yr.xn)(e):(0,Yr.xn)("https://api.devnet.solana.com"))}function ns(e){return Zr(e?(0,Yr.rC)(e):(0,Yr.rC)("https://api.mainnet-beta.solana.com"))}function rs(e,t){if("solana-devnet"===e)return ts(t);if("solana"===e)return ns(t);throw new Error("Invalid network")}function is(e,t){if("solana-devnet"===e)return Ri((0,Yr.xn)(t?ss(t):"wss://api.devnet.solana.com"));if("solana"===e)return Ri((0,Yr.rC)(t?ss(t):"wss://api.mainnet-beta.solana.com"));throw new Error("Invalid network")}function ss(e){return e.startsWith("http")?e.replace("http","ws"):e}function os(e){if(!Wi.find(t=>t===e))throw new Error("Unsupported SVM network: ".concat(e));return rs(e)}async function as(e){const t=ir.tw.decode(e);if(64===t.length)return await(0,rr.Lt)(t);if(32===t.length)return await(0,rr.bY)(t);throw new Error("Unexpected key length: ".concat(t.length,". Expected 32 or 64 bytes."))}function cs(e){return"object"===typeof e&&null!==e&&(0,rr.Pl)(e)}s({},{authorizationPrimaryType:()=>us,authorizationTypes:()=>ls,config:()=>o,createClientAvalancheFuji:()=>Gi,createClientSepolia:()=>Vi,createConnectedClient:()=>Hi,createSigner:()=>Ki,createSignerAvalancheFuji:()=>Zi,createSignerSepolia:()=>Ji,getChainFromNetwork:()=>Xi,isAccount:()=>Yi,isSignerWallet:()=>Qi,isZkStackChain:()=>es,usdcABI:()=>a});var ls={TransferWithAuthorization:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"validAfter",type:"uint256"},{name:"validBefore",type:"uint256"},{name:"nonce",type:"bytes32"}]},us="TransferWithAuthorization";s({},{SvmAddressRegex:()=>ds});var ds=/^[1-9A-HJ-NP-Za-km-z]{32,44}$/;var hs,ps=/^0x[0-9a-fA-F]{40}$/,fs=/^0x[a-fA-F0-9]{40}|[A-Za-z0-9][A-Za-z0-9-]{0,34}[A-Za-z0-9]$/,gs=["exact"],ms=[1],ys=["insufficient_funds","invali
2d_exact_evm_payload_authorization_valid_after","invalid_exact_evm_payload_authorization_valid_before","invalid_exact_evm_payload_authorization_value","invalid_exact_evm_payload_signature","invalid_exact_evm_payload_undeployed_smart_wallet","invalid_exact_evm_payload_recipient_mismatch","invalid_exact_svm_payload_transaction","invalid_exact_svm_payload_transaction_amount_mismatch","invalid_exact_svm_payload_transaction_create_ata_instruction","invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_payee","invalid_exact_svm_payload_transaction_create_ata_instruction_incorrect_asset","invalid_exact_svm_payload_transaction_instructions","invalid_exact_svm_payload_transaction_instructions_length","invalid_exact_svm_payload_transaction_instructions_compute_limit_instruction","invalid_exact_svm_payload_transaction_instructions_compute_price_instruction","invalid_exact_svm_payload_transaction_instructions_compute_price_instruction_too_high","invalid_exact_svm_payload_transaction_instruction_not_spl_token_transfer_checked","invalid_exact_svm_payload_transaction_instruction_not_token_2022_transfer_checked","invalid_exact_svm_payload_transaction_fee_payer_included_in_instruction_accounts","invalid_exact_svm_payload_transaction_fee_payer_transferring_funds","invalid_exact_svm_payload_transaction_not_a_transfer_instruction","invalid_exact_svm_payload_transaction_receiver_ata_not_found","invalid_exact_svm_payload_transaction_sender_ata_not_found","invalid_exact_svm_payload_transaction_simulation_failed","invalid_exact_svm_payload_transaction_transfer_to_incorrect_ata","invalid_network","invalid_payload","invalid_payment_requirements","invalid_scheme","invalid_payment","payment_expired","unsupported_scheme","invalid_x402_version","invalid_transaction_state","invalid_x402_version","settle_exact_svm_block_height_exceeded","settle_exact_svm_transaction_confirmation_timed_out","unsupported_scheme","unexpected_settle_error","unexpected_verify_error"],vs=e=>Number.isInteger(Number(e))&&Number(e)>=0,ws=We().regex(ps).or(We().regex(ds)),bs=We().regex(fs).or(We().regex(ds)),As=Je({scheme:$e(gs),network:ji,maxAmountRequired:We().refine(vs),resource:We().url(),description:We(),mimeType:We(),outputSc
2hema:Ye(Ge()).optional(),payTo:ws,maxTimeoutSeconds:qe().int(),asset:bs,extra:Ye(Ge()).optional()}),_s=Je({from:We().regex(ps),to:We().regex(ps),value:We().refine(vs).refine((hs=18,e=>e.length<=hs)),validAfter:We().refine(vs),validBefore:We().refine(vs),nonce:We().regex(/^0x[0-9a-fA-F]{64}$/)}),xs=Je({signature:We().regex(/^0x[0-9a-fA-F]+$/),authorization:_s}),Es=Je({transaction:We().regex(/^[A-Za-z0-9+/]*={0,2}$/)}),ks=Je({x402Version:qe().refine(e=>ms.includes(e)),scheme:$e(gs),network:ji,payload:Ze([xs,Es])}),Ss=(Je({x402Version:qe().refine(e=>ms.includes(e)),error:$e(ys).optional(),accepts:Ke(As).optional(),payer:We().regex(fs).optional()}),$e(["GET","POST","PUT","DELETE","PATCH","OPTIONS","HEAD"])),Is=(Qe("type",[Je({type:Xe("http"),method:Ss,queryParams:Ye(We(),We()).optional(),bodyType:$e(["json","form-data","multipart-form-data","text","binary"]).optional(),bodyFields:Ye(We(),Ge()).optional(),headerFields:Ye(We(),Ge()).optional()})]),Je({resource:We(),type:$e(["http"]),x402Version:qe().refine(e=>ms.includes(e)),accepts:Ke(As),lastUpdated:Ve(),metadata:Ye(Ge()).optional()})),Ts=(Je({paymentPayload:ks,paymentRequirements:As}),Je({paymentPayload:ks,paymentRequirements:As}),Je({isValid:He(),invalidReason:$e(ys).optional(),payer:ws.optional()}),Je({success:He(),errorReason:$e(ys).optional(),payer:ws.optional(),transaction:We().regex(fs),network:ji}),Je({type:We().optional(),limit:qe().optional(),offset:qe().optional()}),Je({x402Version:qe().refine(e=>ms.includes(e)),items:Ke(Is),pagination:Je({limit:qe(),offset:qe(),total:qe()})}),Je({x402Version:qe().refine(e=>ms.includes(e)),scheme:$e(gs),network:ji,extra:Ye(Ge()).optional()}));Je({kinds:Ke(Ts)});function Cs(e){try{const t=(0,Mi.Iz)().encode(e.transaction);return(0,Ui.BX)().decode(t)}catch(t){throw console.error("error",t),new Error("invalid_exact_svm_payload_transaction")}}function Ps(e){var t,n;const r=(0,Li.fr)().decode(e.messageBytes),i=null!==(t=r.staticAccounts)&&void 0!==t?t:[],s=null!==(n=r.instructions)&&void 0!==n?n:[];for(const a of s){const e=i[a.programAddressIndex].toString();if(e===Bi.YsN.toString()||e===Di.toString()){var o;const e=null!==(o=a.accountIndices)&&void 0!==o?o:[];if(e.length>=4){const t=i[e[3]].toString();if(t)return t}}}return""}async function Os(e,t,n){const r=await Ns(e,t),i=(0,Ui.RO)(r);return await n.simulateTransaction(i,{sigVerify:!0,replaceRecentBlockhash:!1,commitment:"confirmed",encoding:"base64",accounts:void 0,innerInstructions:void 0,minContextSlot:void 0}).send()}async function Ns(e,t){if((0,rr.D7)(e)){const[n]=await e.modifyAndSignTransactions([t]);if(!n)throw new Error("transaction_signer_failed_to_return_transaction");return n}if((0,rr.Y6)(e)){const[n]=await e.signTransactions([t]);if(!n)throw new Error("transaction_signer_failed_to_return_signatures");return function(e,t){return Object.freeze((0,r.A)((0,r.A)({},e),{},{signatures:Object.freeze((0,r.A)((0,r.A)({},e.signatures),t))}))}(t,n)}throw new Error("transaction_signer_must_support_offline_signing")}s({},{createDevnetRpcClient:()=>ts,createMainnetRpcClient:()=>ns,createSignerFromBase58:()=>as,createSvmConnectedClient:()=>os,decodeTransactionFromPayload:()=>Cs,getRpcClient:()=>rs,getRpcSubscriptions:()=>is,getTokenPayerFromTransaction:()=>Ps,isSignerWallet:()=>cs,signAndSimulateTransaction:()=>Os,signTransactionWithSigner:()=>Ns});Je({paymentHeader:We(),paymentRequirements:As})},82951:(e,t,n)=>{"use strict";const r=n(66601);e.exports=d;const i=function(){function e(e){return"undefined"!==typeof e&&e}try{return"undefined"!==typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},s={mapHttpRequest:y,mapHttpResponse:y,wrapRequestSerializer:v,wrapResponseSerializer:v,wrapErrorSerializer:v,req:y,res:y,err:g,errWithCause:g};function o(e,t){return"silent"===e?1/0:t.levels.values[e]}const a=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),l={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){const n={logger:t,parent:e[c]};t[c]=n}function d(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!==typeof t.send)throw Error("pino: transmit option must have a send function");const n=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);const r=e.serializers||{},s=function(e,t){if(Array.isArray(e))return e.filter(function(e){return"!stdSerializers.err"!==e});return!0===e&&Object.keys(t)}(e.browser.serialize,r);let c=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(c=!1);const g=Object.keys(e.customLevels||{}),y=["error","fatal","warn","info","debug","trace"].concat(g);
vendor: 4,679 bytes, line 2
2"function"===typeof n&&y.forEach(function(e){n[e]=n}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const v=e.level||"info",b=Object.create(n);b.log||(b.log=w),function(e,t,n){const r={};t.forEach(e=>{r[e]=n[e]?n[e]:i[e]||i[l[e]||"log"]||w}),e[a]=r}(b,y,n),u({},b),Object.defineProperty(b,"levelVal",{get:function(){return o(this.level,this)}}),Object.defineProperty(b,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,h(this,A,b,"error"),h(this,A,b,"fatal"),h(this,A,b,"warn"),h(this,A,b,"info"),h(this,A,b,"debug"),h(this,A,b,"trace"),g.forEach(e=>{h(this,A,b,e)})}});const A={transmit:t,serialize:s,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:y,timestamp:m(e),messageKey:e.messageKey||"msg",onChild:e.onChild||w};function _(n,i,o){if(!i)throw new Error("missing bindings for child Pino");o=o||{},s&&i.serializers&&(o.serializers=i.serializers);const a=o.serializers;if(s&&a){var c=Object.assign({},r,a),l=!0===e.browser.serialize?Object.keys(c):s;delete i.serializers,p([i],l,c,this._stdErrSerialize)}function d(e){this._childLevel=1+(0|e._childLevel),this.bindings=i,c&&(this.serializers=c,this._serialize=l),t&&(this._logEvent=f([].concat(e._logEvent.bindings,i)))}d.prototype=this;const h=new d(this);return u(this,h),h.child=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return _.call(this,n,...t)},h.level=o.level||this.level,n.onChild(h),h}return b.levels=function(e){const t=e.customLevels||{},n=Object.assign({},d.levels.values,t),r=Object.assign({},d.levels.labels,function(e){const t={};return Object.keys(e).forEach(function(n){t[e[n]]=n}),t}(t));return{values:n,labels:r}}(e),b.level=v,b.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prependOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=w,b.serializers=r,b._serialize=s,b._stdErrSerialize=c,b.child=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.call(this,A,...t)},t&&(b._logEvent=f()),b}function h(e,t,n,s){if(Object.defineProperty(e,s,{value:o(e.level,n)>o(s,n)?w:n[a][s],writable:!0,enumerable:!0,configurable:!0}),e[s]===w){if(!t.transmit)return;const r=o(t.transmit.level||e.level,n);if(o(s,n)<r)return}e[s]=function(e,t,n,s){return c=e[a][s],function(){const a=t.timestamp(),l=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var d=0;d<l.length;d++)l[d]=arguments[d];var h=!1;if(t.serialize&&(p(l,this._serialize,this.serializers,this._stdErrSerialize),h=!0),t.asObject||t.formatters?c.call(u,...function(e,t,n,i,s){const{level:o,log:a=e=>e}=s.formatters||{},c=n.slice();let l=c[0];const u={};let d=1+(0|e._childLevel);if(d<1&&(d=1),i&&(u.time=i),o){const n=o(t,e.levels.values[t]);Object.assign(u,n)}else u.level=e.levels.values[t];if(s.asObjectBindingsOnly){if(null!==l&&"object"===typeof l)for(;d--&&"object"===typeof c[0];)Object.assign(u,c.shift());return[a(u),...c]}if(null!==l&&"object"===typeof l){for(;d--&&"object"===typeof c[0];)Object.assign(u,c.shift());l=c.length?r(c.shift(),c):void 0}else"string"===typeof l&&(l=r(c.shift(),c));return void 0!==l&&(u[s.messageKey]=l),[a(u)]}(this,s,l,a,t)):c.apply(u,l),t.transmit){const r=t.transmit.level||e._level,i=o(r,n),c=o(s,n);if(c<i)return;!function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=t.send,s=t.ts,o=t.methodLevel,a=t.methodValue,c=t.val,l=e._logEvent.bindings;r||p(n,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=n.filter(function(e){return-1===l.indexOf(e)}),e._logEvent.level.label=o,e._logEvent.level.value=a,i(o,e._logEvent,c),e._logEvent=f(l)}(this,{ts:a,methodLevel:s,methodValue:c,transmitLevel:r,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:o(e._level,n)},l,h)}};var c}(e,t,n,s);const l=function(e){const t=[];e.bindings&&t.push(e.bindings);let n=e[c];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}(e);0!==l.length&&(e[s]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(l,e[s]))}function p(e,t,n,r){for(const i in e)if(r&&e[i]instanceof Error)e[i]=d.stdSerializers.err(e[i]);else if("object"===typeof e[i]&&!Array.isArray(e[i])&&t)for(const r in e[i])t.indexOf(r)>
2-1&&r in n&&(e[i][r]=n[r](e[i][r]))}function f(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const n in e)void 0===t[n]&&(t[n]=e[n]);return t}function m(e){return"function"===typeof e.timestamp?e.timestamp:!1===e.timestamp?b:A}function y(){return{}}function v(e){return e}function w(){}function b(){return!1}function A(){return Date.now()}d.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},d.stdSerializers=s,d.stdTimeFunctions=Object.assign({},{nullTime:b,epochTime:A,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=d,e.exports.pino=d},83923:(e,t,n)=>{"use strict";n.d(t,{q:()=>l});var r=n(63015),i=n(44288),s=n(38274),o=n(68337),a=n(73251),c=n(84241);function l(e,t){let{emitOnBegin:n=!1,emitMissed:l=!1,onBlockNumber:u,onError:d,poll:h,pollingInterval:p=e.pollingInterval}=t;let f;return("undefined"!==typeof h?h:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
2onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{const t=(0,a.A)(["watchBlockNumber",e.uid,n,l,p]);return(0,s.lB)(t,{onBlockNumber:u,onError:d},t=>(0,o.w)(async()=>{try{const n=await(0,i.T)(e,c.G,"getBlockNumber")({cacheTime:0});if(void 0!==f){if(n===f)return;if(n-f>1&&l)for(let e=f+1n;e<n;e++)t.onBlockNumber(e,f),f=e}(void 0===f||n>f)&&(t.onBlockNumber(n,f),f=n)}catch(r){var n;null===(n=t.onError)||void 0===n||n.call(t,r)}},{emitOnBegin:n,interval:p}))})():(()=>{const t=(0,a.A)(["watchBlockNumber",e.uid,n,l]);return(0,s.lB)(t,{onBlockNumber:u,onError:d},t=>{let n=!0,i=()=>n=!1;return(async()=>{try{const s=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:o}=await s.subscribe({params:["newHeads"],onData(e){var i;if(!n)return;const s=(0,r.uU)(null===(i=e.result)||void 0===i?void 0:i.number);t.onBlockNumber(s,f),f=s},onError(e){var n;null===(n=t.onError)||void 0===n||n.call(t,e)}});i=o,n||i()}catch(s){null===d||void 0===d||d(s)}})(),()=>i()})})()}},84090:(e,t,n)=>{"use strict";n.d(t,{v:()=>i});var r=n(52763);function i(e){let{chain:t,currentChainId:n}=e;if(!t)throw new r.jF;if(n!==t.id)throw new r.EH({chain:t,currentChainId:n})}},84241:(e,t,n)=>{"use strict";n.d(t,{G:()=>a});const r=new Map,i=new Map;async function s(e,t){let{cacheKey:n,cacheTime:s=Number.POSITIVE_INFINITY}=t;const o=function(e){const t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:n=>t.set(e,n)}),n=t(e,r),s=t(e,i);return{clear:()=>{n.clear(),s.clear()},promise:n,response:s}}(n),a=o.response.get();if(a&&s>0){if(Date.now()-a.created.getTime()<s)return a.data}let c=o.promise.get();c||(c=e(),o.promise.set(c));try{const e=await c;return o.response.set({created:new Date,data:e}),e}finally{o.promise.clear()}}const o=e=>"blockNumber.".concat(e);async function a(e){let{cacheTime:t=e.cacheTime}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await s(()=>e.request({method:"eth_blockNumber"}),{cacheKey:o(e.uid),cacheTime:t});return BigInt(n)}},85847:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>o,ft:()=>a,uj:()=>l});var r=n(15882),i=n(51659);const s=["address"];class o extends i.C{constructor(e){let{address:t}=e;super('State for account "'.concat(t,'" is set multiple times.'),{name:"AccountStateConflictError"})}}class a extends i.C{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function c(e){return e.reduce((e,t)=>{let{slot:n,value:r}=t;return"".concat(e," ").concat(n,": ").concat(r,"\n")},"")}function l(e){return e.reduce((e,t)=>{let{address:n}=t,i=(0,r.A)(t,s),o="".concat(e," ").concat(n,":\n");return i.nonce&&(o+=" nonce: ".concat(i.nonce,"\n")),i.balance&&(o+=" balance: ".concat(i.balance,"\n")),i.code&&(o+=" code: ".concat(i.code,"\n")),i.state&&(o+=" state:\n",o+=c(i.state)),i.stateDiff&&(o+=" stateDiff:\n",o+=c(i.stateDiff)),o}," State Override:\n").slice(0,-1)}},86483:(e,t,n)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(29077)},86639:(e,t,n)=>{"use strict";function r(e){var t,n,r,s=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new i(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function i(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return i=function(e){this.s=e,this.n=e.next},i.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return void 0===n?Promise.reject(e):t(n.apply(this.s,arguments))}},new i(e)}n.d(t,{A:()=>r})},86658:(e,t,n)=>{"use strict";n.d(t,{J:()=>
2o});var r=n(24107),i=n(38203);function s(e){return{address:e.address,amount:i.oB(e.amount),index:i.oB(e.index),validatorIndex:i.oB(e.validatorIndex)}}function o(e){return(0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)({},"bigint"===typeof e.baseFeePerGas&&{baseFeePerGas:i.oB(e.baseFeePerGas)}),"bigint"===typeof e.blobBaseFee&&{blobBaseFee:i.oB(e.blobBaseFee)}),"string"===typeof e.feeRecipient&&{feeRecipient:e.feeRecipient}),"bigint"===typeof e.gasLimit&&{gasLimit:i.oB(e.gasLimit)}),"bigint"===typeof e.number&&{number:i.oB(e.number)}),"bigint"===typeof e.prevRandao&&{prevRandao:i.oB(e.prevRandao)}),"bigint"===typeof e.time&&{time:i.oB(e.time)}),e.withdrawals&&{withdrawals:e.withdrawals.map(s)})}},86954:(e,t,n)=>{"use strict";n.d(t,{D7:()=>a,Lt:()=>p,Pl:()=>u,Y6:()=>c,bY:()=>f,pt:()=>d});var r=n(24107),i=n(5708),s=n(34182),o=n(60522);function a(e){return"modifyAndSignTransactions"in e&&"function"===typeof e.modifyAndSignTransactions}function c(e){return"signTransactions"in e&&"function"===typeof e.signTransactions}function l(e){return"signAndSendTransactions"in e&&"function"===typeof e.signAndSendTransactions}function u(e){return c(e)||a(e)||l(e)}function d(e,t){Object.freeze(e);const n=(0,r.A)((0,r.A)({},t),{},{feePayer:e});return Object.freeze(n),n}async function h(e){const t=await(0,i.Tq)(e.publicKey),n={address:t,keyPair:e,signMessages:n=>Promise.all(n.map(async n=>Object.freeze({[t]:await(0,s.b_)(e.privateKey,n.content)}))),signTransactions:n=>Promise.all(n.map(async n=>{const r=await(0,o.iW)([e],n);return Object.freeze({[t]:r.signatures[t]})}))};return Object.freeze(n)}async function p(e,t){return await h(await(0,s.RL)(e,t))}async function f(e,t){return await h(await(0,s.Hx)(e,t))}globalThis.TextEncoder},87034:(e,t,n)=>{"use strict";n.d(t,{L:()=>r});const r={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}}},87139:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});class r extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}}},87247:(e,t,n)=>{"use strict";n.d(t,{Sl:()=>i,X:()=>o,eV:()=>a,kK:()=>s});var r=n(38203);function i(e,t){if(r.Ej(e)>t)throw new r.u({givenSize:r.Ej(e),maxSize:t})}function s(e,t){if("number"===typeof t&&t>0&&t>r.Ej(e)-1)throw new r.ii({offset:t,position:"start",size:r.Ej(e)})}function o(e,t,n){if("number"===typeof t&&"number"===typeof n&&r.Ej(e)!==n-t)throw new r.ii({offset:n,position:"end",size:r.Ej(e)})}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{dir:n,size:i=32}=t;if(0===i)return e;const s=e.replace("0x","");if(s.length>2*i)throw new r.Fl({size:Math.ceil(s.length/2),targetSize:i,type:"Hex"});return"0x".concat(s["right"===n?"padEnd":"padStart"](2*i,"0"))}},87315:(e,t,n)=>{"use strict";n.d(t,{C:()=>a});var r=n(24107),i=n(25741),s=n(3717),o=n(17236);async function a(e,t){const{account:n=e.account,domain:a,message:c,primaryType:l}=t;if(!n)throw new s.T({docsPath:"/docs/actions/wallet/signTypedData"});const u=(0,i.J)(n),d=(0,r.A)({EIP712Domain:(0,o.H4)({domain:a})},t.types);if((0,o.$$)({domain:a,message:c,primaryType:l,types:d}),u.signTypedData)return u.signTypedData({domain:a,message:c,primaryType:l,types:d});const h=(0,o.v8)({domain:a,message:c,primaryType:l,types:d});return e.request({method:"eth_signTypedData_v4",params:[u.address,h]},{retryCount:0})}},87999:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(29476),i=n(43302);function s(){s=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,s){var o=RegExp(e,r);return t.set(o,s||t.get(e)),(0,i.A)(o,n.prototype)}function o(e,n){var r=t.get(n);return Object.keys(r).reduce(function(t,n){var i=r[n];if("number"==typeof i)t[n]=e[i];else{for(var s=0;void 0===e[i[s]]&&s+1<i.length;)s++;t[n]=e[i[s]]}return t},Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,i.A)(e,t)}(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=o(n,this);var r=n.indices;r&&(r.groups=o(r,this))}return n}
vendor: 7,031 bytes, line 2
2,n.prototype[Symbol.replace]=function(n,i){if("string"==typeof i){var s=t.get(this);return e[Symbol.replace].call(this,n,i.replace(/\$<([^>]+)(>|$)/g,function(e,t,n){if(""===n)return e;var r=s[t];return Array.isArray(r)?"$"+r.join("$"):"number"==typeof r?"$"+r:""}))}if("function"==typeof i){var a=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return"object"!=(0,r.A)(e[e.length-1])&&(e=[].slice.call(e)).push(o(e,a)),i.apply(this,e)})}return e[Symbol.replace].call(this,n,i)},s.apply(this,arguments)}},88404:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>o});var i=/^\s+/,s=/\s+$/;function o(e,t){if(t=t||{},(e=e||"")instanceof o)return e;if(!(this instanceof o))return new o(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,o=null,a=null,c=null,l=!1,u=!1;"string"==typeof e&&(e=function(e){e=e.replace(i,"").replace(s,"").toLowerCase();var t,n=!1;if(x[e])e=x[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=R.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=R.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=R.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=R.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=R.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=R.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=R.hex8.exec(e))return{r:T(t[1]),g:T(t[2]),b:T(t[3]),a:N(t[4]),format:n?"name":"hex8"};if(t=R.hex6.exec(e))return{r:T(t[1]),g:T(t[2]),b:T(t[3]),format:n?"name":"hex"};if(t=R.hex4.exec(e))return{r:T(t[1]+""+t[1]),g:T(t[2]+""+t[2]),b:T(t[3]+""+t[3]),a:N(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=R.hex3.exec(e))return{r:T(t[1]+""+t[1]),g:T(t[2]+""+t[2]),b:T(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==r(e)&&(M(e.r)&&M(e.g)&&M(e.b)?(t=function(e,t,n){return{r:255*S(e,255),g:255*S(t,255),b:255*S(n,255)}}(e.r,e.g,e.b),l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):M(e.h)&&M(e.s)&&M(e.v)?(o=P(e.s),a=P(e.v),t=function(e,t,n){e=6*S(e,360),t=S(t,100),n=S(n,100);var r=Math.floor(e),i=e-r,s=n*(1-t),o=n*(1-i*t),a=n*(1-(1-i)*t),c=r%6,l=[n,o,s,s,a,n][c],u=[a,n,n,o,s,s][c],d=[s,s,a,n,n,o][c];return{r:255*l,g:255*u,b:255*d}}(e.h,o,a),l=!0,u="hsv"):M(e.h)&&M(e.s)&&M(e.l)&&(o=P(e.s),c=P(e.l),t=function(e,t,n){var r,i,s;function o(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=S(e,360),t=S(t,100),n=S(n,100),0===t)r=i=s=n;else{var a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=o(c,a,e+1/3),i=o(c,a,e),s=o(c,a,e-1/3)}return{r:255*r,g:255*i,b:255*s}}(e.h,o,c),l=!0,u="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=k(n),{ok:l,format:e.format||u,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function a(e,t,n){e=S(e,255),t=S(t,255),n=S(n,255);var r,i,s=Math.max(e,t,n),o=Math.min(e,t,n),a=(s+o)/2;if(s==o)r=i=0;else{var c=s-o;switch(i=a>.5?c/(2-s-o):c/(s+o),s){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return{h:r,s:i,l:a}}function c(e,t,n){e=S(e,255),t=S(t,255),n=S(n,255);var r,i,s=Math.max(e,t,n),o=Math.min(e,t,n),a=s,c=s-o;if(i=0===s?0:c/s,s==o)r=0;else{switch(s){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return{h:r,s:i,v:a}}function l(e,t,n,r){var i=[C(Math.round(e).toString(16)),C(Math.round(t).toString(16)),C(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function u(e,t,n,r){return[C(O(r)),C(Math.round(e).toString(16)),C(Math.round(t).toString(16)),C(Math.round(n).toString(16))].join("")}function d(e,t){t=0===t?0:t||10;var n=o(e).toHsl();return n.s-=t/100,n.s=I(n.s),o(n)}function h(e,t){t=0===t?0:t||10;var n=o(e).toHsl();return n.s+=t/100,n.s=I(n.s),o(n)}function p(e){return o(e).desaturate(100)}function f(e,t){t=0===t?0:t||10;var n=o(e).toHsl();return n.l+=t/100,n.l=I(n.l),o(n)}function g(e,t){t=0===t?0:t||10;var n=o(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),o(n)}function m(e,t){t=0===t?0:t||10;var n=o(e).toHsl();return n.l-=t/100,n.l=I(n.l),o(n)}function y(e,t){var n=o(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,o(n)}function v(e){var t=o(e).toHsl();return t.h=(t.h+180)%360,o(t)}function w(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=o(e).toHsl(),r=[o(e)],i=360/t,s=1;s<t;s++)r.push(o({h:(n.h+s*i)%360,s:n.s,l:n.l}));return r}function b(e){var t=o(e).toHsl(),n=t.h;return[o(e),o({h:(n+72)%360,s:t.s,l:t.l}),o({h:(n+216)%360,s:t.s,l:t.l})]}function A(e,t,n){t=t||6,n=n||30;var r=o(e).toHsl(),i=360/n,s=[o(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,s.push(o(r));return s}function _(e,t){t=t||6;for(var n=o(e).toHsv(),r=n.h,i=n.s,s=n.v,a=[],c=1/t;t--;)a.push(o({h:r,s:i,v:s})),s=(s+c)%1;return a}o.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=k(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=c(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=c(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=a(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=a(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return l(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var s=[C(Math.round(e).toString(16)),C(Math.round(t).toString(16)),C(Math.round(n).toString(16)),C(O
vendor: 4,300 bytes, line 2
2(r))];if(i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1))return s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0);return s.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*S(this._r,255))+"%",g:Math.round(100*S(this._g,255))+"%",b:Math.round(100*S(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%)":"rgba("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[l(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+u(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=o(e);n="#"+u(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return o(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(p,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(v,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(b,arguments)},triad:function(){return this._applyCombination(w,[3])},tetrad:function(){return this._applyCombination(w,[4])}},o.fromRatio=function(e,t){if("object"==r(e)){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]="a"===i?e[i]:P(e[i]));e=n}return o(e,t)},o.equals=function(e,t){return!(!e||!t)&&o(e).toRgbString()==o(t).toRgbString()},o.random=function(){return o.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},o.mix=function(e,t,n){n=0===n?0:n||50;var r=o(e).toRgb(),i=o(t).toRgb(),s=n/100;return o({r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a})},o.readability=function(e,t){var n=o(e),r=o(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},o.isReadable=function(e,t,n){var r,i,s=o.readability(e,t);switch(i=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=s>=4.5;break;case"AAlarge":i=s>=3;break;case"AAAsmall":i=s>=7}return i},o.mostReadable=function(e,t,n){var r,i,s,a,c=null,l=0;i=(n=n||{}).includeFallbackColors,s=n.level,a=n.size;
vendor: 1,583 bytes, line 2
2for(var u=0;u<t.length;u++)(r=o.readability(e,t[u]))>l&&(l=r,c=o(t[u]));return o.isReadable(e,c,{level:s,size:a})||!i?c:(n.includeFallbackColors=!1,o.mostReadable(e,["#fff","#000"],n))};var x=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
20",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=o.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(x);function k(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function S(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function I(e){return Math.min(1,Math.max(0,e))}function T(e){return parseInt(e,16)}function C(e){return 1==e.length?"0"+e:""+e}function P(e){return e<=1&&(e=100*e+"%"),e}function O(e){return Math.round(255*parseFloat(e)).toString(16)}function N(e){return T(e)/255}var R=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"
2+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function M(e){return!!R.CSS_UNIT.exec(e)}},89225:(e,t,n)=>{"use strict";n.d(t,{xW:()=>w,sH:()=>Je,dI:()=>Ze});var r={};n.r(r),n.d(r,{identity:()=>N});var i={};n.r(i),n.d(i,{base2:()=>R});var s={};n.r(s),n.d(s,{base8:()=>M});var o={};n.r(o),n.d(o,{base10:()=>U});var a={};n.r(a),n.d(a,{base16:()=>L,base16upper:()=>B});var c={};n.r(c),n.d(c,{base32:()=>D,base32hex:()=>W,base32hexpad:()=>H,base32hexpadupper:()=>V,base32hexupper:()=>q,base32pad:()=>F,base32padupper:()=>z,base32upper:()=>j,base32z:()=>G});var l={};n.r(l),n.d(l,{base36:()=>K,base36upper:()=>J});var u={};n.r(u),n.d(u,{base58btc:()=>Z,base58flickr:()=>Q});var d={};n.r(d),n.d(d,{base64:()=>Y,base64pad:()=>X,base64url:()=>$,base64urlpad:()=>ee});var h={};n.r(h),n.d(h,{base256emoji:()=>ie});var p={};n.r(p),n.d(p,{sha256:()=>Ce,sha512:()=>Pe});var f={};n.r(f),n.d(f,{identity:()=>Ne});var g={};n.r(g),n.d(g,{code:()=>Me,decode:()=>Le,encode:()=>Ue,name:()=>Re});var m={};function y(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function v(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?y(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function w(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));const n=v(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return y(n)}n.r(m),n.d(m,{code:()=>Fe,decode:()=>We,encode:()=>ze,name:()=>je});var b=n(24107);var A=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(255!==n[o])throw new TypeError(s+" is ambiguous");n[o]=i}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(e){if("string"!==typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var r=0,i=0;e[t]===c;)r++,t++;for(var s=(e.length-t)*l+1>>>0,o=new Uint8Array(s);e[t];){var u=n[e.charCodeAt(t)];if(255===u)return;for(var d=0,h=s-1;(0!==u||d<i)&&-1!==h;h--,d++)u+=a*o[h]>>>0,o[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var p=s-i;p!==s&&0===o[p];)p++;for(var f=new Uint8Array(r+(s-p)),g=r;p!==s;)f[g++]=o[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,s=t.length;i!==s&&0===t[i];)i++,n++;for(var o=(s-i)*u+1>>>0,l=new Uint8Array(o);i!==s;){for(var d=t[i],h=0,p=o-1;(0!==d||h<r)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");r=h,i++}for(var f=o-r;f!==o&&0===l[f];)f++;for(var g=c.repeat(n);f<o;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:d,decode:function(e){var n=d(e);if(n)return n;throw new Error("Non-".concat(t," character"))}}};const _=A,x=(new Uint8Array(0),e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")});class E{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(e));throw Error("Unknown type, must be binary type")}}class k{constructor(e,t,n){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if("string"===typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(e),", ").concat(this.name," decoder only supports input
2s prefixed with ").concat(this.prefix));return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return I(this,e)}}class S{constructor(e){this.decoders=e}or(e){return I(this,e)}decode(e){const t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(e),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}const I=(e,t)=>new S((0,b.A)((0,b.A)({},e.decoders||{[e.prefix]:e}),t.decoders||{[t.prefix]:t}));class T{constructor(e,t,n,r){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=r,this.encoder=new E(e,t,n),this.decoder=new k(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const C=e=>{let{name:t,prefix:n,encode:r,decode:i}=e;return new T(t,n,r,i)},P=e=>{let{prefix:t,name:n,alphabet:r}=e;const{encode:i,decode:s}=_(r,n);return C({prefix:t,name:n,encode:i,decode:e=>x(s(e))})},O=e=>{let{name:t,prefix:n,bitsPerChar:r,alphabet:i}=e;return C({prefix:n,name:t,encode:e=>((e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let s="",o=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],o+=8;o>n;)o-=n,s+=t[i&a>>o];if(o&&(s+=t[i&a<<n-o]),r)for(;s.length*n&7;)s+="=";return s})(e,i,r),decode:e=>((e,t,n,r)=>{const i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let s=e.length;for(;"="===e[s-1];)--s;const o=new Uint8Array(s*n/8|0);let a=0,c=0,l=0;for(let u=0;u<s;++u){const t=i[e[u]];if(void 0===t)throw new SyntaxError("Non-".concat(r," character"));c=c<<n|t,a+=n,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=n||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o})(e,i,r,t)})},N=C({prefix:"\0",name:"identity",encode:e=>{return t=e,(new TextDecoder).decode(t);var t},decode:e=>(e=>(new TextEncoder).encode(e))(e)}),R=O({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),M=O({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),U=P({prefix:"9",name:"base10",alphabet:"0123456789"}),L=O({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),B=O({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),D=O({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),j=O({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),F=O({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),z=O({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),W=O({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),q=O({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),H=O({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),V=O({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),G=O({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),K=P({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),J=P({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Z=P({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Q=P({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Y=O({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),X=O({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),$=O({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ee=O({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),te=Array.from("\ud83d\ude80\ud83e\ude90\u2604\ud83d\udef0\ud83c\udf0c\ud83c\udf11\ud83c\udf12\ud83c\udf13\ud83c\udf14\ud83c\udf15\ud83c\udf16\ud83c\udf17\ud83c\udf18\ud83c\udf0d\ud83c\udf0f\ud83c\udf0e\ud83d\udc09\u2600\ud83d\udcbb\ud83d\udda5\ud83d\udcbe\ud83d\udcbf\ud83d\ude02\u2764\ud83d\ude0d\ud83e\udd23\ud83d\ude0a\ud83d\ude4f\ud83d\udc95\ud83d\ude2d\ud83d\ude18\ud83d\udc4d\ud83d\ude05\ud83d\udc4f\ud83d\ude01\ud83d\udd25\ud83e\udd70\ud83d\udc94\ud83d\udc96\ud83d\udc99\ud83d\ude22\ud83e\udd14\ud83d\ude06\ud83d\ude44\ud83d\udcaa\ud83d\ude09\u263a\ud83d\udc4c\ud83e\udd17\ud83d\udc9c\ud83d\ude14\ud83d\ude0e\ud83d\ude07\ud83c\udf39\ud83e\udd26\ud83c\udf89\ud83d\udc9e\u270c\u2728\ud83e\udd37\ud83d\ude31\ud83d\ude0c\ud83c\udf38\ud83d\ude4c\ud83d\ude0b\ud83d\udc97\ud83d\udc9a\ud83d\ude0f\ud83d\udc9b\ud83d\ude42\ud83d\udc93\ud83e\udd29\ud83d\ude04\ud83d\ude00\ud83d\udda4\ud83d\ude03\ud83d\udcaf\ud83d\ude48\ud83d\udc47\ud83c\udfb6\ud83d\ude12\ud83e\udd2d\u2763\ud83d\ude1c\ud83d\udc8b\ud83d\udc40\ud83d\ude2a\ud83d\ude11\ud83d\udca5\ud83d\ude4b\ud83d\ude1e\ud83d\ude29\ud83d\ude21\ud83e\udd2a\ud83d\udc4a\ud83e\udd73\ud83d\ude25\ud83e\udd24\ud83d\udc49\ud83d\udc83\ud83d\ude33\u270b\ud83d\ude1a\ud83d\ude1d\ud83d\ude34\ud83c\udf1f\ud83d\ude2c\ud83d\ude43\ud83c\udf40\ud83c\udf37\ud83d\ude3b\ud83d\ude13\u2b50\u2705\ud83e\udd7a\ud83c\udf08\ud83d\ude08\ud83e\udd18\ud83d\udca6\u2714\ud83d\ude23\ud83c\udfc3\ud83d\udc90\u2639\ud83c\udf8a\ud83d\udc98\ud83d\ude20\u261d\ud83d\ude15\ud83c\udf3a\ud83c\udf82\ud83c\udf3b\ud83d\ude10\ud83d\udd95\ud83d\udc9d\ud83d\ude4a\ud83d\ude39\ud83d\udde3\ud83d\udcab\ud83d\udc80\ud83d\udc51\ud83c\udfb5\ud83e\udd1e\ud83d\ude1b\ud83d\udd34\ud83d\ude24\ud83c\udf3c\ud83d\ude2b\u26bd\ud83e\udd19\u2615\ud83c\udfc6\ud83e\udd2b\ud83d\udc48\ud83d\ude2e\ud83d\ude46\ud83c\udf7b\ud83c\udf43\ud83d\udc36\ud83d\udc81\ud83d\ude32\ud83c\udf3f\ud83e\udde1\ud83c\udf81\u26a1\ud83c\udf1e\ud83c\udf88\u274c\u270a\ud83d\udc4b\ud83d\ude30\ud83e\udd28\ud83d\ude36\ud83e\udd1d\ud83d\udeb6\ud83d\udcb0\ud83c\udf53\ud83d\udca2\ud83e\udd1f\ud83d\ude41\ud83d\udea8\ud83d\udca8\ud83e\udd2c\u2708\ud83c\udf80\ud83c\udf7a\ud83e\udd13\ud83d\ude19\ud83d\udc9f\ud83c\udf31\ud83d\ude16\ud83d\udc76\ud83e\udd74\u25b6\u27a1\u2753\ud83d\udc8e\ud83d\udcb8\u2b07\ud83d\ude28\ud83c\udf1a\ud83e\udd8b\ud83d\ude37\ud83d\udd7a\u26a0\ud83d\ude45\ud83d\ude1f\ud83d\ude35\ud83d\udc4e\ud83e\udd32\ud83e\udd20\ud83e\udd27\ud83d\udccc\ud83d\udd35\ud83d\udc85\ud83e\uddd0\ud83d\udc3e\ud83c\udf52\ud83d\ude17\ud83e\udd11\ud83c\udf0a\ud83e\udd2f\ud83d\udc37\u260e\ud83d\udca7\ud83d\ude2f\ud83d\udc86\ud83d\udc46\ud83c\udfa4\ud83d\ude47\ud83c\udf51\u2744\ud83c\udf34\ud83d\udca3\ud83d\udc38\ud83d\udc8c\ud83d\udccd\ud83e\udd40\ud83e\udd22\ud83d\udc45\ud83d\udca1\ud83d\udca9\ud83d\udc50\ud83d\udcf8\ud83d\udc7b\ud83e\udd10\ud83e\udd2e\ud83c\udfbc\ud83e\udd75\ud83d\udea9\ud83c\udf4e\ud83c\udf4a\ud83d\udc7c\ud83d\udc8d\ud83d\udce3\ud83e\udd42"),ne=te.reduce((e,t,n
2)=>(e[n]=t,e),[]),re=te.reduce((e,t,n)=>(e[t.codePointAt(0)]=n,e),[]);const ie=C({prefix:"\ud83d\ude80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=ne[t],"")},decode:function(e){const t=[];for(const n of e){const e=re[n.codePointAt(0)];if(void 0===e)throw new Error("Non-base256emoji character: ".concat(n));t.push(e)}return new Uint8Array(t)}});var se=function e(t,n,r){n=n||[];var i=r=r||0;for(;t>=ce;)n[r++]=255&t|oe,t/=128;for(;t&ae;)n[r++]=255&t|oe,t>>>=7;return n[r]=0|t,e.bytes=r-i+1,n},oe=128,ae=-128,ce=Math.pow(2,31);var le=function e(t,n){var r,i=0,s=0,o=n=n||0,a=t.length;do{if(o>=a)throw e.bytes=0,new RangeError("Could not decode varint");r=t[o++],i+=s<28?(r&de)<<s:(r&de)*Math.pow(2,s),s+=7}while(r>=ue);return e.bytes=o-n,i},ue=128,de=127;var he=Math.pow(2,7),pe=Math.pow(2,14),fe=Math.pow(2,21),ge=Math.pow(2,28),me=Math.pow(2,35),ye=Math.pow(2,42),ve=Math.pow(2,49),we=Math.pow(2,56),be=Math.pow(2,63);const Ae={encode:se,decode:le,encodingLength:function(e){return e<he?1:e<pe?2:e<fe?3:e<ge?4:e<me?5:e<ye?6:e<ve?7:e<we?8:e<be?9:10}},_e=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Ae.encode(e,t,n),t},xe=e=>Ae.encodingLength(e),Ee=(e,t)=>{const n=t.byteLength,r=xe(e),i=r+xe(n),s=new Uint8Array(i+n);return _e(e,s,0),_e(n,s,r),s.set(t,i),new ke(e,n,t,s)};class ke{constructor(e,t,n,r){this.code=e,this.size=t,this.digest=n,this.bytes=r}}const Se=e=>{let{name:t,code:n,encode:r}=e;return new Ie(t,n,r)};class Ie{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Ee(this.code,t):t.then(e=>Ee(this.code,e))}throw Error("Unknown type, must be binary type")}}const Te=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Ce=Se({name:"sha2-256",code:18,encode:Te("SHA-256")}),Pe=Se({name:"sha2-512",code:19,encode:Te("SHA-512")}),Oe=x,Ne={code:0,name:"identity",encode:Oe,digest:e=>Ee(0,Oe(e))},Re="raw",Me=85,Ue=e=>x(e),Le=e=>x(e),Be=new TextEncoder,De=new TextDecoder,je="json",Fe=512,ze=e=>Be.encode(JSON.stringify(e)),We=e=>JSON.parse(De.decode(e));Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom");Symbol.for("@ipld/js-cid/CID");const qe=(0,b.A)((0,b.A)((0,b.A)((0,b.A)((0,b.A)((0,b.A)((0,b.A)((0,b.A)((0,b.A)((0,b.A)({},r),i),s),o),a),c),l),u),d),h);(0,b.A)((0,b.A)({},p),f);function He(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}const Ve=He("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>(new TextEncoder).encode(e.substring(1))),Ge=He("ascii","a",e=>{let t="a";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},e=>{const t=v((e=e.substring(1)).length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}),Ke=(0,b.A)({utf8:Ve,"utf-8":Ve,hex:qe.base16,latin1:Ge,ascii:Ge,binary:Ge},qe);function Je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const n=Ke[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode("".concat(n.prefix).concat(e)):y(globalThis.Buffer.from(e,"utf-8"))}function Ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const n=Ke[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}},89272:(e,t,n)=>{"use strict";n.d(t,{x:()=>i});var r=n(24107);function i(e){return(0,r.A)({formatters:void 0,fees:void 0,serializers:void 0},e)}},89407:(e,t,n)=>{"use strict";n.d(t,{_:()=>r});const r={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1}},89557:(e,t,n)=>{"use strict";n.d(t,{VH:()=>l,li:()=>c});var r=n(69692),i=n(77628),s=n(46455);class o extends s.H{constructor(e){super()}}const a=i.FIVE_SECONDS,c={pulse:"heartbeat_pulse"};class l extends o{constructor(e){super(e),this.events=new r.EventEmitter,this.interval=a,this.interval=(null===e||void 0===e?void 0:e.interval)||a}static async init(e){const t=new l(e);return await t.init(),t}
2async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,i.toMiliseconds)(this.interval))}pulse(){this.events.emit(c.pulse)}}},90034:(e,t,n)=>{"use strict";e.exports=n(16762)},90268:(e,t,n)=>{"use strict";n.d(t,{l:()=>c});var r=n(34406),i=n(25566),s=n(27014),o=n(60207);class a{constructor(e){var t,n,r,s,o,a,c,l;this.entered=!1,this.extensionCodec=null!==(t=null===e||void 0===e?void 0:e.extensionCodec)&&void 0!==t?t:i.g.defaultCodec,this.context=null===e||void 0===e?void 0:e.context,this.useBigInt64=null!==(n=null===e||void 0===e?void 0:e.useBigInt64)&&void 0!==n&&n,this.maxDepth=null!==(r=null===e||void 0===e?void 0:e.maxDepth)&&void 0!==r?r:100,this.initialBufferSize=null!==(s=null===e||void 0===e?void 0:e.initialBufferSize)&&void 0!==s?s:2048,this.sortKeys=null!==(o=null===e||void 0===e?void 0:e.sortKeys)&&void 0!==o&&o,this.forceFloat32=null!==(a=null===e||void 0===e?void 0:e.forceFloat32)&&void 0!==a&&a,this.ignoreUndefined=null!==(c=null===e||void 0===e?void 0:e.ignoreUndefined)&&void 0!==c&&c,this.forceIntegerToFloat=null!==(l=null===e||void 0===e?void 0:e.forceIntegerToFloat)&&void 0!==l&&l,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new a({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered){return this.clone().encodeSharedRef(e)}try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered){return this.clone().encode(e)}try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"===typeof e?this.encodeBoolean(e):"number"===typeof e?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):"string"===typeof e?this.encodeString(e):this.useBigInt64&&"bigint"===typeof e?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){const t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)}resizeBuffer(e){const t=new ArrayBuffer(e),n=new Uint8Array(t),r=new DataView(t);n.set(this.bytes),this.view=r,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){!1===e?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}}encodeString(e){const t=(0,r.dS)(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),(0,r.yi)(e,this.bytes,this.pos),this.pos+=t}encodeObject(e,t){const n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!==typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}}encodeBinary(e){const t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}const n=(0,o.C)(e);this.writeU8a(n)}encodeArray(e,t){const n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(const r of e)this.doEncode(r,t+1)}countWithoutUndefined(e,t){let n=0;for(const r of t)void 0!==e[r]&&n++;return n}encodeMap(e,t){const n=Object.keys(e);this.sortKeys&&n.sort();const r=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(r<16)this.writeU8(128+r);else if(r<65536)this.writeU8(222),this.writeU16(r);else{if(!(r<4294967296))throw new Error("Too large map object: ".concat(r));this.writeU8(223),this.writeU32(r)}for(const i of n){const n=e[i];this.ignoreUndefined&&void 0===n||(this.encodeString(i),this.doEncode(n,t+1))}}encodeExtension(e){if("function"===typeof e.data){const t=e.data(this.pos+6),n=t.length;if(n>=4294967296)throw new Error("Too large extension object: ".concat(n));return this.writeU8(201),this.writeU32(n),this.writeI8(e.type),void this.writeU8a(t)}const t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: ".concat(t));this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),(0,s.X3)(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),(0,s._j)(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function c(e,t){return new a(t).encodeSharedRef(e)}},90934:(e,t,n)=>{"use strict";n.d(t,{n:()=>w});var r=n(24107),i=n(18656),s=n(10133),o=n(32326),a=n(1490),c=n(14061),l=n(65747),u=n(14393),d=n(63015),h=n(652);function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"undefined"!==typeof t.size&&(0,d.Sl)(e,{size:t.size});const n=(0,h.My)(e,t);return(0,d.uU)(n,t)}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;if("undefined"!==typeof t.size&&((0,d.Sl)(n,{size:t.size}),n=(0,l.B)(n)),n.length>1||n[0]>1)throw new u.xO(n);return Boolean(n[0])}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"undefined"!==typeof t.size&&(0,d.Sl)(e,{size:t.size});const n=(0,h.My)(e,t);return(0,d.ME)(n,t)}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;return"undefined"!==typeof t.size&&((0,d.Sl)(n,{size:t.size}),n=(0,l.B)(n,{dir:"right"})),(new TextDecoder).decode(n)}var y=n(91638),v=n(70759);function w(e,t){const n="string"===typeof t?(0,y.aT)(t):t,r=(0,o.l)(n);if(0===(0,a.E)(n)&&e.length>0)throw new i.O;if((0,a.E)(t)&&(0,a.E)(t)<32)throw new i.Iy({data:"string"===typeof t?t:(0,h.My)(t),params:e,size:(0,a.E)(t)});let s=0;const c=[];for(let i=0;i<e.length;++i){const t=e[i];r.setPosition(s);const[n,o]=b(r,t,{staticPosition:0});s+=o,c.push(n)}return c}function b(e,t,n){let{staticPosition:o}=n;const a=(0,v.k)(t.type);if(a){const[n,i]=a;return function(e,t,n){let{length:r,staticPosition:i}=n;if(!r){const n=i+g(e.readBytes(_)),r=n+A;e.setPosition(n);const s=g(e.readBytes(A)),o=x(t);let a=0;const c=[];for(let i=0;i<s;++i){e.setPosition(r+(o?32*i:a));const[n,s]=b(e,t,{staticPosition:r});a+=s,c.push(n)}return e.setPosition(i+32),[c,32]}if(x(t)){const n=i+g(e.readBytes(_)),s=[];for(let i=0;i<r;++i){e.setPosition(n+32*i);const[r]=b(e,t,{staticPosition:n});s.push(r)}return e.setPosition(i+32),[s,32]}let s=0;const o=[];for(let a=0;a<r;++a){const[n,r]=b(e,t,{staticPosition:i+s});s+=r,o.push(n)}return[o,s]}(e,(0,r.A)((0,r.A)({},t),{},{type:i}),{length:n,staticPosition:o})}if("tuple"===t.type)return function(e,t,n){let{staticPosition:r}=n;const i=0===t.components.length||t.components.some(e=>{let{name:t}=e;return!t}),s=i?[]:{};let o=0;if(x(t)){const n=r+g(e.readBytes(_));for(let r=0;r<t.components.length;++r){const a=t.components[r];e.setPosition(n+o);const[c,l]=b(e,a,{staticPosition:n});o+=l,s[i?r:null===a||void 0===a?void 0:a.name]=c}return e.setPosition(r+32),[s,32]}for(let a=0;a<t.components.length;++a){const n=t.components[a],[c,l]=b(e,n,{staticPosition:r});s[i?a:null===n||void 0===n?void 0:n.name]=c,o+=l}return[s,o]}(e,t,{staticPosition:o});if("address"===t.type)return function(e){const t=e.readBytes(32);return[(0,s.o)((0,h.My)((0,c.A1)(t,-20))),32]}(e);if("bool"===t.type)return function(e){return[f(e.readBytes(32),{size:32}),32]}(e);if(t.type.startsWith("bytes"))return function(e,t,n){let{staticPosition:r}=n;const[i,s]=t.type.split("bytes");if(!s){const t=g(e.readBytes(32));e.setPosition(r+t);const n=g(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];const i=e.readBytes(n);return e.setPosition(r+32),[(0,h.My)(i),32]}const o=(0,h.My)(e.readBytes(Number.parseInt(s,10),32));return[o,32]}(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return function(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),i=e.readBytes(32);return[r>48?p(i,{signed:n}):g(i,{signed:n}),32]}(e,t);if("string"===t.type)return function(e,t){let{staticPosition:n}=t;const r=g(e.readBytes(32)),i=n+r;e.setPosition(i);const s=g(e.readBytes(32));if(0===s)return e.setPosition(n+32),["",32];const o=e.readBytes(s,32),a=m((0,l.B)(o));return e.setPosition(n+32),[a,32]}(e,{staticPosition:o});throw new i.j(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const A=32,_=32;function x(e){var t;const{type:n}=e;if("string"===n)return!0;
2if("bytes"===n)return!0;if(n.endsWith("[]"))return!0;if("tuple"===n)return null===(t=e.components)||void 0===t?void 0:t.some(x);const i=(0,v.k)(e.type);return!(!i||!x((0,r.A)((0,r.A)({},e),{},{type:i[1]})))}},91376:(e,t,n)=>{"use strict";n.d(t,{o0:()=>p});var r=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},i=function(e,t,n){this.name=e,this.version=t,this.os=n,this.type="browser"},s=function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform},o=function(e,t,n,r){this.name=e,this.version=t,this.os=n,this.bot=r,this.type="bot-device"},a=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},c=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},l=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,u=3,d=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],h=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function p(e){return e?g(e):"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product?new c:"undefined"!==typeof navigator?g(navigator.userAgent):"undefined"!==typeof process&&process.version?new s(process.version.slice(1)):null}function f(e){return""!==e&&d.reduce(function(t,n){var r=n[0],i=n[1];if(t)return t;var s=i.exec(e);return!!s&&[r,s]},!1)}function g(e){var t=f(e);if(!t)return null;var n=t[0],s=t[1];if("searchbot"===n)return new a;var c=s[1]&&s[1].split(".").join("_").split("_").slice(0,3);c?c.length<u&&(c=r(r([],c,!0),function(e){for(var t=[],n=0;n<e;n++)t.push("0");return t}(u-c.length),!0)):c=[];var d=c.join("."),p=function(e){for(var t=0,n=h.length;t<n;t++){var r=h[t],i=r[0];if(r[1].exec(e))return i}return null}(e),g=l.exec(e);return g&&g[1]?new o(n,d,p,g[1]):new i(n,d,p)}}
2,91638:(e,t,n)=>{"use strict";n.d(t,{Af:()=>p,ZJ:()=>l,aT:()=>h});var r=n(51659),i=n(6806),s=n(61398),o=n(63015),a=n(652);const c=new TextEncoder;function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"number"===typeof e||"bigint"===typeof e?function(e,t){const n=(0,a.cK)(e,t);return h(n)}(e,t):"boolean"===typeof e?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new Uint8Array(1);if(n[0]=Number(e),"number"===typeof t.size)return(0,o.Sl)(n,{size:t.size}),(0,s.eV)(n,{size:t.size});return n}(e,t):(0,i.q)(e)?h(e,t):p(e,t)}const u={zero:48,nine:57,A:65,F:70,a:97,f:102};function d(e){return e>=u.zero&&e<=u.nine?e-u.zero:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;t.size&&((0,o.Sl)(n,{size:t.size}),n=(0,s.eV)(n,{dir:"right",size:t.size}));let i=n.slice(2);i.length%2&&(i="0".concat(i));const a=i.length/2,c=new Uint8Array(a);for(let s=0,o=0;s<a;s++){const e=d(i.charCodeAt(o++)),t=d(i.charCodeAt(o++));if(void 0===e||void 0===t)throw new r.C('Invalid byte sequence ("'.concat(i[o-2]).concat(i[o-1],'" in "').concat(i,'").'));c[s]=16*e+t}return c}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=c.encode(e);return"number"===typeof t.size?((0,o.Sl)(n,{size:t.size}),(0,s.eV)(n,{dir:"right",size:t.size})):n}},91866:(e,t,n)=>{"use strict";n.d(t,{D:()=>h,Q:()=>l});var r=n(24107),i=n(95886),s=n(87139),o=n(64284),a=Object.defineProperty,c=(e,t,n)=>(((e,t,n)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),l=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(l||{});let u={0(e,t){let n=t.id,i=e.stack,s=e.stack.indexOf(n);if(-1!==s){let t=e.stack.slice();return t.splice(s,1),t.push(n),i=t,(0,r.A)((0,r.A)({},e),{},{stack:i})}return(0,r.A)((0,r.A)({},e),{},{stack:[...e.stack,n]})},1(e,t){let n=t.id,i=e.stack.indexOf(n);if(-1===i)return e;let s=e.stack.slice();return s.splice(i,1),(0,r.A)((0,r.A)({},e),{},{stack:s})}};class d extends i.u5{constructor(){super(...arguments),c(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),c(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new d({stack:[]})}reduce(e,t){return(0,o.Y)(t.type,u,e,t)}}const h=new s.G(()=>d.new())},92030:(e,t,n)=>{"use strict";function r(e){if(null==e)throw new TypeError("Cannot destructure "+e)}n.d(t,{A:()=>r})},92146:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});const r="#__bigint";function i(e,t,n){return JSON.stringify(e,(e,n)=>"function"===typeof t?t(e,n):"bigint"===typeof n?n.toString()+r:n,n)}},92674:(e,t,n)=>{"use strict";n.d(t,{j:()=>l});var r=n(18656),i=n(51659),s=n(82281),o=n(65015),a=n(41661);const c=3;function l(e,t){let{abi:n,address:l,args:u,docsPath:d,functionName:h,sender:p}=t;const f=e instanceof s.$S?e:e instanceof i.C?e.walk(e=>"data"in e)||e.walk():{},{code:g,data:m,details:y,message:v,shortMessage:w}=f,b=e instanceof r.O?new s.rR({functionName:h}):[c,a.bq.code].includes(g)&&(m||y||v||w)||g===a.Di.code&&"execution reverted"===y&&m?new s.M({abi:n,data:"object"===typeof m?m.data:m,functionName:h,message:f instanceof o.J8?y:null!==w&&void 0!==w?w:v}):e;return new s.bG(b,{abi:n,args:u,contractAddress:l,docsPath:d,functionName:h,sender:p})}},93116:(e,t,n)=>{"use strict";n.d(t,{v:()=>i});var r=n(15548);async function i(e,t){let{request:n}=t;return await e.fetchPrivyRoute(r.GK,{body:n})}},93341:(e,t,n)=>{"use strict";n.d(t,{s:()=>o});var r=n(41226),i=n(96550),s=n(652);async function o(e,t){var n;let{serializedTransaction:o,throwOnReceiptRevert:a,timeout:c}=t;const l=await e.request({method:"eth_sendRawTransactionSync",params:c?[o,(0,s.cK)(c)]:[o]},{retryCount:0}),u=((null===(n=e.chain)||void 0===n||null===(n=n.formatters)||void 0===n||null===(n=n.transactionReceipt)||void 0===n?void 0:n.format)||i.uL)(l);if("reverted"===u.status&&a)throw new r.Sq({receipt:u});return u}},93374:(e,t,n)=>{"use strict";
2Object.defineProperty(t,"__esModule",{value:!0});const r=n(1598);r.__exportStar(n(54113),t),r.__exportStar(n(79221),t)},93401:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var r=n(23422),i=n(27133);function s(e,t){if(!(0,i.P)(e,{strict:!1}))throw new r.M({address:e});if(!(0,i.P)(t,{strict:!1}))throw new r.M({address:t});return e.toLowerCase()===t.toLowerCase()}},93520:(e,t,n)=>{"use strict";n.d(t,{J:()=>d});var r=n(24107),i=n(15882),s=n(15208),o=n(76416),a=n(92674),c=n(44288),l=n(36122);const u=["abi","address","args","functionName"];async function d(e,t){const{abi:n,address:d,args:h,functionName:p}=t,f=(0,i.A)(t,u),g=(0,o.p)({abi:n,args:h,functionName:p});try{const{data:t}=await(0,c.T)(e,l.T,"call")((0,r.A)((0,r.A)({},f),{},{data:g,to:d}));return(0,s.e)({abi:n,args:h,functionName:p,data:t||"0x"})}catch(m){throw(0,a.j)(m,{abi:n,address:d,args:h,docsPath:"/docs/contract/readContract",functionName:p})}}},93551:(e,t,n)=>{"use strict";n.d(t,{x:()=>l});var r=n(29668),i=n(6806),s=n(1490),o=n(63015),a=n(652);function c(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw new Error("Invalid yParityOrV value")}async function l(e){let{hash:t,signature:l}=e;return(0,r.M)(await async function(e){let{hash:t,signature:r}=e;const l=(0,i.q)(t)?t:(0,a.nj)(t),{secp256k1:u}=await Promise.resolve().then(n.bind(n,7856)),d=(()=>{if("object"===typeof r&&"r"in r&&"s"in r){const{r:e,s:t,v:n,yParity:i}=r,s=c(Number(null!==i&&void 0!==i?i:n));return new u.Signature((0,o.uU)(e),(0,o.uU)(t)).addRecoveryBit(s)}const e=(0,i.q)(r)?r:(0,a.nj)(r);if(65!==(0,s.E)(e))throw new Error("invalid signature length");const t=c((0,o.ME)("0x".concat(e.slice(130))));return u.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(t)})().recoverPublicKey(l.substring(2)).toHex(!1);return"0x".concat(d)}({hash:t,signature:l}))}},94718:(e,t,n)=>{"use strict";n.d(t,{RR:()=>a,pw:()=>o,sM:()=>s});var r=n(10802),i=n(51659);class s extends i.C{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class o extends i.C{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class a extends i.C{constructor(e){let{maxPriorityFeePerGas:t}=e;super("`maxFeePerGas` cannot be less than the `maxPriorityFeePerGas` (".concat((0,r.Q)(t)," gwei)."),{name:"MaxFeePerGasTooLowError"})}}},95469:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;t.IWatch=class{}},95554:(e,t,n)=>{"use strict";n.d(t,{TW:()=>i,X7:()=>a,bq:()=>o,zm:()=>s});var r=n(39898);function i(e){var t;return r._.isServer?null:null==e?document:null!=(t=null==e?void 0:e.ownerDocument)?t:document}function s(e){var t,n;return r._.isServer?null:null==e?document:null!=(n=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))?n:document}function o(e){var t,n;return null!=(n=null==(t=s(e))?void 0:t.activeElement)?n:null}function a(e){return o(e)===e}},95886:(e,t,n)=>{"use strict";n.d(t,{bN:()=>m,u5:()=>g,vA:()=>w});var r,i,s,o=n(87139),a=n(42922),c=n(39898),l=Object.defineProperty,u=(e,t,n)=>(((e,t,n)=>{t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),d=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},h=(e,t,n)=>(d(e,t,"read from private field"),n?n.call(e):t.get(e)),p=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},f=(e,t,n,r)=>(d(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class g{constructor(e){p(this,r,{}),p(this,i,new o.G(()=>new Set)),p(this,s,new Set),u(this,"disposables",(0,a.e)()),f(this,r,e),c._.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return h(this,r)}subscribe(e,t){if(c._.isServer)return()=>{};let n={selector:e,callback:t,current:e(h(this,r))};return h(this,s).add(n),this.disposables.add(()=>{h(this,s).delete(n)})}on(e,t){return c._.isServer?()=>{}:(h(this,i).get(e).add(t),this.disposables.add(()=>{h(this,i).get(e).delete(t)}))}send(e){let t=this.reduce(h(this,r),e);if(t!==h(this,r)){f(this,r,t);for(let e of h(this,s)){let t=e.selector(h(this,r));m(e.current,t)||(e.current=t,e.callback(t))}for(let t of h(this,i).get(e.type))t(h(this,r),e)}}}function m(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&y(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&y(e.entries(),t.entries()):!(!v(e)||!v(t))&&y(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function y(e,t){for(;;){let n=e.next(),r=t.next();if(n.done&&r.done)return!0;
2if(n.done||r.done||!Object.is(n.value,r.value))return!1}}function v(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function w(e){let[t,n]=e(),r=(0,a.e)();return function(){t(...arguments),r.dispose(),r.microTask(n)}}r=new WeakMap,i=new WeakMap,s=new WeakMap},96429:e=>{e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),c=0;c<s.length;c++){var l=s[c];if(!a(l))return!1;var u=e[l],d=t[l];if(!1===(i=n?n.call(r,u,d,l):void 0)||void 0===i&&u!==d)return!1}return!0}},96550:(e,t,n)=>{"use strict";n.d(t,{Lj:()=>c,WB:()=>u,uL:()=>l});var r=n(24107),i=n(63015),s=n(38910),o=n(71226),a=n(47e3);const c={"0x0":"reverted","0x1":"success"};function l(e,t){const n=(0,r.A)((0,r.A)({},e),{},{blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>(0,o.e)(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,i.ME)(e.transactionIndex):null,status:e.status?c[e.status]:null,type:e.type?a.b4[e.type]||e.type:null});return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const u=(0,s.q)("transactionReceipt",l)},96784:(e,t,n)=>{"use strict";function r(e){return"object"===typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function i(e){return r(e)&&"method"in e}function s(e){return r(e)&&(o(e)||a(e))}function o(e){return"result"in e}function a(e){return"error"in e}n.d(t,{U$:()=>a,p3:()=>i,tq:()=>s,xT:()=>o})},97234:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1598).__exportStar(n(95469),t)},97562:(e,t,n)=>{"use strict";n.d(t,{T:()=>i});var r=n(63015);async function i(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return(0,r.ME)(t)}},97811:(e,t,n)=>{"use strict";function r(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[i,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),"".concat(r?"-":"").concat(i||"0").concat(s?".".concat(s):"")}n.d(t,{J:()=>r})},99705:(e,t,n)=>{"use strict";function r(e,t){let{format:n}=t;if(!n)return{};const r={};return function t(n){const i=Object.keys(n);for(const s of i)s in e&&(r[s]=e[s]),n[s]&&"object"===typeof n[s]&&!Array.isArray(n[s])&&t(n[s])}(n(e||{})),r}n.d(t,{o:()=>r})},99844:(e,t,n)=>{"use strict";n.d(t,{C:()=>v,D:()=>h,H:()=>O,I:()=>x,M:()=>F,O:()=>N,P:()=>_,R:()=>b,S:()=>C,V:()=>y,W:()=>D,a:()=>P,b:()=>M,c:()=>ce,d:()=>S,e:()=>T,f:()=>k,g:()=>I,h:()=>q,i:()=>w,j:()=>A,k:()=>E,l:()=>p,m:()=>
2oe,n:()=>U,o:()=>R,p:()=>B,q:()=>f,r:()=>g,s:()=>L,t:()=>m,u:()=>ae,v:()=>j,w:()=>W,x:()=>z});var r=n(15882),i=n(24107),s=n(90034),o=n(57722),a=n(32381),c=n(23231),l=n(3756),u=n(88404);const d=["appearance","supportedChains","defaultChain","externalWallets"],h="https://auth.privy.io",p=2e4,f=1400,g=2500,m=4e3,y="3.8.1",v="privy:token",w="privy-token",b="privy:refresh_token",A="privy-refresh-token",_="privy:pat",x="privy:id_token",E="privy-id-token",k="privy-session",S="privy:caid",I=e=>"privy:guest:".concat(e),T=e=>"privy:cross-app:".concat(e),C="privy:state_code",P="privy:code_verifier",O="privy:headless_oauth",N="privy:oauth_disable_signup",R=e=>"privy:wallet:".concat(e),M="privy:connections",U=12e4,L=1,B="0x1",D=3e4,j="https://api.moonpay.com/v1",F="https://api.moonpay.com/v1",z="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",W="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",q="deprecated",H={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","base_account","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let V=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","jupiter","binance","binanceus","bitget_wallet","kraken_wallet"]),G=e=>V.has(e),K=(e,t,n)=>n.indexOf(e)===t;const J=e=>{var t;let{input:n,overrides:r}=e;return r?r.primary.concat(null!==(t=r.overflow)&&void 0!==t?t:[]).filter(G).filter(K):n?n.filter(G).filter(K):H.appearance.walletList};let Z=/paymaster\.biconomy\.io\/api/i,Q={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const Y=(e,t)=>e&&Z.test(e)?Q:t&&t.policy_id?{policyId:t.policy_id}:void 0;function X(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,u.A)((0,i.A)((0,i.A)({},e.toHsl()),{},{l:n}))}function $(e,t){let n=e.getLuminance(),r=t.getLuminance();return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ee(e){let t,n,{backgroundTheme:r,accentHex:i}=e;"light"===r?t=!1:"dark"===r?t=!0:(t=.5>=(0,u.A)(r).getLuminance(),n=(0,u.A)(r).toHslString());let s=t?"dark":"light",o=t?te:ne,{accent:a,accentLight:c,accentHover:l,accentDark:d,accentDarkest:h}=function(e,t){if(!e){let e=t?te:ne;return{accent:(0,u.A)(e.background.interactive),accentLight:(0,u.A)(e.background.interactive),accentHover:(0,u.A)(e.background["interactive-hover"]),accentDark:(0,u.A)(e.background["interactive-clicked"]),accentDarkest:(0,u.A)(e.background["interactive-disabled"])}}let n=(0,u.A)(e);return{accent:n,accentLight:X(n,.15),accentHover:X(n,.3),accentDark:X(n,-.06),accentDarkest:X(n,-.6)}}(i,t),p=function(e){let t=(0,u.A)(ne.text.default),n=(0,u.A)(te.text.default),r=$(e,t),i=$(e,n),s=e.toHsl();return s.h>=220&&s.h<=300&&i>=3?te.text.default:r>i?ne.text.default:te.text.default}(a),f=(0,u.A)(p),g=$(a,(0,u.A)(o.background.default))>=3;return{colorScheme:s,background:n||o.background.default,background2:o.background.elevated,background3:o.background.interactive,foreground:o.text.default,foreground2:o.text.muted,foreground3:o.text.placeholder,foreground4:o.border.default,accent:a.toHslString(),accentLight:c.toHslString(),accentHover:l.toHslString(),accentDark:d.toHslString(),accentDarkest:h.toHslString(),foregroundAccent:f.toHslString(),success:o.background.success,successDark:o.text.success,successLight:o.background.success,error:o.text.error,errorLight:o.background.error,warn:o.background.warning,warnLight:o.background.warning,warningDark:o.text.warning,errorDark:o.text.error,successBg:o.background.success,errorBg:o.background.error,errorBgHover:o.background["error-hover"],warnBg:o.background.warning,infoBg:o.background.info,infoBgHover:o.background["info-hover"],borderDefault:o.border.default,borderHover:o.border["default-hover"],borderFocus:o.border.focused,borderError:o.border.error,borderSuccess:o.border.success,borderWarning:o.border.warning,borderInfo:o.border.info,borderInteractive:o.border.interactive,borderInteractiveHover:o.border["interactive-hover"],backgroundHover:o.background["default-hover"],backgroundClicked:o.background["default-clicked"],backgroundDisabled:o.background["default-disabled"],backgroundInteractive:o.background.interactive,backgroundInteractiveHover:o.background["interactive-hover"],backgroundInteractiveClicked:o.background["interactive-clicked"],backgroundInteractiveDisabled:o.background["interactive-disabled"],foregroundHover:o.text.default,foregroundClicked:o.text.default,foregroundDisabled:o.text["default-disabled"],foregroundInteractive:o.text.interactive,foregroundInteractiveHover:o.text["interactive-hover"],accentHasGoodContrast:g?"1":"0",linkNavigationColor:g?a.toHslString():o.text.default,linkNavigationDecoration:g?"none":"underline",iconDefault:o.icon.default,iconMuted:o.icon.muted,iconSubtle:o.icon.subtle,iconInverse:o.icon.inverse,iconSuccess:o.icon.success,iconWarning:o.icon.warning,iconError:o.icon.error,iconInteractive:o.icon.interactive,iconDefaultHover:o.icon["default-hover"],iconMutedHover:o.icon["muted-hover"],iconSubtleHover:o.icon["subtle-hover"],iconDefaultClicked:o.icon["default-clicked"],iconMutedClicked:o.icon["muted-clicked"],iconSubtleClicked:o.icon["subtle-clicked"],iconDefaultDisabled:o.icon["default-disabled"],iconMutedDisabled:o.icon["muted-disabled"],iconSubtleDisabled:o.icon["subtle-disabled"],iconErrorHover:o.icon["error-hover"],iconInteractiveHover:o.icon["interactive-hover"],iconErrorClicked:o.icon["error-clicked"],iconInteractiveClicked:o.icon["interactive-clicked"],iconMutedDisabledAlt:o.icon["muted-disabled"],iconSubtleDisabledAlt:o.icon["subtle-disabled"]}}const te={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#
2EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},ne={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}};function re(e,t,n,r,s){var o,u,d,h,p,f,g,m,y,v,w,b,A,_,x,E,k,S,I,T,C,P,O,N,R,M,U,L,B,D,j,F,z,W,q,V,G,K,Z,Q,X,$,te,ne,re,ie,se,oe,ae,ce,le,ue,de,he,pe,fe,ge,me,ye,ve,we,be,Ae,_e,xe,Ee,ke,Se,Ie,Te,Ce,Pe,Oe,Ne,Re,Me,Ue,Le,Be,De,je,Fe,ze,We,qe,He,Ve,Ge,Ke,Je;let Ze,Qe,Ye,Xe,$e,et,tt,nt,rt,it,st,ot,at,ct,lt,ut,dt,ht=n?console.warn:()=>{};null!==t&&void 0!==t&&t.loginMethods?(Ze=t.loginMethods.includes("email"),Qe=t.loginMethods.includes("sms"),Xe=t.loginMethods.includes("wallet"),$e=t.loginMethods.includes("google"),et=t.loginMethods.includes("twitter"),tt=t.loginMethods.includes("discord"),st=t.loginMethods.includes("spotify"),ot=t.loginMethods.includes("instagram"),nt=t.loginMethods.includes("tiktok"),rt=t.loginMethods.includes("line"),it=t.loginMethods.includes("twitch"),ct=t.loginMethods.includes("github"),at=t.loginMethods.includes("linkedin"),lt=t.loginMethods.includes("apple"),ut=t.loginMethods.includes("farcaster"),dt=t.loginMethods.includes("telegram"),Ye=t.loginMethods.includes("passkey")):(Ze=e.email_auth,Qe=e.sms_auth,Xe=e.wallet_auth||e.solana_wallet_auth,$e=e.google_oauth,et=e.twitter_oauth,tt=e.discord_oauth,ct=e.github_oauth,st=e.spotify_oauth,ot=e.instagram_oauth,nt=e.tiktok_oauth,rt=e.line_oauth,it=e.twitch_oauth,at=e.linkedin_oauth,lt=e.apple_oauth,ut=e.farcaster_auth,dt=e.telegram_auth,Ye=e.passkey_auth),e.passkey_auth&&(Ye=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(Ye=!1);let pt=[Ze,Qe].filter(Boolean),ft=[$e,et,tt,ct,st,ot,nt,rt,at,lt,ut,dt].filter(Boolean),gt=[Xe].filter(Boolean),mt=null!==(o=null===t||void 0===t||null===(u=t.loginMethods)||void 0===u?void 0:u.includes("passkey"))&&void 0!==o&&o,yt=null!==(d=e.passkeys_for_signup_enabled)&&void 0!==d&&d,vt=[Ye&&(yt||mt)].filter(Boolean);if(pt.length+ft.length+gt.length+vt.length===0)throw Error("You must enable at least one login method");let wt=void 0!==(null===t||void 0===t||null===(h=t.appearance)||void 0===h?void 0:h.showWalletLoginFirst)?null===t||void 0===t||null===(p=t.appearance)||void 0===p?void 0:p.showWalletLoginFirst:e.show_wallet_login_first;wt&&0===gt.length?(ht("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),wt=!1):wt||ft.length+pt.length!==0||(ht("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),wt=!0);let bt=null===(f=null===t||void 0===t||null===(g=t.externalWallets)||void 0===g||null===(g=g.walletConnect)||void 0===g?void 0:g.enabled)||void 0===f||f;(null===t||void 0===t?void 0:t.loginMethods)&&t.loginMethodsAndOrder&&ht("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let At=J({input:null===t||void 0===t||null===(m=t.appearance)||void 0===m?void 0:m.walletList,overrides:null===t||void 0===t?void 0:t.loginMethodsAndOrder});if((At.includes("wallet_connect_qr")||At.includes("wallet_connect"))&&At.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in
2walletList due to WalletConnect session conflicts.");let _t=(e=>{let{input:t}=e;if(!t||!t.primary[0])return;let n=[t.primary[0]],r=[];for(let s of(t.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),t.primary.slice(1)))n.includes(s)?console.warn("Duplicated login method: ".concat(s)):n.push(s);for(let s of null!==(i=t.overflow)&&void 0!==i?i:[]){var i;n.includes(s)||r.includes(s)?console.warn("Duplicated login method: ".concat(s)):r.push(s)}return{primary:n,overflow:r}})({input:null===t||void 0===t?void 0:t.loginMethodsAndOrder}),xt=null!==(y=null===t||void 0===t||null===(v=t.intl)||void 0===v?void 0:v.defaultCountry)&&void 0!==y?y:"US",{chains:Et,defaultChain:kt}=function(e){let t,{supportedChains:n,defaultChainFromConfig:r}=e;if(n){if(0===n.length)throw Error("`supportedChains` must contain at least one chain");t=(0,c._)(n)}else t=[...a.m];let i=n?t[0]:l.r,s=null!==r&&void 0!==r?r:i;if(!t.find(e=>e.id===s.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:t,defaultChain:s}}({supportedChains:null===t||void 0===t?void 0:t.supportedChains,defaultChainFromConfig:null===t||void 0===t?void 0:t.defaultChain}),St=!(null===t||void 0===t||!t.defaultChain),It=(null===t||void 0===t||null===(w=t.customAuth)||void 0===w?void 0:w.getCustomAccessToken)&&!1!==(null===t||void 0===t||null===(b=t.customAuth)||void 0===b?void 0:b.enabled),Tt=It?"all-users":e.embedded_wallet_config.ethereum.create_on_login,Ct=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&(null===t||void 0===t||null===(A=t.externalWallets)||void 0===A||null===(A=A.solana)||void 0===A||!A.connectors)&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let Pt=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,Ot=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0,Nt=e.smart_wallet_config;return{id:e.id,appClientId:s,name:e.name,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:null!==(_=null!==(x=null===t||void 0===t||null===(E=t.appearance)||void 0===E?void 0:E.logo)&&void 0!==x?x:e.logo_url)&&void 0!==_?_:void 0,landingHeader:null!==(k=null===t||void 0===t||null===(S=t.appearance)||void 0===S?void 0:S.landingHeader)&&void 0!==k?k:H.appearance.landingHeader,loginMessage:"string"==typeof(null===t||void 0===t||null===(I=t.appearance)||void 0===I?void 0:I.loginMessage)?null===t||void 0===t||null===(T=t.appearance)||void 0===T?void 0:T.loginMessage.slice(0,100):null===t||void 0===t||null===(C=t.appearance)||void 0===C?void 0:C.loginMessage,footerLogo:null===t||void 0===t||null===(P=t.appearance)||void 0===P?void 0:P.footerLogo,palette:ee({backgroundTheme:null!==(O=null===t||void 0===t||null===(N=t.appearance)||void 0===N?void 0:N.theme)&&void 0!==O?O:H.appearance.theme,accentHex:null!==(R=null===t||void 0===t||null===(M=t.appearance)||void 0===M?void 0:M.accentColor)&&void 0!==R?R:e.accent_color}),loginGroupPriority:wt?"web3-first":"web2-first",hideDirectWeb2Inputs:!(null===t||void 0===t||null===(U=t.appearance)||void 0===U||!U.hideDirectWeb2Inputs),walletList:At,walletChainType:null!==(L=null===t||void 0===t||null===(B=t.appearance)||void 0===B?void 0:B.walletChainType)&&void 0!==L?L:(e=>{let{evmWalletAuth:t,solanaWalletAuth:n}=e;return t&&n?"ethereum-and-solana":t?"ethereum-only":n?"solana-only":"ethereum-only"})({evmWalletAuth:null!==(D=e.wallet_auth)&&void 0!==D&&D,solanaWalletAuth:null!==(j=e.solana_wallet_auth)&&void 0!==j&&j})},loginMethods:{wallet:Xe,email:Ze,sms:Qe,passkey:Ye,google:$e,twitter:et,discord:tt,github:ct,spotify:st,instagram:ot,tiktok:nt,line:rt,twitch:it,linkedin:at,apple:lt,farcaster:ut,telegram:
2dt},customOAuthProviders:(null!==(F=e.custom_oauth_providers)&&void 0!==F?F:[]).filter(e=>!1!==e.enabled),disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:_t,legal:{termsAndConditionsUrl:null!==(z=null===t||void 0===t||null===(W=t.legal)||void 0===W?void 0:W.termsAndConditionsUrl)&&void 0!==z?z:e.terms_and_conditions_url,privacyPolicyUrl:null!==(q=null===t||void 0===t||null===(V=t.legal)||void 0===V?void 0:V.privacyPolicyUrl)&&void 0!==q?q:e.privacy_policy_url,requireUsersAcceptTerms:null!==(G=e.require_users_accept_terms)&&void 0!==G&&G},walletConnectCloudProjectId:null!==(K=null!==(Z=null===t||void 0===t?void 0:t.walletConnectCloudProjectId)&&void 0!==Z?Z:e.wallet_connect_cloud_project_id)&&void 0!==K?K:H.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:null!==(Q=null===t||void 0===t||null===(X=t.externalWallets)||void 0===X?void 0:X.signatureRequestTimeouts)&&void 0!==Q?Q:{}},chains:Et,defaultChain:kt,intl:{defaultCountry:xt,textLocalization:null===t||void 0===t||null===($=t.intl)||void 0===$?void 0:$.textLocalization},shouldEnforceDefaultChainOnConnect:St,captcha:{enabled:null!==(te=e.captcha_enabled)&&void 0!==te?te:H.captchaEnabled,siteKey:e.captcha_site_key,provider:e.captcha_enabled?"turnstile":null},externalWallets:{coinbaseWallet:{config:(0,i.A)({appName:e.name,appLogoUrl:e.logo_url,preference:(0,i.A)({options:"all"},null===t||void 0===t||null===(ne=t.externalWallets)||void 0===ne||null===(ne=ne.coinbaseWallet)||void 0===ne||null===(ne=ne.config)||void 0===ne?void 0:ne.preference)},null===t||void 0===t||null===(re=t.externalWallets)||void 0===re||null===(re=re.coinbaseWallet)||void 0===re?void 0:re.config)},baseAccount:{config:(0,i.A)((0,i.A)({appName:e.name,appLogoUrl:e.logo_url},null===t||void 0===t||null===(ie=t.externalWallets)||void 0===ie||null===(ie=ie.baseAccount)||void 0===ie?void 0:ie.config),{},{preference:(0,i.A)((0,i.A)({},null===t||void 0===t||null===(se=t.externalWallets)||void 0===se||null===(se=se.baseAccount)||void 0===se||null===(se=se.config)||void 0===se?void 0:se.preference),{},{telemetry:!1})})},walletConnect:{enabled:bt},solana:{connectors:null===t||void 0===t||null===(oe=t.externalWallets)||void 0===oe||null===(oe=oe.solana)||void 0===oe?void 0:oe.connectors},disableAllExternalWallets:null!==(ae=null===t||void 0===t||null===(ce=t.externalWallets)||void 0===ce?void 0:ce.disableAllExternalWallets)&&void 0!==ae&&ae},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!It&&null!==(le=e.embedded_wallet_config.require_user_owned_recovery_on_create)&&void 0!==le&&le,userOwnedRecoveryOptions:It?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:null!==(ue=null===t||void 0===t||null===(de=t.embeddedWallets)||void 0===de?void 0:de.priceDisplay)&&void 0!==ue?ue:{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:null!==(he=null===t||void 0===t||null===(pe=t.embeddedWallets)||void 0===pe||null===(pe=pe.ethereum)||void 0===pe?void 0:pe.createOnLogin)&&void 0!==he?he:Tt},solana:{createOnLogin:null!==(fe=null===t||void 0===t||null===(ge=t.embeddedWallets)||void 0===ge||null===(ge=ge.solana)||void 0===ge?void 0:ge.createOnLogin)&&void 0!==fe?fe:Ct},disableAutomaticMigration:null!==(me=null===t||void 0===t||null===(ye=t.embeddedWallets)||void 0===ye?void 0:ye.disableAutomaticMigration)&&void 0!==me&&me,mode:e.embedded_wallet_config.mode,showWalletUIs:null===(ve=null!==(we=null===t||void 0===t||null===(be=t.embeddedWallets)||void 0===be?void 0:be.showWalletUIs)&&void 0!==we?we:e.enforce_wallet_uis)||void 0===ve||ve,extendedCalldataDecoding:null!==(Ae=null===t||void 0===t||null===(_e=t.embeddedWallets)||void 0===_e?void 0:_e.extendedCalldataDecoding)&&void 0!==Ae&&Ae,transactionScanning:{enabled:null!==(xe=null===t||void 0===t||null===(Ee=t.embeddedWallets)||void 0===Ee||null===(Ee=Ee.transactionScanning)||void 0===Ee?void 0:Ee.enabled)&&void 0!==xe&&xe,domain:null!==(ke=null!==(Se=null===t||void 0===t||null===(Ie=t.embeddedWallets)||void 0===Ie||null===(Ie=Ie.transactionScanning)||void 0===Ie?void 0:Ie.domain)&&void 0!==Se?Se:r)&&void 0!==ke?ke:"https://auth.privy.io"}},mfa:{methods:null!==(Te=e.mfa_methods)&&void 0!==Te?Te:[],noPromptOnMfaRequired:null!==(Ce=null===t||void 0===t||null===(Pe=t.mfa)||void 0===Pe?void 0:Pe.noPromptOnMfaRequired)&&void 0!==Ce&&Ce},passkeys:{shouldUnlinkOnUnenrollMfa:null===t||void 0===t||null===(Oe=t.passkeys)||void 0===Oe?void 0:Oe.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:null===t||void 0===t||null===(Ne=t.passkeys)||void 0===Ne?void 0:Ne.shouldUnenrollMfaOnUnlink,registration:null===t||void 0===t||null===(Re=t.passkeys)||void 0===Re?void 0:Re.registration},customAuth:It?(0,i.A)({enabled:!0},t.customAuth):void 0,loginConfig:{telegramAuthConfiguration:Pt,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!(null===t||void 0===t||!t.headless),render:{standalone:null!==(Me=null===t||void 0===t||null===(Ue=t._render)||void 0===Ue?void 0:Ue.standalone)&&void 0!==Me?Me:H._render.standalone},fundingConfig:Ot,fundingMethodConfig:(0,i.A)((0,i.A)({},null!==(Le=null===t||void 0===t?void 0:t.fundingMethodConfig)&&void 0!==Le?Le:H.fundingMethodConfig),{},{moonpay:(0,i.A)((0,i.A)({},null!==(Be=null===t||void 0===t||null===(De=t.fundingMethodConfig)||void 0===De?void 0:De.moonpay)&&void 0!==Be?Be:H.fundingMethodConfig.moonpay),{},{useSandbox:null!==(je=null===t||void 0===t||null===(Fe=t.fundingMethodConfig)||void 0===Fe?void 0:Fe.moonpay.useSandbox)&&void 0!==je?je:H.fundingMethodConfig.moonpay.useSandbox})}),whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:null===t||void 0===t?void 0:t.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:null!==(ze=null===t||void 0===t?void 0:t.allowOAuthInEmbeddedBrowsers
2)&&void 0!==ze&&ze,solanaRpcs:{"solana:mainnet":null!==(We=null===t||void 0===t||null===(qe=t.solana)||void 0===qe||null===(qe=qe.rpcs)||void 0===qe?void 0:qe["solana:mainnet"])&&void 0!==We?We:null,"solana:devnet":null!==(He=null===t||void 0===t||null===(Ve=t.solana)||void 0===Ve||null===(Ve=Ve.rpcs)||void 0===Ve?void 0:Ve["solana:devnet"])&&void 0!==He?He:null,"solana:testnet":null!==(Ge=null===t||void 0===t||null===(Ke=t.solana)||void 0===Ke||null===(Ke=Ke.rpcs)||void 0===Ke?void 0:Ke["solana:testnet"])&&void 0!==Ge?Ge:null},smartWallets:null!==Nt&&void 0!==Nt&&Nt.enabled?{enabled:Nt.enabled,smartWalletVersion:Nt.smart_wallet_version,smartWalletType:Nt.smart_wallet_type,configuredNetworks:Nt.configured_networks.map(e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:Y(e.paymaster_url,e.paymaster_context)}))}:{enabled:null!==(Je=null===Nt||void 0===Nt?void 0:Nt.enabled)&&void 0!==Je&&Je}}}const ie={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_enabled:!1,captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let se=(0,o.createContext)({appConfig:re(ie,void 0,!1),isServerConfigLoaded:!1});const oe=e=>{let{children:t,client:n,legacyClient:a,clientConfig:c,appClientId:l}=e,[u,h]=(0,o.useState)(null),p=(0,o.useMemo)(()=>re(null!==u&&void 0!==u?u:ie,c,!!u,"undefined"!=typeof window?window.location.origin:void 0,l),[u,c,l]);return(0,o.useEffect)(()=>{if(!u)return;let e=function(e,t){if(!e)return{};let{appearance:n,supportedChains:s,defaultChain:o,externalWallets:a}=e,c=(0,r.A)(e,d);return(0,i.A)((0,i.A)((0,i.A)((0,i.A)({},c),s?{supportedChains:s.map(e=>e.id)}:void 0),o?{defaultChain:o.id}:void 0),a?{walletConnect:a.walletConnect?{enabled:a.walletConnect.enabled}
2:void 0,coinbaseWallet:a.coinbaseWallet,solana:{connectors:null===(t=a.solana)||void 0===t||null===(t=t.connectors)||void 0===t?void 0:t.get().map(e=>e.walletClientType)}}:void 0)}(c),t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=3735928559^t,r=1103547991^t;for(let i,s=0;s<e.length;s++)n=Math.imul(n^(i=e.charCodeAt(s)),2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&(r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}(JSON.stringify(e)).toString(),n="privy:sent:".concat(u.id,":").concat(t);localStorage.getItem(n)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(n,"t"))},[c,u]),(0,o.useEffect)(()=>{u||(async()=>{try{await n.initialize();let e=n.app.getConfig();e.custom_api_url&&a.updateApiUrl(e.custom_api_url),h(e)}catch(e){console.warn("Error generating app config: ",e)}})()},[]),(0,s.jsx)(se.Provider,{value:{appConfig:p,isServerConfigLoaded:!!u},children:t})},ae=()=>{let{appConfig:e}=(0,o.useContext)(se);return e},ce=()=>{let{isServerConfigLoaded:e}=(0,o.useContext)(se);return e}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.m=e,n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(r,i){if(1&i&&(r=this(r)),8&i)return r;if("object"===typeof r&&r){if(4&i&&r.__esModule)return r;if(16&i&&"function"===typeof r.then)return r}var s=Object.create(null);n.r(s);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&i&&r;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>o[e]=()=>r[e]);return o.default=()=>r,n.d(s,o),s}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,r)=>(n.f[r](e,t),t),[])),n.u=e=>"static/js/"+e+"."+{38:"a4f19a9d",70:"a377ac13",180:"a1c1d849",252:"a95f7435",435:"fa8b2797",463:"37110bc9",517:"a7c6efc0",603:"52c009f0",770:"42f1d8b9",795:"b036c343",863:"674218b7",1083:"d9806eae",1176:"18bfc286",1188:"9db5d7b1",1238:"75990e2a",1275:"03586eed",1333:"d82ed462",1359:"0c5ee941",1444:"e021bbbb",1593:"ac80304b",1837:"4a15d5e7",1871:"7b8ab73b",1943:"d72afae1",1977:"9f5d24a1",2043:"f9110c6e",2163:"7e593f87",2166:"579d95f3",2187:"e0a72e10",2222:"d50e20bb",2327:"d2c6a697",2415:"dcdabf21",2416:"68640f7a",2483:"2a1fcd67",2595:"b1d95160",2666:"7aebc7bd",2913:"bc389435",2977:"946da59f",2998:"617c8871",3021:"1d595a50",3063:"b0ce32cd",3099:"51753248",3170:"02d5a2ec",3275:"50311ace",3331:"6193b726",3364:"72f32e60",3383:"f9b73689",3397:"0ccc70c2",3460:"4e9e5baf",3461:"4a0060a8",3477:"23fc64c5",3485:"f7e29c45",3567:"baaa8ab6",3597:"3cab9141",3704:"59becad8",3867:"adc3567e",3942:"28963879",4032:"38129f72",4036:"bdef4cab",4061:"2dce1796",4262:"fabd85c2",4399:"8bcb6ee8",4411:"a401afdc",4566:"d612d139",4618:"16f267c7",4627:"ddce218a",4658:"1807f53e",4680:"120b9746",4857:"ba76ae3a",4927:"fba25acc",4949:"fbf07ad2",4978:"ee9c8832",5035:"b1c41eaa",5051:"5368ce2f",5109:"f0f36d69",5238:"ead81978",5255:"61466220",5457:"79c480b9",5678:"4a2fa15c",5733:"6bedf713",5740:"d5a4ac4b",5817:"5d0c28cb",5835:"1a79f88f",5939:"2aaa0ece",5951:"6eff954e",5994:"f55f6eae",6088:"6bdfeaf9",6197:"30cb09ce",6386:"214a66fd",6425:"962a68e0",6450:"0468b3de",6490:"a5426a66",6563:"1cad1847",6586:"1ce68c78",6716:"d2130464",6773:"9f56d57f",6781:"e317989c",6878:"5991bb76",6887:"3ddf093a",7015:"342d3d91",7104:"9fdc8dcd",7138:"dcad0cef",7139:"cf4816ae",7154:"815197b8",7237:"948d4648",7279:"4405c22b",7448:"47579aab",7457:"1e4116d7",7488:"c36c33e7",7516:"d0f5293b",7558:"7cfd61c1",7708:"9ce8ba1b",7801:"efc4ede8",7882:"9b8a6fce",8126:"cfae546f",8450:"5f1f6ca0",8485:"2a320eac",8533:"5aafe42e",8656:"b15d23cc",8669:"4baed91a",8733:"493e0da3",8780:"edb11344",8807:"15615d47",8893:"ccde1cc2",8895:"7f1f3803",8952:"7c70a830",9040:"4a4c72d2",9123:"afe40042",9224:"fab50e90",9227:"5d224a52",9293:"a24ba294",9359:"c1d98913",9368:"82ffbd43",9406:"174cbf8f",9453:"e2451146",9551:"9fe83270",9564:"7dbe16e5",9568:"f66fea17",9583:"9712e56a",9669:"d1f1ba3c",9679:"527bf998",9694:"0afc79b9",9724:"92ddd0cf",9813:"17401804",9822:"2fbf6112",9863:"1f3305c7"}[e]+".chunk.js",n.miniCssF=e=>{},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}
2}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="ico_react:";n.l=(r,i,s,o)=>{if(e[r])e[r].push(i);else{var a,c;if(void 0!==s)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+s){a=d;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",n.nc&&a.setAttribute("nonce",n.nc),a.setAttribute("data-webpack",t+s),a.src=r),e[r]=[i];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var i=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach(e=>e(n)),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),c&&document.head.appendChild(a)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="./",(()=>{var e={8792:0};n.f.j=(t,r)=>{var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var s=new Promise((n,r)=>i=e[t]=[n,r]);r.push(i[2]=s);var o=n.p+n.u(t),a=new Error;n.l(o,r=>{if(n.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var s=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,i[1](a)}},"chunk-"+t,t)}};var t=(t,r)=>{var i,s,[o,a,c]=r,l=0;if(o.some(t=>0!==e[t])){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(c)c(n)}for(t&&t(r);l<o.length;l++)s=o[l],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0},r=self.webpackChunkico_react=self.webpackChunkico_react||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),n.nc=void 0,(()=>{"use strict";var e={};n.r(e),n.d(e,{OG:()=>Lc,My:()=>Ic,Ph:()=>Pc,lX:()=>Oc,Id:()=>Uc,fg:()=>jc,qj:()=>Mc,aT:()=>Cc,lq:()=>Nc,z:()=>Rc,Q5:()=>zc});var t=n(57722),r=n(24348),i=n(24107),s=(n(77011),n(55788)),o=n.n(s),a=n(66252),c=n(44131),l=n(15882);function u(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=u(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const d=function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=u(e))&&(r&&(r+=" "),r+=t);return r},h=["theme","type","isLoading"];!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);
2-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}
2.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}
2}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n');var p=e=>"number"==typeof e&&!isNaN(e),f=e=>"string"==typeof e,g=e=>"function"==typeof e,m=e=>f(e)||g(e)?e:null,y=(e,t)=>!1===e||p(e)&&e>0?e:t,v=e=>(0,t.isValidElement)(e)||f(e)||g(e)||p(e);function w(e){let{enter:n,exit:r,appendPosition:i=!1,collapse:s=!0,collapseDuration:o=300}=e;return function(e){let{children:a,position:c,preventExitTransition:l,done:u,nodeRef:d,isIn:h,playToast:p}=e,f=i?"".concat(n,"--").concat(c):n,g=i?"".concat(r,"--").concat(c):r,m=(0,t.useRef)(0);return(0,t.useLayoutEffect)(()=>{let e=d.current,t=f.split(" "),n=r=>{r.target===d.current&&(p(),e.removeEventListener("animationend",n),e.removeEventListener("animationcancel",n),0===m.current&&"animationcancel"!==r.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",n),e.addEventListener("animationcancel",n)},[]),(0,t.useEffect)(()=>{let e=d.current,t=()=>{e.removeEventListener("animationend",t),s?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,{scrollHeight:r,style:i}=e;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition="all ".concat(n,"ms"),requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(t,n)})})}(e,u,o):u()};h||(l?t():(m.current=1,e.className+=" ".concat(g),e.addEventListener("animationend",t)))},[h]),t.createElement(t.Fragment,null,a)}}function b(e,t){return{content:A(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function A(e,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,t.isValidElement)(e)&&!f(e.type)?(0,t.cloneElement)(e,{closeToast:n.closeToast,toastProps:n,data:n.data,isPaused:r}):g(e)?e({closeToast:n.closeToast,toastProps:n,data:n.data,isPaused:r}):e}function _(e){let{delay:n,isRunning:r,closeToast:s,type:o="default",hide:a,className:c,controlledProgress:l,progress:u,rtl:h,isIn:p,theme:f}=e,m=a||l&&0===u,y={animationDuration:"".concat(n,"ms"),animationPlayState:r?"running":"paused"};l&&(y.transform="scaleX(".concat(u,")"));let v=d("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--".concat(f),"Toastify__progress-bar--".concat(o),{"Toastify__progress-bar--rtl":h}),w=g(c)?c({rtl:h,type:o,defaultClassName:v}):d(v,c),b={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{p&&s()}};return t.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":m},t.createElement("div",{className:"Toastify__progress-bar--bg Toastify__progress-bar-theme--".concat(f," Toastify__progress-bar--").concat(o)}),t.createElement("div",(0,i.A)({role:"progressbar","aria-hidden":m?"true":"false","aria-label":"notification timer",className:w,style:y},b)))}var x=1,E=()=>"".concat(x++);
2function k(e,t,n){let r=1,s=0,o=[],a=[],c=t,l=new Map,u=new Set,d=()=>{a=Array.from(l.values()),u.forEach(e=>e())},h=e=>{var t,n;null==(n=null==(t=e.props)?void 0:t.onClose)||n.call(t,e.removalReason),e.isActive=!1},f=e=>{if(null==e)l.forEach(h);else{let t=l.get(e);t&&h(t)}d()},g=e=>{var t,r;let{toastId:i,updateId:s}=e.props,o=null==s;e.staleId&&l.delete(e.staleId),e.isActive=!0,l.set(i,e),d(),n(b(e,o?"added":"updated")),o&&(null==(r=(t=e.props).onOpen)||r.call(t))};return{id:e,props:c,observe:e=>(u.add(e),()=>u.delete(e)),toggle:(e,t)=>{l.forEach(n=>{var r;(null==t||t===n.props.toastId)&&(null==(r=n.toggle)||r.call(n,e))})},removeToast:f,toasts:l,clearQueue:()=>{s-=o.length,o=[]},buildToast:(t,a)=>{if((t=>{let{containerId:n,toastId:r,updateId:i}=t,s=n?n!==e:1!==e,o=l.has(r)&&null==i;return s||o})(a))return;let{toastId:u,updateId:h,data:w,staleId:A,delay:_}=a,x=null==h;x&&s++;let E=(0,i.A)((0,i.A)((0,i.A)({},c),{},{style:c.toastStyle,key:r++},Object.fromEntries(Object.entries(a).filter(e=>{let[t,n]=e;return null!=n}))),{},{toastId:u,updateId:h,data:w,isIn:!1,className:m(a.className||c.toastClassName),progressClassName:m(a.progressClassName||c.progressClassName),autoClose:!a.isLoading&&y(a.autoClose,c.autoClose),closeToast(e){l.get(u).removalReason=e,f(u)},deleteToast(){let e=l.get(u);if(null!=e){if(n(b(e,"removed")),l.delete(u),s--,s<0&&(s=0),o.length>0)return void g(o.shift());d()}}});E.closeButton=c.closeButton,!1===a.closeButton||v(a.closeButton)?E.closeButton=a.closeButton:!0===a.closeButton&&(E.closeButton=!v(c.closeButton)||c.closeButton);let k={content:t,props:E,staleId:A};c.limit&&c.limit>0&&s>c.limit&&x?o.push(k):p(_)?setTimeout(()=>{g(k)},_):g(k)},setProps(e){c=e},setToggle:(e,t)=>{let n=l.get(e);n&&(n.toggle=t)},isToastActive:e=>{var t;return null==(t=l.get(e))?void 0:t.isActive},getSnapshot:()=>a}}var S=new Map,I=[],T=new Set,C=e=>T.forEach(t=>t(e)),P=()=>S.size>0;function O(e,t){var n;if(t)return!(null==(n=S.get(t))||!n.isToastActive(e));let r=!1;return S.forEach(t=>{t.isToastActive(e)&&(r=!0)}),r}function N(e){if(P()){if(null==e||(e=>f(e)||p(e))(e))S.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=S.get(e.containerId);t?t.removeToast(e.id):S.forEach(t=>{t.removeToast(e.id)})}}else I=I.filter(t=>null!=e&&t.options.toastId!==e)}function R(e,t){v(e)&&(P()||I.push({content:e,options:t}),S.forEach(n=>{n.buildToast(e,t)}))}function M(e,t){S.forEach(n=>{(null==t||null==t||!t.containerId||(null==t?void 0:t.containerId)===n.id)&&n.toggle(e,null==t?void 0:t.id)})}function U(e){let t=e.containerId||1;return{subscribe(n){let r=k(t,e,C);S.set(t,r);let i=r.observe(n);return I.forEach(e=>R(e.content,e.options)),I=[],()=>{i(),S.delete(t)}},setProps(e){var n;null==(n=S.get(t))||n.setProps(e)},getSnapshot(){var e;return null==(e=S.get(t))?void 0:e.getSnapshot()}}}function L(e){return e&&(f(e.toastId)||p(e.toastId))?e.toastId:E()}function B(e,t){return R(e,t),t.toastId}function D(e,t){return(0,i.A)((0,i.A)({},t),{},{type:t&&t.type||e,toastId:L(t)})}function j(e){return(t,n)=>B(t,D(e,n))}function F(e,t){return B(e,D("default",t))}function z(e){let[n,r]=(0,t.useState)(!1),[i,s]=(0,t.useState)(!1),o=(0,t.useRef)(null),a=(0,t.useRef)({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:l,closeToast:u,onClick:d,closeOnClick:h}=e;function p(){r(!0)}function f(){r(!1)}function g(t){let r=o.current;if(a.canDrag&&r){a.didMove=!0,n&&f(),"x"===e.draggableDirection?a.delta=t.clientX-a.start:a.delta=t.clientY-a.start,a.start!==t.clientX&&(a.canCloseOnClick=!1);let i="x"===e.draggableDirection?"".concat(a.delta,"px, var(--y)"):"0, calc(".concat(a.delta,"px + var(--y))");r.style.transform="translate3d(".concat(i,",0)"),r.style.opacity="".concat(1-Math.abs(a.delta/a.removalDistance))}}function m(){document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",m);let t=o.current;if(a.canDrag&&a.didMove&&t){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return s(!0),e.closeToast(!0),void e.collapseAll();t.style.transition="transform 0.2s, opacity 0.2s",t.style.removeProperty("transform"),t.style.removeProperty("opacity")}}(function(e){var t;null==(t=S.get(e.containerId||1))||t.setToggle(e.id,e.fn)})({id:e.toastId,containerId:e.containerId,fn:r}),(0,t.useEffect)(()=>
2{if(e.pauseOnFocusLoss)return document.hasFocus()||f(),window.addEventListener("focus",p),window.addEventListener("blur",f),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",f)}},[e.pauseOnFocusLoss]);let y={onPointerDown:function(t){if(!0===e.draggable||e.draggable===t.pointerType){a.didMove=!1,document.addEventListener("pointermove",g),document.addEventListener("pointerup",m);let n=o.current;a.canCloseOnClick=!0,a.canDrag=!0,n.style.transition="none","x"===e.draggableDirection?(a.start=t.clientX,a.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(a.start=t.clientY,a.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(t){let{top:n,bottom:r,left:i,right:s}=o.current.getBoundingClientRect();"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&t.clientX>=i&&t.clientX<=s&&t.clientY>=n&&t.clientY<=r?f():p()}};return c&&l&&(y.onMouseEnter=f,e.stacked||(y.onMouseLeave=p)),h&&(y.onClick=e=>{d&&d(e),a.canCloseOnClick&&u(!0)}),{playToast:p,pauseToast:f,isRunning:n,preventExitTransition:i,toastRef:o,eventHandlers:y}}F.loading=(e,t)=>
2B(e,D("default",(0,i.A)({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},t))),F.promise=function(e,t,n){let r,{pending:s,error:o,success:a}=t;s&&(r=f(s)?F.loading(s,n):F.loading(s.render,(0,i.A)((0,i.A)({},n),s)));let c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(e,t,s)=>{if(null==t)return void F.dismiss(r);let o=(0,i.A)((0,i.A)((0,i.A)({type:e},c),n),{},{data:s}),a=f(t)?{render:t}:t;return r?F.update(r,(0,i.A)((0,i.A)({},o),a)):F(a.render,(0,i.A)((0,i.A)({},o),a)),s},u=g(e)?e():e;return u.then(e=>l("success",a,e)).catch(e=>l("error",o,e)),u},F.success=j("success"),F.info=j("info"),F.error=j("error"),F.warning=j("warning"),F.warn=F.warning,F.dark=(e,t)=>B(e,D("default",(0,i.A)({theme:"dark"},t))),F.dismiss=function(e){N(e)},F.clearWaitingQueue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};S.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},F.isActive=O,F.update=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=((e,t)=>{let{containerId:n}=t;var r;return null==(r=S.get(n||1))?void 0:r.toasts.get(e)})(e,t);if(n){let{props:r,content:s}=n,o=(0,i.A)((0,i.A)((0,i.A)({delay:100},r),t),{},{toastId:t.toastId||e,updateId:E()});o.toastId!==e&&(o.staleId=e);let a=o.render||s;delete o.render,B(a,o)}},F.done=e=>{F.update(e,{progress:1})},F.onChange=function(e){return T.add(e),()=>{T.delete(e)}},F.play=e=>M(!0,e),F.pause=e=>M(!1,e);var W="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,q=e=>{let{theme:n,type:r,isLoading:s}=e,o=(0,l.A)(e,h);return t.createElement("svg",(0,i.A)({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===n?"currentColor":"var(--toastify-icon-color-".concat(r,")")},o))};var H={info:function(e){return t.createElement(q,(0,i.A)({},e),t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return t.createElement(q,(0,i.A)({},e),t.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return t.createElement(q,(0,i.A)({},e),t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return t.createElement(q,(0,i.A)({},e),t.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return t.createElement("div",{className:"Toastify__spinner"})}};function V(e){let{theme:n,type:r,isLoading:s,icon:o}=e,a=null,c={theme:n,type:r};return!1===o||(g(o)?a=o((0,i.A)((0,i.A)({},c),{},{isLoading:s})):(0,t.isValidElement)(o)?a=(0,t.cloneElement)(o,c):s?a=H.spinner():(e=>e in H)(r)&&(a=H[r](c))),a}var G=e=>{let{isRunning:n,preventExitTransition:r,toastRef:s,eventHandlers:o,playToast:a}=z(e),{closeButton:c,children:l,autoClose:u,onClick:h,type:p,hideProgressBar:f,closeToast:m,transition:y,position:v,className:w,style:b,progressClassName:x,updateId:E,role:k,progress:S,rtl:I,toastId:T,deleteToast:C,isIn:P,isLoading:O,closeOnClick:N,theme:R,ariaLabel:M}=e,U=d("Toastify__toast","Toastify__toast-theme--".concat(R),"Toastify__toast--".concat(p),{"Toastify__toast--rtl":I},{"Toastify__toast--close-on-click":N}),L=g(w)?w({rtl:I,position:v,type:p,defaultClassName:U}):d(U,w),B=V(e),D=!!S||!u,j={closeToast:m,type:p,theme:R},F=null;return!1===c||(F=g(c)?c(j):(0,t.isValidElement)(c)?(0,t.cloneElement)(c,j):function(e){let{closeToast:n,theme:r,ariaLabel:i="close"}=e;return t.createElement("button",{className:"Toastify__close-button Toastify__close-button--".concat(r),type:"button",onClick:e=>{e.stopPropagation(),n(!0)},"aria-label":i},t.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(j)),t.createElement(y,{isIn:P,done:C,position:v,preventExitTransition:r,nodeRef:s,playToast:a},t.createElement("div",(0,i.A)((0,i.A)({id:T,tabIndex:0,onClick:h,"data-in":P,className:L},o),{},{style:b,ref:s},P&&{role:k,"aria-label":M}),null!=B&&t.createElement("div",{className:d("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter"
2:!O})},B),A(l,e,!n),F,!e.customProgressBar&&t.createElement(_,(0,i.A)((0,i.A)({},E&&!D?{key:"p-".concat(E)}:{}),{},{rtl:I,theme:R,delay:u,isRunning:n,isIn:P,closeToast:m,hide:f,type:p,className:x,controlledProgress:D,progress:S||0}))))},K=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{enter:"Toastify--animate Toastify__".concat(e,"-enter"),exit:"Toastify--animate Toastify__".concat(e,"-exit"),appendPosition:t}},J=w(K("bounce",!0)),Z=(w(K("slide",!0)),w(K("zoom")),w(K("flip")),{position:"top-right",transition:J,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&"KeyT"===e.code});function Q(e){let n=(0,i.A)((0,i.A)({},Z),e),r=e.stacked,[s,o]=(0,t.useState)(!0),a=(0,t.useRef)(null),{getToastToRender:c,isToastActive:l,count:u}=function(e){var n;let{subscribe:r,getSnapshot:i,setProps:s}=(0,t.useRef)(U(e)).current;s(e);let o=null==(n=(0,t.useSyncExternalStore)(r,i,i))?void 0:n.slice();return{getToastToRender:function(t){if(!o)return[];let n=new Map;return e.newestOnTop&&o.reverse(),o.forEach(e=>{let{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,e=>t(e[0],e[1]))},isToastActive:O,count:null==o?void 0:o.length}}(n),{className:h,style:p,rtl:f,containerId:y,hotKeys:v}=n;function w(e){let t=d("Toastify__toast-container","Toastify__toast-container--".concat(e),{"Toastify__toast-container--rtl":f});return g(h)?h({position:e,rtl:f,defaultClassName:t}):d(t,m(h))}function b(){r&&(o(!0),F.play())}return W(()=>{var e;if(r){let t=a.current.querySelectorAll('[data-in="true"]'),r=12,i=null==(e=n.position)?void 0:e.includes("top"),o=0,c=0;Array.from(t).reverse().forEach((e,t)=>{let n=e;n.classList.add("Toastify__toast--stacked"),t>0&&(n.dataset.collapsed="".concat(s)),n.dataset.pos||(n.dataset.pos=i?"top":"bot");let a=o*(s?.2:1)+(s?0:r*t);n.style.setProperty("--y","".concat(i?a:-1*a,"px")),n.style.setProperty("--g","".concat(r)),n.style.setProperty("--s","".concat(1-(s?c:0))),o+=n.offsetHeight,c+=.025})}},[s,u,r]),(0,t.useEffect)(()=>{function e(e){var t;let n=a.current;v(e)&&(null==(t=n.querySelector('[tabIndex="0"]'))||t.focus(),o(!1),F.pause()),"Escape"===e.key&&(document.activeElement===n||null!=n&&n.contains(document.activeElement))&&(o(!0),F.play())}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[v]),t.createElement("section",{ref:a,className:"Toastify",id:y,onMouseEnter:()=>{r&&(o(!1),F.pause())},onMouseLeave:b,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":n["aria-label"]},c((e,n)=>{let s=n.length?(0,i.A)({},p):(0,i.A)((0,i.A)({},p),{},{pointerEvents:"none"});return t.createElement("div",{tabIndex:-1,className:w(e),"data-stacked":r,style:s,key:"c-".concat(e)},n.map(e=>{let{content:n,props:s}=e;return t.createElement(G,(0,i.A)((0,i.A)({},s),{},{stacked:r,collapseAll:b,isIn:l(s.toastId,s.containerId),key:"t-".concat(s.key)}),n)}))}))}function Y(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X(e,t,n){Y(e,t),t.set(e,n)}function $(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function ee(e,t){return e.get($(e,t))}function te(e,t,n){return e.set($(e,t),n),n}function ne(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: ".concat(e))}function re(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(n.length>0&&!n.includes(e.length))throw new Error("Expected Uint8Array of length ".concat(n,", not of length=").concat(e.length))}function ie(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");ne(e.outputLen),ne(e.blockLen)}function se(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function oe(e,t){re(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least ".concat(n))}const ae=BigInt(2**32-1),ce=BigInt(32);function le(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(e&ae),l:Number(e>>ce&ae)}:{h:0|Number(e>>ce&ae),l:0|Number(e&ae)}}function ue(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(e.length),r=new
vendor: 6,400 bytes, line 2
2Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:s,l:o}=le(e[i],t);[n[i],r[i]]=[s,o]}return[n,r]}const de=(e,t,n)=>e<<n|t>>>32-n,he=(e,t,n)=>t<<n|e>>>32-n,pe=(e,t,n)=>t<<n-32|e>>>64-n,fe=(e,t,n)=>e<<n-32|t>>>64-n;const ge={fromBig:le,split:ue,toBig:(e,t)=>BigInt(e>>>0)<<ce|BigInt(t>>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:de,rotlSL:he,rotlBH:pe,rotlBL:fe,add:function(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,s)=>t+n+r+i+s+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)},me="object"===typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,ye=e=>e instanceof Uint8Array,ve=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),we=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");function be(e){if("string"===typeof e&&(e=function(e){if("string"!==typeof e)throw new Error("utf8ToBytes expected string, got ".concat(typeof e));return new Uint8Array((new TextEncoder).encode(e))}(e)),!ye(e))throw new Error("expected Uint8Array, got ".concat(typeof e));return e}class Ae{clone(){return this._cloneInto()}}function _e(e){const t=t=>e().update(be(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function xe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(me&&"function"===typeof me.getRandomValues)return me.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[Ee,ke,Se]=[[],[],[]],Ie=BigInt(0),Te=BigInt(1),Ce=BigInt(2),Pe=BigInt(7),Oe=BigInt(256),Ne=BigInt(113);for(let n=0,_y=Te,xy=1,Ey=0;n<24;n++){[xy,Ey]=[Ey,(2*xy+3*Ey)%5],Ee.push(2*(5*Ey+xy)),ke.push((n+1)*(n+2)/2%64);let e=Ie;for(let t=0;t<7;t++)_y=(_y<<Te^(_y>>Pe)*Ne)%Oe,_y&Ce&&(e^=Te<<(Te<<BigInt(t))-Te);Se.push(e)}const[Re,Me]=ue(Se,!0),Ue=(e,t,n)=>n>32?pe(e,t,n):de(e,t,n),Le=(e,t,n)=>n>32?fe(e,t,n):he(e,t,n);class Be extends Ae{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ne(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)))(this.state)}keccak(){!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let r=0;r<10;r++)n[r]=e[r]^e[r+10]^e[r+20]^e[r+30]^e[r+40];for(let r=0;r<10;r+=2){const t=(r+8)%10,i=(r+2)%10,s=n[i],o=n[i+1],a=Ue(s,o,1)^n[t],c=Le(s,o,1)^n[t+1];for(let n=0;n<50;n+=10)e[r+n]^=a,e[r+n+1]^=c}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=ke[n],s=Ue(t,i,r),o=Le(t,i,r),a=Ee[n];t=e[a],i=e[a+1],e[a]=s,e[a+1]=o}for(let r=0;r<50;r+=10){for(let t=0;t<10;t++)n[t]=e[r+t];for(let t=0;t<10;t++)e[r+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=Re[r],e[1]^=Me[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){se(this);const{blockLen:t,state:n}=this,r=(e=be(e)).length;for(let i=0;i<r;){const s=Math.min(t-this.pos,r-i);for(let t=0;t<s;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,0!==(128&t)&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){se(this,!1),re(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ne(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(oe(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:s}=this;return e||(e=new Be(t,n,r,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=s,e.destroyed=this.destroyed,e}}const De=(e,t,n)=>_e(()=>new Be(t,e,n)),je=De(1,136,32);function Fe(e,t,n){const r=t.split("|").map(e=>e.trim());for(let s=0;s<r.length;s++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const i=new Error("invalid value for type ".concat(t));throw i.code="INVALID_ARGUMENT",i.argument="value.".concat(n),i.value=e,i}async function ze(e){const t=Object.keys(e);return(await Promise.all(t.map(t=>Promise.resolve(e[t])))).reduce((e,n,r)=>(e[t[r]]=n,e),{})}function We(e,t,n){for(let r in t){let i=t[r];const s=n?n[r]:null;s&&Fe(i,s,r),Object.defineProperty(e,r,{enumerable:!0,value:i,writable:!1})}}function qe(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"===typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>qe(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[15&e[r]];return n}if("object"===typeof e&&"function"===typeof e.toJSON)return qe(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(n=>"".concat(qe(n,t),": ").concat(qe(e[n],t))).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function He(e,t){return e&&e.code===t}function Ve(e){return He(e,"CALL_EXCEPTION")}function Ge(e,t,n){let r,i=e;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error("value will over
2write populated values: ".concat(qe(n)));for(const e in n){if("shortMessage"===e)continue;const t=n[e];r.push(e+"="+qe(t))}}r.push("code=".concat(t)),r.push("version=".concat("6.15.0")),r.length&&(e+=" ("+r.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return We(r,{code:t}),n&&Object.assign(r,n),null==r.shortMessage&&We(r,{shortMessage:i}),r}function Ke(e,t,n,r){if(!e)throw Ge(t,n,r)}function Je(e,t,n,r){Ke(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function Ze(e,t,n){null==n&&(n=""),n&&(n=": "+n),Ke(e>=t,"missing argument"+n,"MISSING_ARGUMENT",{count:e,expectedCount:t}),Ke(e<=t,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}const Qe=["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(n){}return e},[]);function Ye(e,t,n){if(null==n&&(n=""),e!==t){let e=n,t="new";n&&(e+=".",t+=" "+n),Ke(!1,"private constructor; use ".concat(e,"from* methods"),"UNSUPPORTED_OPERATION",{operation:t})}}function Xe(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if("string"===typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let n=2;for(let r=0;r<t.length;r++)t[r]=parseInt(e.substring(n,n+2),16),n+=2;return t}Je(!1,"invalid BytesLike value",t||"value",e)}function $e(e,t){return Xe(e,t,!1)}function et(e,t){return Xe(e,t,!0)}function tt(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!==typeof t||e.length===2+2*t)&&(!0!==t||e.length%2===0))}function nt(e){return tt(e,!0)||e instanceof Uint8Array}const rt="0123456789abcdef";function it(e){const t=$e(e);let n="0x";for(let r=0;r<t.length;r++){const e=t[r];n+=rt[(240&e)>>4]+rt[15&e]}return n}function st(e){return"0x"+e.map(e=>it(e).substring(2)).join("")}function ot(e){return tt(e,!0)?(e.length-2)/2:$e(e).length}function at(e,t,n){const r=$e(e);return null!=n&&n>r.length&&Ke(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),it(r.slice(null==t?0:t,null==n?r.length:n))}function ct(e,t,n){const r=$e(e);Ke(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});const i=new Uint8Array(t);return i.fill(0),n?i.set(r,t-r.length):i.set(r,0),it(i)}function lt(e,t){return ct(e,t,!0)}let ut=!1;const dt=function(e){return je(e)};let ht=dt;function pt(e){const t=$e(e,"data");return it(ht(t))}pt._=dt,pt.lock=function(){ut=!0},pt.register=function(e){if(ut)throw new TypeError("keccak256 is locked");ht=e},Object.freeze(pt);const ft=BigInt(0),gt=BigInt(36);function mt(e){const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=t[i].charCodeAt(0);const r=$e(pt(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const yt={};for(let n=0;n<10;n++)yt[String(n)]=String(n);for(let n=0;n<26;n++)yt[String.fromCharCode(65+n)]=String(10+n);function vt(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>yt[e]).join("");for(;t.length>=15;){let e=t.substring(0,15);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}const wt=function(){const e={};for(let t=0;t<36;t++){e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t)}return e}();function bt(e){if(Je("string"===typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=mt(e);return Je(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Je(e.substring(2,4)===vt(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=ft;for(let n=0;n<e.length;n++)t=t*gt+wt[e[n]];return t}(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return mt("0x"+t)}Je(!1,"invalid address","address",e)}function At(e,t){return{address:bt(e),storageKeys:t.map((e,t)=>(Je(tt(e,32),"invalid slot","storageKeys[".concat(t,"]"),e),e.toLowerCase()))}}function _t(e){if(Array.isArray(e))return e.map((t,n)=>Array.isArray(t)?(Je(2===t.length,"invalid slot set","value[".concat(n,"]"),t),At(t[0],t[1])):(Je(null!=t&&"object"===typeof t,"invali
2d address-slot set","value",e),At(t.address,t.storageKeys)));Je(null!=e&&"object"===typeof e,"invalid access list","value",e);const t=Object.keys(e).map(t=>{const n=e[t].reduce((e,t)=>(e[t]=!0,e),{});return At(t,Object.keys(n).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}const xt=BigInt(0),Et=BigInt(1),kt=9007199254740991;function St(e,t){const n=Pt(e,"value"),r=BigInt(Rt(t,"width"));if(Ke(n>>r===xt,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-Et){return-((~n&(Et<<r)-Et)+Et)}return n}function It(e,t){let n=Ct(e,"value");const r=BigInt(Rt(t,"width")),i=Et<<r-Et;if(n<xt){n=-n,Ke(n<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return(~n&(Et<<r)-Et)+Et}return Ke(n<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),n}function Tt(e,t){const n=Pt(e,"value"),r=BigInt(Rt(t,"bits"));return n&(Et<<r)-Et}function Ct(e,t){switch(typeof e){case"bigint":return e;case"number":return Je(Number.isInteger(e),"underflow",t||"value",e),Je(e>=-kt&&e<=kt,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(n){Je(!1,"invalid BigNumberish string: ".concat(n.message),t||"value",e)}}Je(!1,"invalid BigNumberish value",t||"value",e)}function Pt(e,t){const n=Ct(e,t);return Ke(n>=xt,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Ot="0123456789abcdef";function Nt(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Ot[n>>4],t+=Ot[15&n];return BigInt(t)}return Ct(e)}function Rt(e,t){switch(typeof e){case"bigint":return Je(e>=-kt&&e<=kt,"overflow",t||"value",e),Number(e);case"number":return Je(Number.isInteger(e),"underflow",t||"value",e),Je(e>=-kt&&e<=kt,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return Rt(BigInt(e),t)}catch(n){Je(!1,"invalid numeric string: ".concat(n.message),t||"value",e)}}Je(!1,"invalid numeric value",t||"value",e)}function Mt(e,t){let n=Pt(e,"value").toString(16);if(null==t)n.length%2&&(n="0"+n);else{const r=Rt(t,"width");for(Ke(2*r>=n.length,"value exceeds width (".concat(r," bytes)"),"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});n.length<2*r;)n="0"+n}return"0x"+n}function Ut(e){const t=Pt(e,"value");if(t===xt)return new Uint8Array([]);let n=t.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let i=0;i<r.length;i++){const e=2*i;r[i]=parseInt(n.substring(e,e+2),16)}return r}function Lt(e){let t=it(nt(e)?e:Ut(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return""===t&&(t="0"),"0x"+t}var Bt=n(19371);class Dt{constructor(e){(0,Bt.A)(this,"name",void 0),We(this,{name:e})}clone(){return new Dt(this.name)}}class jt extends Dt{constructor(e,t){null==e&&(e=0),super("org.ethers.network.plugins.GasCost#".concat(e||0)),(0,Bt.A)(this,"effectiveBlock",void 0),(0,Bt.A)(this,"txBase",void 0),(0,Bt.A)(this,"txCreate",void 0),(0,Bt.A)(this,"txDataZero",void 0),(0,Bt.A)(this,"txDataNonzero",void 0),(0,Bt.A)(this,"txAccessListStorageKey",void 0),(0,Bt.A)(this,"txAccessListAddress",void 0);const n={effectiveBlock:e};function r(e,r){let i=(t||{})[e];null==i&&(i=r),Je("number"===typeof i,"invalud value for ".concat(e),"costs",t),n[e]=i}r("txBase",21e3),r("txCreate",32e3),r("txDataZero",4),r("txDataNonzero",16),r("txAccessListStorageKey",1900),r("txAccessListAddress",2400),We(this,n)}clone(){return new jt(this.effectiveBlock,this)}}class Ft extends Dt{constructor(e,t){super("org.ethers.plugins.network.Ens"),(0,Bt.A)(this,"address",void 0),(0,Bt.A)(this,"targetNetwork",void 0),We(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==t?1:t})}clone(){return new Ft(this.address,this.targetNetwork)}}var zt=new WeakMap,Wt=new WeakMap;class qt extends Dt{get url(){return ee(zt,this)}get processFunc(){return ee(Wt,this)}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),X(this,zt,void 0),X(this,Wt,void 0),te(zt,this,e),te(Wt,this,t)}clone(){return this}}const Ht=new Map;
2var Vt=new WeakMap,Gt=new WeakMap,Kt=new WeakMap;class Jt{constructor(e,t){X(this,Vt,void 0),X(this,Gt,void 0),X(this,Kt,void 0),te(Vt,this,e),te(Gt,this,Ct(t)),te(Kt,this,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return ee(Vt,this)}set name(e){te(Vt,this,e)}get chainId(){return ee(Gt,this)}set chainId(e){te(Gt,this,Ct(e,"chainId"))}matches(e){if(null==e)return!1;if("string"===typeof e){try{return this.chainId===Ct(e)}catch(t){}return this.name===e}if("number"===typeof e||"bigint"===typeof e){try{return this.chainId===Ct(e)}catch(t){}return!1}if("object"===typeof e){if(null!=e.chainId){try{return this.chainId===Ct(e.chainId)}catch(t){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(ee(Kt,this).values())}attachPlugin(e){if(ee(Kt,this).get(e.name))throw new Error("cannot replace existing plugin: ".concat(e.name," "));return ee(Kt,this).set(e.name,e.clone()),this}getPlugin(e){return ee(Kt,this).get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new Jt(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new jt;let n=t.txBase;if(null==e.to&&(n+=t.txCreate),e.data)for(let r=2;r<e.data.length;r+=2)"00"===e.data.substring(r,r+2)?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){const r=_t(e.accessList);for(const e in r)n+=t.txAccessListAddress+t.txAccessListStorageKey*r[e].storageKeys.length}return n}static from(e){if(function(){if(Yt)return;function e(e,t,n){const r=function(){const r=new Jt(e,t);return null!=n.ensNetwork&&r.attachPlugin(new Ft(null,n.ensNetwork)),r.attachPlugin(new jt),(n.plugins||[]).forEach(e=>{r.attachPlugin(e)}),r};Jt.register(e,r),Jt.register(t,r),n.altNames&&n.altNames.forEach(e=>{Jt.register(e,r)})}Yt=!0,e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[Qt("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Qt("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1})}(),null==e)return Jt.from("mainnet");if("number"===typeof e&&(e=BigInt(e)),"string"===typeof e||"bigint"===typeof e){const t=Ht.get(e);if(t)return t();if("bigint"===typeof e)return new Jt("unknown",e);Je(!1,"unknown network","network",e)}if("function"===typeof e.clone){return e.clone()}if("object"===typeof e){Je("string"===typeof e.name&&"number"===typeof e.chainId,"invalid network object name or chainId","network",e);const t=new Jt(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&t.attachPlugin(new Ft(e.ensAddress,e.ensNetwork)),t}Je(!1,"invalid network","network",e)}static register(e,t){"number"===typeof e&&(e=BigInt(e));const n=Ht.get(e);n&&Je(!1,"conflicting network for ".concat(JSON.stringify(n.name)),"nameOrChainId",e),Ht.set(e,t)}}function Zt(e,t){const n=String(e);if(!n.match(/^[0-9.]+$/))throw new Error("invalid gwei value: ".concat(e));const r=n.split(".");if(1===r.length&&r.push(""),2!==r.length)throw new Error("invalid gwei value: ".concat(e));for(;r[1].length<t;)r[1]+="0";if(r[1].length>9){let e=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||e++,r[1]=e.toString()}return BigInt(r[0]+r[1])}function Qt(e){return new qt(e,async(e,t,n)=>{let r;n.setHeader("User-Agent","ethers");try{const[t,i]=await Promise.all([n.send(),e()]);r=t;const s=r.bodyJson.standard;return{gasPrice:i.gasPrice,maxFeePerGas:Zt(s.maxFee,9),maxPriorityFeePerGas:Zt(s.maxPriorityFee,9)}}catch(i){Ke(!1,"error encountered with polygon gas station (".concat(JSON.stringify(n.url),")"),"SERVER_ERROR",{request:n,response:r,error:i})}})}let Yt=!1;function Xt(e,t){Y(e,t),t.add(e)}const $t=32,en=new Uint8Array($t),tn=["then"],nn={},rn=new WeakMap;function sn(e){return rn.get(e)}function on(e,t){rn.set(e,t)}function an(e,t){const n=new Error("deferred error during ABI decoding triggered accessing ".concat(e));throw n.error=t,n}function cn(e,t,n){return e.indexOf(null)>=0?t.map((e,t)=>e instanceof un?cn(sn(e),e,n):e):e.reduce((e,r,i)=>{let s=t.getValue(r);return r in e||(n&&s instanceof un&&(s=cn(sn(s),s,n)),e[r]=s),e},{})}var ln=new WeakMap;class un extends Array{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0];let i=t[1],s=(t[2]||[]).slice(),o=!0;r!==nn&&(i=t,s=[],o=!1),super(i.length),X(this,ln,void 0),i.forEac
2h((e,t)=>{this[t]=e});const a=s.reduce((e,t)=>("string"===typeof t&&e.set(t,(e.get(t)||0)+1),e),new Map);if(on(this,Object.freeze(i.map((e,t)=>{const n=s[t];return null!=n&&1===a.get(n)?n:null}))),te(ln,this,[]),null==ee(ln,this)&&ee(ln,this),!o)return;Object.freeze(this);const c=new Proxy(this,{get:(e,t,n)=>{if("string"===typeof t){if(t.match(/^[0-9]+$/)){const n=Rt(t,"%index");if(n<0||n>=this.length)throw new RangeError("out of result range");const r=e[n];return r instanceof Error&&an("index ".concat(n),r),r}if(tn.indexOf(t)>=0)return Reflect.get(e,t,n);const r=e[t];if(r instanceof Function)return function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return r.apply(this===n?e:this,i)};if(!(t in e))return e.getValue.apply(this===n?e:this,[t])}return Reflect.get(e,t,n)}});return on(c,sn(this)),c}toArray(e){const t=[];return this.forEach((n,r)=>{n instanceof Error&&an("index ".concat(r),n),e&&n instanceof un&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){const t=sn(this);return t.reduce((n,r,i)=>(Ke(null!=r,"value at index ".concat(i," unnamed"),"UNSUPPORTED_OPERATION",{operation:"toObject()"}),cn(t,this,e)),{})}slice(e,t){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==t&&(t=this.length),t<0&&(t+=this.length)<0&&(t=0),t>this.length&&(t=this.length);const n=sn(this),r=[],i=[];for(let s=e;s<t;s++)r.push(this[s]),i.push(n[s]);return new un(nn,r,i)}filter(e,t){const n=sn(this),r=[],i=[];for(let s=0;s<this.length;s++){const o=this[s];o instanceof Error&&an("index ".concat(s),o),e.call(t,o,s,this)&&(r.push(o),i.push(n[s]))}return new un(nn,r,i)}map(e,t){const n=[];for(let r=0;r<this.length;r++){const i=this[r];i instanceof Error&&an("index ".concat(r),i),n.push(e.call(t,i,r,this))}return n}getValue(e){const t=sn(this).indexOf(e);if(-1===t)return;const n=this[t];return n instanceof Error&&an("property ".concat(JSON.stringify(e)),n.error),n}static fromItems(e,t){return new un(nn,e,t)}}function dn(e){let t=Ut(e);return Ke(t.length<=$t,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:$t,offset:t.length}),t.length!==$t&&(t=et(st([en.slice(t.length%$t),t]))),t}class hn{constructor(e,t,n,r){(0,Bt.A)(this,"name",void 0),(0,Bt.A)(this,"type",void 0),(0,Bt.A)(this,"localName",void 0),(0,Bt.A)(this,"dynamic",void 0),We(this,{name:e,type:t,localName:n,dynamic:r},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){Je(!1,e,this.localName,t)}}var pn=new WeakMap,fn=new WeakMap,gn=new WeakSet;class mn{constructor(){Xt(this,gn),X(this,pn,void 0),X(this,fn,void 0),te(pn,this,[]),te(fn,this,0)}get data(){return st(ee(pn,this))}get length(){return ee(fn,this)}appendWriter(e){return $(gn,this,yn).call(this,et(e.data))}writeBytes(e){let t=et(e);const n=t.length%$t;return n&&(t=et(st([t,en.slice(n)]))),$(gn,this,yn).call(this,t)}writeValue(e){return $(gn,this,yn).call(this,dn(e))}writeUpdatableValue(){const e=ee(pn,this).length;return ee(pn,this).push(en),te(fn,this,ee(fn,this)+$t),t=>{ee(pn,this)[e]=dn(t)}}}function yn(e){return ee(pn,this).push(e),te(fn,this,ee(fn,this)+e.length),e.length}var vn=new WeakMap,wn=new WeakMap,bn=new WeakMap,An=new WeakMap,_n=new WeakMap,xn=new WeakSet;class En{constructor(e,t,n){Xt(this,xn),(0,Bt.A)(this,"allowLoose",void 0),X(this,vn,void 0),X(this,wn,void 0),X(this,bn,void 0),X(this,An,void 0),X(this,_n,void 0),We(this,{allowLoose:!!t}),te(vn,this,et(e)),te(bn,this,0),te(An,this,null),te(_n,this,null!=n?n:1024),te(wn,this,0)}get data(){return it(ee(vn,this))}get dataLength(){return ee(vn,this).length}get consumed(){return ee(wn,this)}get bytes(){return new Uint8Array(ee(vn,this))}subReader(e){const t=new En(ee(vn,this).slice(ee(wn,this)+e),this.allowLoose,ee(_n,this));return te(An,t,this),t}readBytes(e,t){let n=$(xn,this,Sn).call(this,0,e,!!t);return $(xn,this,kn).call(this,e),te(wn,this,ee(wn,this)+n.length),n.slice(0,e)}readValue(){return Nt(this.readBytes($t))}readIndex(){return Rt(Nt(this.readBytes($t)))}}function kn(e){var t;if(ee(An,this))return $(xn,t=ee(An,this),kn).call(t,e);te(bn,this,ee(bn,this)+e),Ke(ee(_n,this)<1||ee(bn,this)<=ee(_n,this)*this.dataLength,"compressed ABI data exceeds inflation ratio of ".concat(ee(_n,this)," ( see: https://github.com/ethers-io/ethers.js/issues/4537 )"),"BUFFER_OVERRUN",{buffer:et(ee(vn,this)),offset:ee(wn,this),length:e,info:{bytesRead:ee(bn,this),dataLength:this.dataLength}})}function Sn(e,t,n){let r=Math.ceil(t/$t)*$t;return ee(wn,this)+r>ee(vn,this).length&&(this.allowLoose&&n&&ee(wn,this)+t<=ee(vn,this).length?r=t:Ke(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:et(ee(vn,this)),length:ee(vn,this).length,offset:ee(wn,this)+r})),ee(vn,this).slice(ee(wn,this),ee(wn,this)+r)}const In={};function Tn(e,t){let n=!1;return t<0&&(n=!0,t*=-1),new Nn(In,"".concat(n?"":"u","int").concat(t),e,{signed:n,width:t})}function Cn(e,t){return new Nn(In,"bytes".concat(t||""),e,{size:t})}const Pn=Symbol.for("_ethers_typed");var On=new WeakMap;class Nn{constructor(e,t,n,r){(0,Bt.A)(this,"type",void 0),(0,Bt.A)(this,"value",void 0),X(this,On,void 0),(0,Bt.A)(this,"_typedSymbol",void 0),null==r&&(r=null),Ye(In,e,"Typed"),We(this,{_typedSymbol:Pn,type:t,value:n}),te(On,this,r),this.format()}format(){if("array"===this.type)throw new Error("");
2if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?"tuple(".concat(this.value.map(e=>e.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 ee(On,this)}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===ee(On,this)?-1:!1===ee(On,this)?this.value.length:null}static from(e,t){return new Nn(In,e,t)}static uint8(e){return Tn(e,8)}static uint16(e){return Tn(e,16)}static uint24(e){return Tn(e,24)}static uint32(e){return Tn(e,32)}static uint40(e){return Tn(e,40)}static uint48(e){return Tn(e,48)}static uint56(e){return Tn(e,56)}static uint64(e){return Tn(e,64)}static uint72(e){return Tn(e,72)}static uint80(e){return Tn(e,80)}static uint88(e){return Tn(e,88)}static uint96(e){return Tn(e,96)}static uint104(e){return Tn(e,104)}static uint112(e){return Tn(e,112)}static uint120(e){return Tn(e,120)}static uint128(e){return Tn(e,128)}static uint136(e){return Tn(e,136)}static uint144(e){return Tn(e,144)}static uint152(e){return Tn(e,152)}static uint160(e){return Tn(e,160)}static uint168(e){return Tn(e,168)}static uint176(e){return Tn(e,176)}static uint184(e){return Tn(e,184)}static uint192(e){return Tn(e,192)}static uint200(e){return Tn(e,200)}static uint208(e){return Tn(e,208)}static uint216(e){return Tn(e,216)}static uint224(e){return Tn(e,224)}static uint232(e){return Tn(e,232)}static uint240(e){return Tn(e,240)}static uint248(e){return Tn(e,248)}static uint256(e){return Tn(e,256)}static uint(e){return Tn(e,256)}static int8(e){return Tn(e,-8)}static int16(e){return Tn(e,-16)}static int24(e){return Tn(e,-24)}static int32(e){return Tn(e,-32)}static int40(e){return Tn(e,-40)}static int48(e){return Tn(e,-48)}static int56(e){return Tn(e,-56)}static int64(e){return Tn(e,-64)}static int72(e){return Tn(e,-72)}static int80(e){return Tn(e,-80)}static int88(e){return Tn(e,-88)}static int96(e){return Tn(e,-96)}static int104(e){return Tn(e,-104)}static int112(e){return Tn(e,-112)}static int120(e){return Tn(e,-120)}static int128(e){return Tn(e,-128)}static int136(e){return Tn(e,-136)}static int144(e){return Tn(e,-144)}static int152(e){return Tn(e,-152)}static int160(e){return Tn(e,-160)}static int168(e){return Tn(e,-168)}static int176(e){return Tn(e,-176)}static int184(e){return Tn(e,-184)}static int192(e){return Tn(e,-192)}static int200(e){return Tn(e,-200)}static int208(e){return Tn(e,-208)}static int216(e){return Tn(e,-216)}static int224(e){return Tn(e,-224)}static int232(e){return Tn(e,-232)}static int240(e){return Tn(e,-240)}static int248(e){return Tn(e,-248)}static int256(e){return Tn(e,-256)}static int(e){return Tn(e,-256)}static bytes1(e){return Cn(e,1)}static bytes2(e){return Cn(e,2)}static bytes3(e){return Cn(e,3)}static bytes4(e){return Cn(e,4)}static bytes5(e){return Cn(e,5)}static bytes6(e){return Cn(e,6)}static bytes7(e){return Cn(e,7)}static bytes8(e){return Cn(e,8)}static bytes9(e){return Cn(e,9)}static bytes10(e){return Cn(e,10)}static bytes11(e){return Cn(e,11)}static bytes12(e){return Cn(e,12)}static bytes13(e){return Cn(e,13)}static bytes14(e){return Cn(e,14)}static bytes15(e){return Cn(e,15)}static bytes16(e){return Cn(e,16)}static bytes17(e){return Cn(e,17)}static bytes18(e){return Cn(e,18)}static bytes19(e){return Cn(e,19)}static bytes20(e){return Cn(e,20)}static bytes21(e){return Cn(e,21)}static bytes22(e){return Cn(e,22)}static bytes23(e){return Cn(e,23)}static bytes24(e){return Cn(e,24)}static bytes25(e){return Cn(e,25)}static bytes26(e){return Cn(e,26)}static bytes27(e){return Cn(e,27)}static bytes28(e){return Cn(e,28)}static bytes29(e){return Cn(e,29)}static bytes30(e){return Cn(e,30)}static bytes31(e){return Cn(e,31)}static bytes32(e){return Cn(e,32)}static address(e){return new Nn(In,"address",e)}static bool(e){return new Nn(In,"bool",!!e)}static bytes(e){return new Nn(In,"bytes",e)}static string(e){return new Nn(In,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Nn(In,"overrides",Object.assign({},e))}
vendor: 5,193 bytes, line 2
2static isTyped(e){return e&&"object"===typeof e&&"_typedSymbol"in e&&e._typedSymbol===Pn}static dereference(e,t){if(Nn.isTyped(e)){if(e.type!==t)throw new Error("invalid type: expecetd ".concat(t,", got ").concat(e.type));return e.value}return e}}class Rn extends hn{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=Nn.dereference(t,"string");try{n=bt(n)}catch(r){return this._throwError(r.message,t)}return e.writeValue(n)}decode(e){return bt(Mt(e.readValue(),20))}}class Mn extends hn{constructor(e){super(e.name,e.type,"_",e.dynamic),(0,Bt.A)(this,"coder",void 0),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function Un(e,t,n){let r=[];if(Array.isArray(n))r=n;else if(n&&"object"===typeof n){let e={};r=t.map(t=>{const r=t.localName;return Ke(r,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:n}),Ke(!e[r],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:n}),e[r]=!0,n[r]})}else Je(!1,"invalid tuple value","tuple",n);Je(t.length===r.length,"types/value length mismatch","tuple",n);let i=new mn,s=new mn,o=[];t.forEach((e,t)=>{let n=r[t];if(e.dynamic){let t=s.length;e.encode(s,n);let r=i.writeUpdatableValue();o.push(e=>{r(e+t)})}else e.encode(i,n)}),o.forEach(e=>{e(i.length)});let a=e.appendWriter(i);return a+=e.appendWriter(s),a}function Ln(e,t){let n=[],r=[],i=e.subReader(0);return t.forEach(t=>{let s=null;if(t.dynamic){let n=e.readIndex(),r=i.subReader(n);try{s=t.decode(r)}catch(o){if(He(o,"BUFFER_OVERRUN"))throw o;s=o,s.baseType=t.name,s.name=t.localName,s.type=t.type}}else try{s=t.decode(e)}catch(o){if(He(o,"BUFFER_OVERRUN"))throw o;s=o,s.baseType=t.name,s.name=t.localName,s.type=t.type}if(void 0==s)throw new Error("investigate");n.push(s),r.push(t.localName||null)}),un.fromItems(n,r)}class Bn extends hn{constructor(e,t,n){super("array",e.type+"["+(t>=0?t:"")+"]",n,-1===t||e.dynamic),(0,Bt.A)(this,"coder",void 0),(0,Bt.A)(this,"length",void 0),We(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){const n=Nn.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let r=this.length;-1===r&&(r=n.length,e.writeValue(n.length)),Ze(n.length,r,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let s=0;s<n.length;s++)i.push(this.coder);return Un(e,i,n)}decode(e){let t=this.length;-1===t&&(t=e.readIndex(),Ke(t*$t<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*$t,length:e.dataLength}));let n=[];for(let r=0;r<t;r++)n.push(new Mn(this.coder));return Ln(e,n)}}class Dn extends hn{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const n=Nn.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class jn extends hn{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=et(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class Fn extends jn{constructor(e){super("bytes",e)}decode(e){return it(super.decode(e))}}class zn extends hn{constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),(0,Bt.A)(this,"size",void 0),We(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let n=et(Nn.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return it(e.readBytes(this.size))}}const Wn=new Uint8Array([]);class qn extends hn{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes(Wn)}decode(e){return e.readBytes(0),null}}const Hn=BigInt(0),Vn=BigInt(1),Gn=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Kn extends hn{constructor(e,t,n){const r=(t?"int":"uint")+8*e;super(r,r,n,!1),(0,Bt.A)(this,"size",void 0),(0,Bt.A)(this,"signed",void 0),We(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=Ct(Nn.dereference(t,this.type)),r=Tt(Gn,256);if(this.signed){let e=Tt(r,8*this.size-1);(n>e||n<-(e+Vn))&&this._throwError("value out-of-bounds",t),n=It(n,256)}else(n<Hn||n>Tt(r,8*this.size))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=Tt(e.readValue(),8*this.size);return this.signed&&(t=St(t,8*this.size)),t}}function Jn(e,t,n,r,i){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let r=t+1;r<n.length&&n[r]>>6===2;r++)e++;return e}return"OVERRUN"===e?n.length-t-1:0}const Zn=Object.freeze({error:function(e,t,n,r,i){Je(!1,"invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",n)},ignore:Jn,replace:function(e,t,n,r,i){return"OVERLONG"===e?(Je("number"===typeof i,"invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),Jn(e,t,n
2))}});function Qn(e,t){null==t&&(t=Zn.error);const n=$e(e,"bytes"),r=[];let i=0;for(;i<n.length;){const e=n[i++];if(e>>7===0){r.push(e);continue}let s=null,o=null;if(192===(224&e))s=1,o=127;else if(224===(240&e))s=2,o=2047;else{if(240!==(248&e)){i+=t(128===(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",i-1,n,r);continue}s=3,o=65535}if(i-1+s>=n.length){i+=t("OVERRUN",i-1,n,r);continue}let a=e&(1<<8-s-1)-1;for(let c=0;c<s;c++){let e=n[i];if(128!=(192&e)){i+=t("MISSING_CONTINUE",i,n,r),a=null;break}a=a<<6|63&e,i++}null!==a&&(a>1114111?i+=t("OUT_OF_RANGE",i-1-s,n,r,a):a>=55296&&a<=57343?i+=t("UTF16_SURROGATE",i-1-s,n,r,a):a<=o?i+=t("OVERLONG",i-1-s,n,r,a):r.push(a))}return r}function Yn(e,t){Je("string"===typeof e,"invalid string value","str",e),null!=t&&(!function(e){Ke(Qe.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}(t),e=e.normalize(t));let n=[];for(let r=0;r<e.length;r++){const t=e.charCodeAt(r);if(t<128)n.push(t);else if(t<2048)n.push(t>>6|192),n.push(63&t|128);else if(55296==(64512&t)){r++;const i=e.charCodeAt(r);Je(r<e.length&&56320===(64512&i),"invalid surrogate pair","str",e);const s=65536+((1023&t)<<10)+(1023&i);n.push(s>>18|240),n.push(s>>12&63|128),n.push(s>>6&63|128),n.push(63&s|128)}else n.push(t>>12|224),n.push(t>>6&63|128),n.push(63&t|128)}return new Uint8Array(n)}function Xn(e,t){return Qn(e,t).map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))).join("")}class $n extends jn{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Yn(Nn.dereference(t,"string")))}decode(e){return Xn(super.decode(e))}}class er extends hn{constructor(e,t){let n=!1;const r=[];e.forEach(e=>{e.dynamic&&(n=!0),r.push(e.type)});super("tuple","tuple("+r.join(",")+")",t,n),(0,Bt.A)(this,"coders",void 0),We(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(t=>{e.push(t.defaultValue())});const t=this.coders.reduce((e,t)=>{const n=t.localName;return n&&(e[n]||(e[n]=0),e[n]++),e},{});return this.coders.forEach((n,r)=>{let i=n.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[r]))}),Object.freeze(e)}encode(e,t){const n=Nn.dereference(t,"tuple");return Un(e,this.coders,n)}decode(e){return Ln(e,this.coders)}}function tr(e){return pt(Yn(e))}var nr;function rr(e){const t=new Set;return e.forEach(e=>t.add(e)),Object.freeze(t)}const ir=rr("external public payable override".split(" ")),sr="constant external internal payable private public pure view override",or=rr(sr.split(" ")),ar="constructor error event fallback function receive struct",cr=rr(ar.split(" ")),lr="calldata memory storage payable indexed",ur=rr(lr.split(" ")),dr=rr([ar,lr,"tuple returns",sr].join(" ").split(" ")),hr={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},pr=new RegExp("^(\\s*)"),fr=new RegExp("^([0-9]+)"),gr=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),mr=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),yr=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var vr=new WeakMap,wr=new WeakMap,br=new WeakSet;class Ar{get offset(){return ee(vr,this)}get length(){return ee(wr,this).length-ee(vr,this)}constructor(e){Xt(this,br),X(this,vr,void 0),X(this,wr,void 0),te(vr,this,0),te(wr,this,e.slice())}clone(){return new Ar(ee(wr,this))}reset(){te(vr,this,0)}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error("expected keyword ".concat(t.text));return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error("expected ".concat(e,"; got ").concat(t.type," ").concat(JSON.stringify(t.text)))}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=$(br,this,_r).call(this,ee(vr,this)+1,e.match+1);return te(vr,this,e.match+1),t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;ee(vr,this)<e.match-1;){const e=this.peek().linkNext;t.push($(br,this,_r).call(this,ee(vr,this)+1,e)),te(vr,this,e)}return te(vr,this,e.match+1),t}peek(){if(ee(vr,this)>=ee(wr,this).length)throw new Error("out-of-bounds");return ee(wr,this)[ee(vr,this)]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){var e;const t=this.peek();return te(vr,this,(e=ee(vr,this),e++,e)),t}toString(){const e=[];for(let t=ee(vr,this);t<ee(wr,this).length;t++){const n=ee(wr,this)[t];e.push("".concat(n.type,":").concat(n.text))}return"<TokenString ".concat(e.join(" "),">")}}function _r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new nr(ee(wr,this).slice(e,t).map(t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e}))))}function xr(e){const t=[],n=t=>{const n=s<e.length?JSON.stringify(e[s]):"$EOI";throw new Error("invalid token ".concat(n," at ").concat(s,": ").concat(t))};let r=[],i=[],s=0;for(;s<e.length;){let o=e.substring(s),a=o.match(pr);a&&(s+=a[1].length,o=e.substring(s));const c={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};t.push(c);let l=hr[o[0]]||"";if(l){if(c.type=l,c.text=o[0],s++,"OPEN_PAREN"===l)r.push(t.length-1),i.push(t.length-1);else if("CLOSE_PAREN"==l)0===r.length&&n("no matching open bracket"),c.match=r.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=i.pop(),t[c.linkBack].linkNext=t.length-1;else if("COMMA"===l)c.linkBack=i.pop(),t[c.linkBack].linkNext=t.length-1,i.push(t.length-1);else if("OPEN_BRACKET"===l)c.type="BRACKET";else if("CLOSE_BRACKET"===l){let e=t.pop().text;if(t.length>0&&"NUMBER"===t[t.length-1].type){const n=t.pop().text;e=n+e,t[t.length-1].value=Rt(n)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(a=o.match(gr),a){if(c.text=a[1],s+=c.text.length,dr.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(yr)){c.type="TYPE";continue}c.type="ID"}else{if(a=o.match(fr),!a)throw new Error("unexpected token ".concat(JSON.stringify(o[0])," at position ").concat(s));c.text=a[1],c.type="NUMBER",s+=c.text.length}}return new Ar(t.map(e=>Object.freeze(e)))}function Er(e,t){let n=[];for(const r in t.keys())e.has(r)&&n.push(r);if(n.length>1)throw new Error("conflicting types: ".concat(n.join(", ")))}function kr(e,t){if(t.peekKeyword(cr)){const n=t.pop().text;if(n!==e)throw new Error("expected ".concat(e,", got ").concat(n))}return t.popType("ID")}function Sr(e,t){const n=new Set;for(;;
vendor: 5,076 bytes, line 2
2){const r=e.peekType("KEYWORD");if(null==r||t&&!t.has(r))break;if(e.pop(),n.has(r))throw new Error("duplicate keywords: ".concat(JSON.stringify(r)));n.add(r)}return Object.freeze(n)}function Ir(e){let t=Sr(e,or);return Er(t,rr("constant payable nonpayable".split(" "))),Er(t,rr("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function Tr(e,t){return e.popParams().map(e=>qr.from(e,t))}function Cr(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return Ct(e.pop().text);throw new Error("invalid gas")}return null}function Pr(e){if(e.length)throw new Error("unexpected tokens at offset ".concat(e.offset,": ").concat(e.toString()))}nr=Ar;const Or=new RegExp(/^(.*)\[([0-9]*)\]$/);function Nr(e){const t=e.match(yr);if(Je(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const n=parseInt(t[2]);Je(0!==n&&n<=32,"invalid bytes length","type",e)}else if(t[3]){const n=parseInt(t[3]);Je(0!==n&&n<=256&&n%8===0,"invalid numeric width","type",e)}return e}const Rr={},Mr=Symbol.for("_ethers_internal"),Ur="_ParamTypeInternal",Lr="_ErrorInternal",Br="_EventInternal",Dr="_ConstructorInternal",jr="_FallbackInternal",Fr="_FunctionInternal",zr="_StructInternal";var Wr=new WeakSet;class qr{constructor(e,t,n,r,i,s,o,a){if(Xt(this,Wr),(0,Bt.A)(this,"name",void 0),(0,Bt.A)(this,"type",void 0),(0,Bt.A)(this,"baseType",void 0),(0,Bt.A)(this,"indexed",void 0),(0,Bt.A)(this,"components",void 0),(0,Bt.A)(this,"arrayLength",void 0),(0,Bt.A)(this,"arrayChildren",void 0),Ye(e,Rr,"ParamType"),Object.defineProperty(this,Mr,{value:Ur}),s&&(s=Object.freeze(s.slice())),"array"===r){if(null==o||null==a)throw new Error("")}else if(null!=o||null!=a)throw new Error("");if("tuple"===r){if(null==s)throw new Error("")}else if(null!=s)throw new Error("");We(this,{name:t,type:n,baseType:r,indexed:i,components:s,arrayLength:o,arrayChildren:a})}format(e){if(null==e&&(e="sighash"),"json"===e){const t=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=t,e.type+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]"),JSON.stringify(e)}const n={type:"tuple"===this.baseType?"tuple":this.type,name:t};return"boolean"===typeof this.indexed&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(n)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]")):this.isTuple()?t+="("+this.components.map(t=>t.format(e)).join("full"===e?", ":",")+")":t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){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 n=this;return e.map(e=>n.arrayChildren.walk(e,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((e,r)=>n.components[r].walk(e,t))}return t(this.type,e)}async walkAsync(e,t){const n=[],r=[e];return $(Wr,this,Hr).call(this,n,e,t,e=>{r[0]=e}),n.length&&await Promise.all(n),r[0]}static from(e,t){if(qr.isParamType(e))return e;if("string"===typeof e)try{return qr.from(xr(e),t)}catch(o){Je(!1,"invalid param type","obj",e)}else if(e instanceof Ar){let n="",r="",i=null;Sr(e,rr(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(r="tuple",i=e.popParams().map(e=>qr.from(e)),n="tuple(".concat(i.map(e=>e.format()).join(","),")")):(n=Nr(e.popType("TYPE")),r=n);let s=null,o=null;for(;e.length&&e.peekType("BRACKET");){const t=e.pop();s=new qr(Rr,"",n,r,null,i,o,s),o=t.value,n+=t.text,r="array",i=null}let a=null;if(Sr(e,ur).has("indexed")){if(!t)throw new Error("");a=!0}const c=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new qr(Rr,c,n,r,a,i,o,s)}const n=e.name;Je(!n||"string"===typeof n&&n.match(mr),"invalid name","obj.name",n);let r=e.indexed;null!=r&&(Je(t,"parameter cannot be indexed","obj.indexed",e.indexed),r=!!r);let i=e.type,s=i.match(Or);if(s){const t=parseInt(s[2]||"-1"),o=qr.from({type:s[1],components:e.components});return new qr(Rr,n||"",i,"array",r,null,t,o)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const t=null!=e.components?e.components.map(e=>qr.from(e)):null;return new qr(Rr,n||"",i,"tuple",r,t,null,null)}return i=Nr(e.type),new qr(Rr,n||"",i,i,r,null,null,null)}static isParamType(e){return e&&e[Mr]===Ur}}function Hr(e,t,n,r){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 i=this.arrayChildren,s=t.slice();
2return s.forEach((t,r)=>{$(Wr,i,Hr).call(i,e,t,n,e=>{s[r]=e})}),void r(s)}if(this.isTuple()){const i=this.components;let s;if(Array.isArray(t))s=t.slice();else{if(null==t||"object"!==typeof t)throw new Error("invalid tuple value");s=i.map(e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error("missing value for component ".concat(e.name));return t[e.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");return s.forEach((t,r)=>{var o;$(Wr,o=i[r],Hr).call(o,e,t,n,e=>{s[r]=e})}),void r(s)}const i=n(this.type,t);i.then?e.push(async function(){r(await i)}()):r(i)}class Vr{constructor(e,t,n){(0,Bt.A)(this,"type",void 0),(0,Bt.A)(this,"inputs",void 0),Ye(e,Rr,"Fragment"),We(this,{type:t,inputs:n=Object.freeze(n.slice())})}static from(e){if("string"===typeof e){try{Vr.from(JSON.parse(e))}catch(t){}return Vr.from(xr(e))}if(e instanceof Ar){switch(e.peekKeyword(cr)){case"constructor":return Qr.from(e);case"error":return Jr.from(e);case"event":return Zr.from(e);case"fallback":case"receive":return Yr.from(e);case"function":return Xr.from(e);case"struct":return $r.from(e)}}else if("object"===typeof e){switch(e.type){case"constructor":return Qr.from(e);case"error":return Jr.from(e);case"event":return Zr.from(e);case"fallback":case"receive":return Yr.from(e);case"function":return Xr.from(e);case"struct":return $r.from(e)}Ke(!1,"unsupported type: ".concat(e.type),"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Je(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Qr.isFragment(e)}static isError(e){return Jr.isFragment(e)}static isEvent(e){return Zr.isFragment(e)}static isFunction(e){return Xr.isFragment(e)}static isStruct(e){return $r.isFragment(e)}}class Gr extends Vr{constructor(e,t,n,r){super(e,t,r),(0,Bt.A)(this,"name",void 0),Je("string"===typeof n&&n.match(mr),"invalid identifier","name",n),r=Object.freeze(r.slice()),We(this,{name:n})}}function Kr(e,t){return"("+t.map(t=>t.format(e)).join("full"===e?", ":",")+")"}class Jr extends Gr{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,Mr,{value:Lr})}get selector(){return tr(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("error"),t.push(this.name+Kr(e,this.inputs)),t.join(" ")}static from(e){if(Jr.isFragment(e))return e;if("string"===typeof e)return Jr.from(xr(e));if(e instanceof Ar){const t=kr("error",e),n=Tr(e);return Pr(e),new Jr(Rr,t,n)}return new Jr(Rr,e.name,e.inputs?e.inputs.map(qr.from):[])}static isFragment(e){return e&&e[Mr]===Lr}}class Zr extends Gr{constructor(e,t,n,r){super(e,"event",t,n),(0,Bt.A)(this,"anonymous",void 0),Object.defineProperty(this,Mr,{value:Br}),We(this,{anonymous:r})}get topicHash(){return tr(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("event"),t.push(this.name+Kr(e,this.inputs)),"sighash"!==e&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){t=(t||[]).map(e=>qr.from(e));return new Zr(Rr,e,t,!1).topicHash}static from(e){if(Zr.isFragment(e))return e;if("string"===typeof e)try{return Zr.from(xr(e))}catch(t){Je(!1,"invalid event fragment","obj",e)}else if(e instanceof Ar){const t=kr("event",e),n=Tr(e,!0),r=!!Sr(e,rr(["anonymous"])).has("anonymous");return Pr(e),new Zr(Rr,t,n,r)}return new Zr(Rr,e.name,e.inputs?e.inputs.map(e=>qr.from(e,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[Mr]===Br}}class Qr extends Vr{constructor(e,t,n,r,i){super(e,t,n),(0,Bt.A)(this,"payable",void 0),(0,Bt.A)(this,"gas",void 0),Object.defineProperty(this,Mr,{value:Dr}),We(this,{payable:r,gas:i})}format(e){if(Ke(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=["constructor".concat(Kr(e,this.inputs))];return this.payable&&t.push("payable"),null!=this.gas&&t.push("@".concat(this.gas.toString())),t.join(" ")}static from(e){if(Qr.isFragment(e))return e;if("string"===typeof e)try{return Qr.from(xr(e))}catch(t){Je(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Ar){Sr(e,rr(["constructor"]));const t=Tr(e),n=!!Sr(e,ir).has("payable"),r=Cr(e);return Pr(e),new Qr(Rr,"constructor",t,n,r)}return new Qr(Rr,"constructor",e.inputs?e.inputs.map(qr.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[Mr]===Dr}}class Yr extends Vr{constructor(e,t,n){super(e,"fallback",t),(0,Bt.A)(this,"payable",void 0),Object.defineProperty(this,Mr,{value:jr}),We(this,{payable:n})}format(e){const t=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:e})}return"".concat(t,"()").concat(this.payable?" payable":"")}static from(e){if(Yr.isFragment(e))return e;if("string"===typeof e)try{return Yr.from(xr(e))}catch(t){Je(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Ar){const t=e.toString();Je(e.peekKeyword(rr(["fallback","receive"])),"type must be fallback or receive","obj",t);if("receive"===e.popKeyword(rr(["fallback","receive"]))){const t=Tr(e);return Je(0===t.length,"receive cannot have arguments","obj.inputs",t),Sr(e,rr(["payable"])),Pr(e),new Yr(Rr,[],!0)}let n=Tr(e);
2n.length?Je(1===n.length&&"bytes"===n[0].type,"invalid fallback inputs","obj.inputs",n.map(e=>e.format("minimal")).join(", ")):n=[qr.from("bytes")];const r=Ir(e);if(Je("nonpayable"===r||"payable"===r,"fallback cannot be constants","obj.stateMutability",r),Sr(e,rr(["returns"])).has("returns")){const t=Tr(e);Je(1===t.length&&"bytes"===t[0].type,"invalid fallback outputs","obj.outputs",t.map(e=>e.format("minimal")).join(", "))}return Pr(e),new Yr(Rr,n,"payable"===r)}if("receive"===e.type)return new Yr(Rr,[],!0);if("fallback"===e.type){const t=[qr.from("bytes")],n="payable"===e.stateMutability;return new Yr(Rr,t,n)}Je(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[Mr]===jr}}class Xr extends Gr{constructor(e,t,n,r,i,s){super(e,"function",t,r),(0,Bt.A)(this,"constant",void 0),(0,Bt.A)(this,"outputs",void 0),(0,Bt.A)(this,"stateMutability",void 0),(0,Bt.A)(this,"payable",void 0),(0,Bt.A)(this,"gas",void 0),Object.defineProperty(this,Mr,{value:Fr});We(this,{constant:"view"===n||"pure"===n,gas:s,outputs:i=Object.freeze(i.slice()),payable:"payable"===n,stateMutability:n})}get selector(){return tr(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),outputs:this.outputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("function"),t.push(this.name+Kr(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Kr(e,this.outputs))),null!=this.gas&&t.push("@".concat(this.gas.toString()))),t.join(" ")}static getSelector(e,t){t=(t||[]).map(e=>qr.from(e));return new Xr(Rr,e,"view",t,[],null).selector}static from(e){if(Xr.isFragment(e))return e;if("string"===typeof e)try{return Xr.from(xr(e))}catch(n){Je(!1,"invalid function fragment","obj",e)}else if(e instanceof Ar){const t=kr("function",e),n=Tr(e),r=Ir(e);let i=[];Sr(e,rr(["returns"])).has("returns")&&(i=Tr(e));const s=Cr(e);return Pr(e),new Xr(Rr,t,r,n,i,s)}let t=e.stateMutability;return null==t&&(t="payable","boolean"===typeof e.constant?(t="view",e.constant||(t="payable","boolean"!==typeof e.payable||e.payable||(t="nonpayable"))):"boolean"!==typeof e.payable||e.payable||(t="nonpayable")),new Xr(Rr,e.name,t,e.inputs?e.inputs.map(qr.from):[],e.outputs?e.outputs.map(qr.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[Mr]===Fr}}class $r extends Gr{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,Mr,{value:zr})}format(){throw new Error("@TODO")}static from(e){if("string"===typeof e)try{return $r.from(xr(e))}catch(t){Je(!1,"invalid struct fragment","obj",e)}else if(e instanceof Ar){const t=kr("struct",e),n=Tr(e);return Pr(e),new $r(Rr,t,n)}return new $r(Rr,e.name,e.inputs?e.inputs.map(qr.from):[])}static isFragment(e){return e&&e[Mr]===zr}}const ei=new Map;ei.set(0,"GENERIC_PANIC"),ei.set(1,"ASSERT_FALSE"),ei.set(17,"OVERFLOW"),ei.set(18,"DIVIDE_BY_ZERO"),ei.set(33,"ENUM_RANGE_ERROR"),ei.set(34,"BAD_STORAGE_DATA"),ei.set(49,"STACK_UNDERFLOW"),ei.set(50,"ARRAY_RANGE_ERROR"),ei.set(65,"OUT_OF_MEMORY"),ei.set(81,"UNINITIALIZED_FUNCTION_CALL");const ti=new RegExp(/^bytes([0-9]*)$/),ni=new RegExp(/^(u?int)([0-9]*)$/);let ri=null,ii=1024;var si=new WeakSet;class oi{constructor(){Xt(this,si)}getDefaultValue(e){const t=e.map(e=>$(si,this,ai).call(this,qr.from(e)));return new er(t,"_").defaultValue()}encode(e,t){Ze(t.length,e.length,"types/values length mismatch");const n=e.map(e=>$(si,this,ai).call(this,qr.from(e))),r=new er(n,"_"),i=new mn;return r.encode(i,t),i.data}decode(e,t,n){const r=e.map(e=>$(si,this,ai).call(this,qr.from(e)));return new er(r,"_").decode(new En(t,n,ii))}static _setDefaultMaxInflation(e){Je("number"===typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),ii=e}static defaultAbiCoder(){return null==ri&&(ri=new oi),ri}static getBuiltinCallException(e,t,n){return function(e,t,n,r){let i="missing revert data",s=null,o=null;if(n){i="execution reverted";const e=$e(n);if(n=it(n),0===e.length)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(e.length%32!==4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===it(e.slice(0,4)))try{s=r.decode(["string"],e.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[s]},i+=": ".concat(JSON.stringify(s))}catch(c){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===it(e.slice(0,4)))try{const t=Number(r.decode(["uint256"],e.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[t]},s="Panic due to ".concat(ei.get(t)||"UNKNOWN","(").concat(t,")"),i+=": ".concat(s)}catch(c){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const a={to:t.to?bt(t.to):null,data:t.data||"0x"};return t.from&&(a.from=bt(t.from)),Ge(i,"CALL_EXCEPTION",{action:e,data:n,reason:s,transaction:a,invocation:null,revert:o})}(e,t,n,oi.defaultAbiCoder())}}function ai(e){if(e.isArray())return new Bn($(si,this,ai).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new er(e.components.map(e=>$(si,this,ai).call(this,e)),e.name);switch(e.baseType){case"address":return new Rn(e.name);case"bool":return new Dn(e.name);case"string":return new $n(e.name);case"bytes":return new Fn(e.name);case"":return new qn(e.name)}let t=e.type.match(ni);if(t){let n=parseInt(t[2]||"256");return Je(0!==n&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new
2Kn(n/8,"int"===t[1],e.name)}if(t=e.type.match(ti),t){let n=parseInt(t[1]);return Je(0!==n&&n<=32,"invalid bytes length","param",e),new zn(n,e.name)}Je(!1,"invalid type","type",e.type)}function ci(e){return e&&"function"===typeof e.getAddress}async function li(e,t){const n=await t;return null!=n&&"0x0000000000000000000000000000000000000000"!==n||(Ke("string"!==typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),Je(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),bt(n)}function ui(e,t){return"string"===typeof e?e.match(/^0x[0-9a-f]{40}$/i)?bt(e):(Ke(null!=t,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),li(e,t.resolveName(e))):ci(e)?li(e,e.getAddress()):e&&"function"===typeof e.then?li(e,e):void Je(!1,"unsupported addressable value","target",e)}const di=new Uint8Array(32);di.fill(0);const hi=BigInt(-1),pi=BigInt(0),fi=BigInt(1),gi=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const mi=Mt(fi,32),yi=Mt(pi,32),vi={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},wi=["name","version","chainId","verifyingContract","salt"];function bi(e){return function(t){return Je("string"===typeof t,"invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}const Ai={name:bi("name"),version:bi("version"),chainId:function(e){const t=Ct(e,"domain.chainId");return Je(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):Lt(t)},verifyingContract:function(e){try{return bt(e).toLowerCase()}catch(t){}Je(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=$e(e,"domain.salt");return Je(32===t.length,'invalid domain value "salt"',"domain.salt",e),it(t)}};function _i(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const n=""===t[1],r=parseInt(t[2]);Je(r%8===0&&0!==r&&r<=256&&t[2]===String(r),"invalid numeric width","type",e);const i=Tt(gi,n?r-1:r),s=n?(i+fi)*hi:pi;return function(t){const r=Ct(t,"value");return Je(r>=s&&r<=i,"value out-of-bounds for ".concat(e),"value",r),Mt(n?It(r,256):r,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const n=parseInt(t[1]);return Je(0!==n&&n<=32&&t[1]===String(n),"invalid bytes width","type",e),function(t){return Je($e(t).length===n,"invalid length for ".concat(e),"value",t),function(e){const t=$e(e),n=t.length%32;return n?st([t,di.slice(n)]):it(t)}(t)}}}switch(e){case"address":return function(e){return lt(bt(e),32)};case"bool":return function(e){return e?mi:yi};case"bytes":return function(e){return pt(e)};case"string":return function(e){return tr(e)}}return null}function xi(e,t){return"".concat(e,"(").concat(t.map(e=>{let{name:t,type:n}=e;return n+" "+t}).join(","),")")}function Ei(e){const t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}var ki=new WeakMap,Si=new WeakMap,Ii=new WeakMap,Ti=new WeakSet;class Ci{get types(){return JSON.parse(ee(ki,this))}constructor(e){Xt(this,Ti),(0,Bt.A)(this,"primaryType",void 0),X(this,ki,void 0),X(this,Si,void 0),X(this,Ii,void 0),te(Si,this,new Map),te(Ii,this,new Map);const t=new Map,n=new Map,r=new Map,i={};Object.keys(e).forEach(s=>{i[s]=e[s].map(t=>{let{name:n,type:r}=t,{base:i,index:s}=Ei(r);return"int"!==i||e.int||(i="int256"),"uint"!==i||e.uint||(i="uint256"),{name:n,type:i+(s||"")}}),t.set(s,new Set),n.set(s,[]),r.set(s,new Set)}),te(ki,this,JSON.stringify(i));for(const o in i){const r=new Set;for(const s of i[o]){Je(!r.has(s.name),"duplicate variable name ".concat(JSON.stringify(s.name)," in ").concat(JSON.stringify(o)),"types",e),r.add(s.name);const i=Ei(s.type).base;Je(i!==o,"circular type reference to ".concat(JSON.stringify(i)),"types",e);_i(i)||(Je(n.has(i),"unknown type ".concat(JSON.stringify(i)),"types",e),n.get(i).push(o),t.get(o).add(i))}}const s=Array.from(n.keys()).filter(e=>0===n.get(e).length);Je(0!==s.length,"missing primary type","types",e),Je(1===s.length,"ambiguous primary types or unused types: ".concat(s.map(e=>JSON.stringify(e)).join(", ")),"types",e),We(this,{primaryType:s[0]}),function i(s,o){Je(!o.has(s),"circular type reference to ".concat(JSON.stringify(s)),"types",e),o.add(s);
2for(const e of t.get(s))if(n.has(e)){i(e,o);for(const t of o)r.get(t).add(e)}o.delete(s)}(this.primaryType,new Set);for(const[o,a]of r){const e=Array.from(a);e.sort(),ee(Si,this).set(o,xi(o,i[o])+e.map(e=>xi(e,i[e])).join(""))}}getEncoder(e){let t=ee(Ii,this).get(e);return t||(t=$(Ti,this,Pi).call(this,e),ee(Ii,this).set(e,t)),t}encodeType(e){const t=ee(Si,this).get(e);return Je(t,"unknown type: ".concat(JSON.stringify(e)),"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return pt(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(_i(e))return n(e,t);const r=Ei(e).array;if(r)return Je(-1===r.count||r.count===t.length,"array length mismatch; expected length ".concat(r.count),"value",t),t.map(e=>this._visit(r.prefix,e,n));const i=this.types[e];if(i)return i.reduce((e,r)=>{let{name:i,type:s}=r;return e[i]=this._visit(s,t[i],n),e},{});Je(!1,"unknown type: ".concat(e),"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Ci(e)}static getPrimaryType(e){return Ci.from(e).primaryType}static hashStruct(e,t,n){return Ci.from(t).hashStruct(e,n)}static hashDomain(e){const t=[];for(const n in e){if(null==e[n])continue;const r=vi[n];Je(r,"invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",e),t.push({name:n,type:r})}return t.sort((e,t)=>wi.indexOf(e.name)-wi.indexOf(t.name)),Ci.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return st(["0x1901",Ci.hashDomain(e),Ci.from(t).hash(n)])}static hash(e,t,n){return pt(Ci.encode(e,t,n))}static async resolveNames(e,t,n,r){e=Object.assign({},e);for(const o in e)null==e[o]&&delete e[o];const i={};e.verifyingContract&&!tt(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const s=Ci.from(t);s.visit(n,(e,t)=>("address"!==e||tt(t,20)||(i[t]="0x"),t));for(const o in i)i[o]=await r(o);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),{domain:e,value:n=s.visit(n,(e,t)=>"address"===e&&i[t]?i[t]:t)}}static getPayload(e,t,n){Ci.hashDomain(e);const r={},i=[];wi.forEach(t=>{const n=e[t];null!=n&&(r[t]=Ai[t](n),i.push({name:t,type:vi[t]}))});const s=Ci.from(t);t=s.types;const o=Object.assign({},t);return Je(null==o.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=i,s.encode(n),{types:o,domain:r,primaryType:s.primaryType,message:s.visit(n,(e,t)=>{if(e.match(/^bytes(\d*)/))return it($e(t));if(e.match(/^u?int/))return Ct(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return Je("string"===typeof t,"invalid string","value",t),t}Je(!1,"unsupported type","type",e)})}}}function Pi(e){{const t=_i(e);if(t)return t}const t=Ei(e).array;if(t){const e=t.prefix,n=this.getEncoder(e);return r=>{Je(-1===t.count||t.count===r.length,"array length mismatch; expected length ".concat(t.count),"value",r);let i=r.map(n);return ee(Si,this).has(e)&&(i=i.map(pt)),pt(st(i))}}const n=this.types[e];if(n){const t=tr(ee(Si,this).get(e));return e=>{const r=n.map(t=>{let{name:n,type:r}=t;const i=this.getEncoder(r)(e[n]);return ee(Si,this).has(r)?pt(i):i});return r.unshift(t),st(r)}}Je(!1,"unknown type: ".concat(e),"type",e)}const Oi="0x0000000000000000000000000000000000000000000000000000000000000000",Ni=BigInt(0),Ri=BigInt(1),Mi=BigInt(2),Ui=BigInt(27),Li=BigInt(28),Bi=BigInt(35),Di={};function ji(e){return lt(Ut(e),32)}var Fi=new WeakMap,zi=new WeakMap,Wi=new WeakMap,qi=new WeakMap;class Hi{get r(){return ee(Fi,this)}set r(e){Je(32===ot(e),"invalid r","value",e),te(Fi,this,it(e))}get s(){return Je(parseInt(ee(zi,this).substring(0,3))<8,"non-canonical s; use ._s","s",ee(zi,this)),ee(zi,this)}set s(e){Je(32===ot(e),"invalid s","value",e),te(zi,this,it(e))}get _s(){return ee(zi,this)}isValid(){return parseInt(ee(zi,this).substring(0,3))<8}get v(){return ee(Wi,this)}set v(e){const t=Rt(e,"value");Je(27===t||28===t,"invalid v","v",e),te(Wi,this,t)}get networkV(){return ee(qi,this)}get legacyChainId(){const e=this.networkV;return null==e?null:Hi.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=$e(this.s);return this.yParity&&(e[0]|=128),it(e)}get compactSerialized(){return st([this.r,this.yParityAndS])}get serialized(){return st([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,r){X(this,Fi,void 0),X(this,zi,void 0),X(this,Wi,void 0),X(this,qi,void 0),Ye(e,Di,"Signature"),te(Fi,this,t),te(zi,this,n),te(Wi,this,r),te(qi,this,null)}[Symbol.for("nodejs.util.inspect.custom")](){return'Signature { r: "'.concat(this.r,'", s: "').concat(this._s,'"').concat(this.isValid()?"":', valid: "false"',", yParity: ").concat(this.yParity,", networkV: ").concat(this.networkV," }")}clone(){const e=new Hi(Di,this.r,this._s,this.v);return this.networkV&&te(qi,e,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this._s,v:this.v}}static getChainId(e){const t=Ct(e,"v");return t==Ui||t==Li?Ni:(Je(t>=Bi,"invalid EIP-155 v","v",e),(t-Bi)/Mi)}static getChainIdV(e,t){return Ct(e)*Mi+BigInt(35+t-27)}static getNormalizedV(e){const t=Ct(e);return t===Ni||t===Ui?27:t===Ri||t===Li?28:(Je(t>=Bi,"invalid v","v",e),t&Ri?27:28)}static from(e){function t(t,n){Je(t,n,"signature",e)}if(null==e)return new Hi(Di,Oi,Oi,27);if("string"===typeof e){const n=$e(e,"signature");
vendor: 1,054 bytes, line 2
2if(64===n.length){const e=it(n.slice(0,32)),t=n.slice(32,64),r=128&t[0]?28:27;return t[0]&=127,new Hi(Di,e,it(t),r)}if(65===n.length){const e=it(n.slice(0,32)),t=it(n.slice(32,64)),r=Hi.getNormalizedV(n[64]);return new Hi(Di,e,t,r)}t(!1,"invalid raw signature length")}if(e instanceof Hi)return e.clone();const n=e.r;t(null!=n,"missing r");const r=ji(n),i=function(e,n){if(null!=e)return ji(e);if(null!=n){t(tt(n,32),"invalid yParityAndS");const e=$e(n);return e[0]&=127,it(e)}t(!1,"missing s")}(e.s,e.yParityAndS),{networkV:s,v:o}=function(e,n,r){if(null!=e){const t=Ct(e);return{networkV:t>=Bi?t:void 0,v:Hi.getNormalizedV(t)}}if(null!=n)return t(tt(n,32),"invalid yParityAndS"),{v:128&$e(n)[0]?28:27};if(null!=r){switch(Rt(r,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),a=new Hi(Di,r,i,o);return s&&te(qi,a,s),t(null==e.yParity||Rt(e.yParity,"sig.yParity")===a.yParity,"yParity mismatch"),t(null==e.yParityAndS||e.yParityAndS===a.yParityAndS,"yParityAndS mismatch"),a}
2}function Vi(e){return{address:bt(e.address),nonce:Ct(null!=e.nonce?e.nonce:0),chainId:Ct(null!=e.chainId?e.chainId:0),signature:Hi.from(e.signature)}}function Gi(e){return async function(t,n){Ke(null==n||!n.cancelled,"request cancelled before sending","CANCELLED");const r=t.url.split(":")[0].toLowerCase();Ke("http"===r||"https"===r,"unsupported protocol ".concat(r),"UNSUPPORTED_OPERATION",{info:{protocol:r},operation:"request"}),Ke("https"===r||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null;const s=new AbortController,o=setTimeout(()=>{i=Ge("request timeout","TIMEOUT"),s.abort()},t.timeout);n&&n.addListener(()=>{i=Ge("request cancelled","CANCELLED"),s.abort()});const a=Object.assign({},e,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:s.signal});let c;try{c=await fetch(t.url,a)}catch(Ts){if(clearTimeout(o),i)throw i;throw Ts}clearTimeout(o);const l={};c.headers.forEach((e,t)=>{l[t.toLowerCase()]=e});const u=await c.arrayBuffer(),d=null==u?null:new Uint8Array(u);return{statusCode:c.status,statusMessage:c.statusText,headers:l,body:d}}}Gi({});let Ki=Gi();const Ji=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Zi=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Qi=!1;async function Yi(e,t){try{const t=e.match(Ji);if(!t)throw new Error("invalid data");return new Cs(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?function(e){e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return $e(t)}(t[3]):Yn(t[3].replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))))}catch(n){return new Cs(599,"BAD REQUEST (invalid data: URI)",{},null,new As(e))}}function Xi(e){return async function(t,n){try{const n=t.match(Zi);if(!n)throw new Error("invalid link");return new As("".concat(e).concat(n[2]))}catch(r){return new Cs(599,"BAD REQUEST (invalid IPFS URI)",{},null,new As(t))}}}const $i={data:Yi,ipfs:Xi("https://gateway.ipfs.io/ipfs/")},es=new WeakMap;var ts=new WeakMap,ns=new WeakMap;class rs{constructor(e){X(this,ts,void 0),X(this,ns,void 0),te(ts,this,[]),te(ns,this,!1),es.set(e,()=>{if(!ee(ns,this)){te(ns,this,!0);for(const e of ee(ts,this))setTimeout(()=>{e()},0);te(ts,this,[])}})}addListener(e){Ke(!ee(ns,this),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),ee(ts,this).push(e)}get cancelled(){return ee(ns,this)}checkSignal(){Ke(!this.cancelled,"cancelled","CANCELLED",{})}}function is(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}var ss=new WeakMap,os=new WeakMap,as=new WeakMap,cs=new WeakMap,ls=new WeakMap,us=new WeakMap,ds=new WeakMap,hs=new WeakMap,ps=new WeakMap,fs=new WeakMap,gs=new WeakMap,ms=new WeakMap,ys=new WeakMap,vs=new WeakMap,ws=new WeakMap,bs=new WeakSet;class As{get url(){return ee(us,this)}set url(e){te(us,this,String(e))}get body(){return null==ee(ds,this)?null:new Uint8Array(ee(ds,this))}set body(e){if(null==e)te(ds,this,void 0),te(hs,this,void 0);else if("string"===typeof e)te(ds,this,Yn(e)),te(hs,this,"text/plain");else if(e instanceof Uint8Array)te(ds,this,e),te(hs,this,"application/octet-stream");else{if("object"!==typeof e)throw new Error("invalid body");te(ds,this,Yn(JSON.stringify(e))),te(hs,this,"application/json")}}hasBody(){return null!=ee(ds,this)}get method(){return ee(cs,this)?ee(cs,this):this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),te(cs,this,String(e).toUpperCase())}get headers(){const e=Object.assign({},ee(as,this));return ee(ps,this)&&(e.authorization="Basic ".concat(function(e){const t=$e(e);let n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n)}(Yn(ee(ps,this))))),this.allowGzip&&(e["accept-encoding"]="gzip"),null==e["content-type"]&&ee(hs,this)&&(e["content-type"]=ee(hs,this)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){ee(as,this)[String(e).toLowerCase()]=String(t)}clearHeaders(){te(as,this,{})}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const r=t[n++];return{value:[r,e[r]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return ee(ps,this)||null}setCredentials(e,t){Je(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),te(ps,this,"".concat(e,":").concat(t))}get allowGzip(){return ee(os,this)}set allowGzip(e){te(os,this,!!e)}get allowInsecureAuthentication(){return!!ee(ss,this)}set allowInsecureAuthentication(e){te(ss,this,!!e)}get timeout(){return ee(ls,this)}set timeout(e){Je(e>=0,"timeout must be non-zero","timeout",e),te(ls,this,e)}get preflightFunc(){return ee(fs,this)||null}set preflightFunc(e){te(fs,this,e)}get processFunc(){return ee(gs,this)||null}set processFunc(e){te(gs,this,e)}get retryFunc(){return ee(ms,this)||null}set retryFunc(e){te(ms,this,e)}get getUrlFunc(){return ee(ws,this)||Ki}set getUrlFunc(e){te(ws,this,e)}constructor(e){Xt(this,bs),X(this,ss,void 0),X(this,os,void 0),X(this,as,void 0),X(this,cs,void 0),X(this,ls,void 0),X(this,us,void 0),X(this,ds,void 0),X(this,hs,void 0),X(this,ps,void 0),X(this,fs,void 0),X(this,gs,void 0),X(this,ms,void 0),X(this,ys,void 0),X(this,vs,void 0),X(this,ws,void 0),te(us,this,String(e)),te(ss,this,!1),te(os,this,!0),te(as,this,{}),te(cs,this,""),te(ls,this,3e5),te(vs,this,{slotInterval:250,maxAttempts:12}),te(ws,this,null)}toString(){return"<FetchRequest method=".concat(JSON.stringify(this.method)," url=").concat(JSON.stringify(this.url)," headers=").concat(JSON.stringify(this.headers)," body=").concat(ee(ds,this)?it(ee(ds,this)):"null",">")}setThrottleParams(e){null!=e.slotInterval&&(ee(vs,this).slotInterval=e.slotInterval),null!=e.maxAttempts&&(ee(vs,this).maxAttempts=e.maxAttempts)}send(){return Ke(null==ee(ys,this),"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),te(ys,this,new rs(this)),$(bs,this,_s).call(this,0,Ps()+this.timeout,0,this,new Cs(0,"",{},null,this))}cancel(){Ke(null!=ee(ys,this),"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=es.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();Ke("GET"===this.method&&("https"!==t||"http"!==n)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:"redirect(".concat(this.method," ").concat(JSON.stringify(this.url)," => ").concat(JSON.stringify(e),")")});const r=new As(e);return r.method="GET",r.allowGzip=this.allowGzip,r.timeout=this.timeout,te(as,r,Object.assign({},ee(as,this))),ee(ds,this)&&te(ds,r,new Uint8Array(ee(ds,this))),te(hs,r,ee(hs,this)),r}clone(){const e=new As(this.url);return te(cs,e,ee(cs,this)),ee(ds,this)&&te(ds,e,ee(ds,this)),te(hs,e,ee(hs,this)),te(as,e,Object.assign({},ee(as,this))),te(ps,e,ee(ps,this)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),te(fs,e,ee(fs,this)),te(gs,e,ee(gs,this)),te(ms,e,ee(ms,this)),te(vs,e,Object.assign({},ee(vs,this))),te(ws,e,ee(ws,this)),e}static lockConfig(){Qi=!0}static getGateway(e){return $i[e.toLowerCase()]||null}static registerGateway(e,t){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error("cannot intercept ".concat(e,"; use registerGetUrl"));if(Qi)throw new Error("gateways locked");$i[e]=t}static registerGetUrl(e){if(Qi)throw new Error("gateways locked");Ki=e}static createGetUrlFunc(e){return Gi(e)}static createDataGateway(){return Yi}static createIpfsGatewayFunc(e){return Xi(e)}}async function _s(e,t,n,r,i){if(e>=ee(vs,this).maxAttempts)return i.makeServerError("exceeded maximum retry limit");Ke(Ps()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:r}),n>0&&await function(e){return new Promise(t=>setTimeout(t,e))}(n);let s=this.clone();const o=(s.url.split(":")[0]||"").toLowerCase();if(o in $i){const e=await $i[o](s.url,is(ee(ys,r)));if(e instanceof Cs){let t=e;if(this.processFunc){is(ee(ys,r));try{t=await this.processFunc(s,t)}catch(h){null!=h.throttle&&"number"===typeof h.stall||t.makeServerError("error in post-processing function",h).assertOk()}}return t}s=e}this.preflightFunc&&(s=await this.preflightFunc(s));const a=await this.getUrlFunc(s,is(ee(ys,r)));let c=new Cs(a.statusCode,a.statusMessage,a.headers,a.body,r);if(301===c.statusCode||302===c.statusCode){try{var l;const n=c.headers.location||"";return $(bs,l=s.redirect(n),_s).call(l,e+1,t,0,r,c)}catch(h){}return c}if(429===c.statusCode&&(null==this.retryFunc||await this.retryFunc(s,c,e))){var u;const n=c.headers["retry-after"];let i=ee(vs,this).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"===typeof n&&n.match(/^[1-9][0-9]*$/)&&(i=parseInt(n)),$(bs,u=s.clone(),_s).call(u,e+1,t,i,r,c)}if(this.processFunc){is(ee(ys,r));try{c=await this.processFunc(s,c)}catch(h){var d;null!=h.throttle&&"number"===typeof h.stall||c.makeServerError("error in post-processing function",h).assertOk();let n=ee(vs,this).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(n=h.stall),$(bs,d=s.clone(),_s).call(d,e+1,t,n,r,c)}}return c}var xs=new WeakMap,Es=new WeakMap,ks=new WeakMap,Ss=new WeakMap,Is=new WeakMap,Ts=new WeakMap;class Cs{toString(){return"<FetchResponse status=".concat(this.statusCode," body=").concat(ee(Ss,this)?it(ee(Ss,this)):"null",">")}get statusCode(){return ee(xs,this)}get statusMessage(){return ee(Es,this)}get headers(){return Object.assign({},ee(ks,this))}get body(){return null==ee(Ss,this)?null:new Uint8Array(ee(Ss,this))}get bodyText(){try{return null==ee(Ss,this)?"":Xn(ee(Ss,this))}
2catch(e){Ke(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){Ke(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let n=0;return{next:()=>{if(n<t.length){const r=t[n++];return{value:[r,e[r]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,r,i){X(this,xs,void 0),X(this,Es,void 0),X(this,ks,void 0),X(this,Ss,void 0),X(this,Is,void 0),X(this,Ts,void 0),te(xs,this,e),te(Es,this,t),te(ks,this,Object.keys(n).reduce((e,t)=>(e[t.toLowerCase()]=String(n[t]),e),{})),te(Ss,this,null==r?null:new Uint8Array(r)),te(Is,this,i||null),te(Ts,this,{message:""})}makeServerError(e,t){let n;e?n="CLIENT ESCALATED SERVER ERROR (".concat(this.statusCode," ").concat(this.statusMessage,"; ").concat(e,")"):(e="".concat(this.statusCode," ").concat(this.statusMessage),n="CLIENT ESCALATED SERVER ERROR (".concat(e,")"));const r=new Cs(599,n,this.headers,this.body,ee(Is,this)||void 0);return te(Ts,r,{message:e,error:t}),r}throwThrottleError(e,t){null==t?t=-1:Je(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const n=new Error(e||"throttling requests");throw We(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=ee(Ss,this)}get request(){return ee(Is,this)}ok(){return""===ee(Ts,this).message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=ee(Ts,this);""===e&&(e="server response ".concat(this.statusCode," ").concat(this.statusMessage));let n=null;this.request&&(n=this.request.url);let r=null;try{ee(Ss,this)&&(r=Xn(ee(Ss,this)))}catch(i){}Ke(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:r,responseStatus:"".concat(this.statusCode," ").concat(this.statusMessage)}})}}function Ps(){return(new Date).getTime()}const Os="0x0000000000000000000000000000000000000000";class Ns{constructor(e,t,n){(0,Bt.A)(this,"fragment",void 0),(0,Bt.A)(this,"name",void 0),(0,Bt.A)(this,"signature",void 0),(0,Bt.A)(this,"topic",void 0),(0,Bt.A)(this,"args",void 0);const r=e.name,i=e.format();We(this,{fragment:e,name:r,signature:i,topic:t,args:n})}}class Rs{constructor(e,t,n,r){(0,Bt.A)(this,"fragment",void 0),(0,Bt.A)(this,"name",void 0),(0,Bt.A)(this,"args",void 0),(0,Bt.A)(this,"signature",void 0),(0,Bt.A)(this,"selector",void 0),(0,Bt.A)(this,"value",void 0);const i=e.name,s=e.format();We(this,{fragment:e,name:i,args:n,signature:s,selector:t,value:r})}}class Ms{constructor(e,t,n){(0,Bt.A)(this,"fragment",void 0),(0,Bt.A)(this,"name",void 0),(0,Bt.A)(this,"args",void 0),(0,Bt.A)(this,"signature",void 0),(0,Bt.A)(this,"selector",void 0);const r=e.name,i=e.format();We(this,{fragment:e,name:r,args:n,signature:i,selector:t})}}class Us{static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){(0,Bt.A)(this,"hash",void 0),(0,Bt.A)(this,"_isIndexed",void 0),We(this,{hash:e,_isIndexed:!0})}}const Ls={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},Bs={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>"reverted with reason string ".concat(JSON.stringify(e))},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&Ls[e.toString()]&&(t=Ls[e.toString()]),"reverted with panic code 0x".concat(e.toString(16)," (").concat(t,")")}}};var Ds=new WeakMap,js=new WeakMap,Fs=new WeakMap,zs=new WeakMap,Ws=new WeakSet;class qs{constructor(e){Xt(this,Ws),(0,Bt.A)(this,"fragments",void 0),(0,Bt.A)(this,"deploy",void 0),(0,Bt.A)(this,"fallback",void 0),(0,Bt.A)(this,"receive",void 0),X(this,Ds,void 0),X(this,js,void 0),X(this,Fs,void 0),X(this,zs,void 0);let t=[];t="string"===typeof e?JSON.parse(e):e,te(Fs,this,new Map),te(Ds,this,new Map),te(js,this,new Map);const n=[];for(const o of t)try{n.push(Vr.from(o))}catch(s){console.log("[Warning] Invalid Fragment ".concat(JSON.stringify(o),":"),s.message)}We(this,{fragments:Object.freeze(n)});let r=null,i=!1;
2te(zs,this,this.getAbiCoder()),this.fragments.forEach((e,t)=>{let n;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void We(this,{deploy:e});case"fallback":return void(0===e.inputs.length?i=!0:(Je(!r||e.payable!==r.payable,"conflicting fallback fragments","fragments[".concat(t,"]"),e),r=e,i=r.payable));case"function":n=ee(Fs,this);break;case"event":n=ee(js,this);break;case"error":n=ee(Ds,this);break;default:return}const s=e.format();n.has(s)||n.set(s,e)}),this.deploy||We(this,{deploy:Qr.from("constructor()")}),We(this,{fallback:r,receive:i})}format(e){const t=e?"minimal":"full";return this.fragments.map(e=>e.format(t))}formatJson(){const e=this.fragments.map(e=>e.format("json"));return JSON.stringify(e.map(e=>JSON.parse(e)))}getAbiCoder(){return oi.defaultAbiCoder()}getFunctionName(e){const t=$(Ws,this,Hs).call(this,e,null,!1);return Je(t,"no matching function","key",e),t.name}hasFunction(e){return!!$(Ws,this,Hs).call(this,e,null,!1)}getFunction(e,t){return $(Ws,this,Hs).call(this,e,t||null,!0)}forEachFunction(e){const t=Array.from(ee(Fs,this).keys());t.sort((e,t)=>e.localeCompare(t));for(let n=0;n<t.length;n++){const r=t[n];e(ee(Fs,this).get(r),n)}}getEventName(e){const t=$(Ws,this,Vs).call(this,e,null,!1);return Je(t,"no matching event","key",e),t.name}hasEvent(e){return!!$(Ws,this,Vs).call(this,e,null,!1)}getEvent(e,t){return $(Ws,this,Vs).call(this,e,t||null,!0)}forEachEvent(e){const t=Array.from(ee(js,this).keys());t.sort((e,t)=>e.localeCompare(t));for(let n=0;n<t.length;n++){const r=t[n];e(ee(js,this).get(r),n)}}getError(e,t){if(tt(e)){const t=e.toLowerCase();if(Bs[t])return Jr.from(Bs[t].signature);for(const e of ee(Ds,this).values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const t=[];for(const[n,r]of ee(Ds,this))n.split("(")[0]===e&&t.push(r);if(0===t.length)return"Error"===e?Jr.from("error Error(string)"):"Panic"===e?Jr.from("error Panic(uint256)"):null;if(t.length>1){const n=t.map(e=>JSON.stringify(e.format())).join(", ");Je(!1,"ambiguous error description (i.e. ".concat(n,")"),"name",e)}return t[0]}if("Error(string)"===(e=Jr.from(e).format()))return Jr.from("error Error(string)");if("Panic(uint256)"===e)return Jr.from("error Panic(uint256)");const n=ee(Ds,this).get(e);return n||null}forEachError(e){const t=Array.from(ee(Ds,this).keys());t.sort((e,t)=>e.localeCompare(t));for(let n=0;n<t.length;n++){const r=t[n];e(ee(Ds,this).get(r),n)}}_decodeParams(e,t){return ee(zs,this).decode(e,t)}_encodeParams(e,t){return ee(zs,this).encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if("string"===typeof e){const t=this.getError(e);Je(t,"unknown error","fragment",e),e=t}return Je(at(t,0,4)===e.selector,"data signature does not match error ".concat(e.name,"."),"data",t),this._decodeParams(e.inputs,at(t,4))}encodeErrorResult(e,t){if("string"===typeof e){const t=this.getError(e);Je(t,"unknown error","fragment",e),e=t}return st([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if("string"===typeof e){const t=this.getFunction(e);Je(t,"unknown function","fragment",e),e=t}return Je(at(t,0,4)===e.selector,"data signature does not match function ".concat(e.name,"."),"data",t),this._decodeParams(e.inputs,at(t,4))}encodeFunctionData(e,t){if("string"===typeof e){const t=this.getFunction(e);Je(t,"unknown function","fragment",e),e=t}return st([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if("string"===typeof e){const t=this.getFunction(e);Je(t,"unknown function","fragment",e),e=t}let n="invalid length for result data";const r=et(t);if(r.length%32===0)try{return ee(zs,this).decode(e.outputs,r)}catch(i){n="could not decode result data"}Ke(!1,n,"BAD_DATA",{value:it(r),info:{method:e.name,signature:e.format()}})}makeError(e,t){const n=$e(e,"data"),r=oi.getBuiltinCallException("call",t,n);if(r.message.startsWith("execution reverted (unknown custom error)")){const e=it(n.slice(0,4)),t=this.getError(e);
2if(t)try{const e=ee(zs,this).decode(t.inputs,n.slice(4));r.revert={name:t.name,signature:t.format(),args:e},r.reason=r.revert.signature,r.message="execution reverted: ".concat(r.reason)}catch(s){r.message="execution reverted (coult not decode custom error)"}}const i=this.parseTransaction(t);return i&&(r.invocation={method:i.name,signature:i.signature,args:i.args}),r}encodeFunctionResult(e,t){if("string"===typeof e){const t=this.getFunction(e);Je(t,"unknown function","fragment",e),e=t}return it(ee(zs,this).encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if("string"===typeof e){const t=this.getEvent(e);Je(t,"unknown event","eventFragment",e),e=t}Ke(t.length<=e.inputs.length,"too many arguments for ".concat(e.format()),"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const r=(e,t)=>"string"===e.type?tr(t):"bytes"===e.type?pt(it(t)):("bool"===e.type&&"boolean"===typeof t?t=t?"0x01":"0x00":e.type.match(/^u?int/)?t=Mt(t):e.type.match(/^bytes/)?t=ct(t,32,!1):"address"===e.type&&ee(zs,this).encode(["address"],[t]),lt(it(t),32));for(t.forEach((t,i)=>{const s=e.inputs[i];s.indexed?null==t?n.push(null):"array"===s.baseType||"tuple"===s.baseType?Je(!1,"filtering with tuples or arrays not supported","contract."+s.name,t):Array.isArray(t)?n.push(t.map(e=>r(s,e))):n.push(r(s,t)):Je(null==t,"cannot filter non-indexed parameters; must be null","contract."+s.name,t)});n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(e,t){if("string"===typeof e){const t=this.getEvent(e);Je(t,"unknown event","eventFragment",e),e=t}const n=[],r=[],i=[];return e.anonymous||n.push(e.topicHash),Je(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((e,s)=>{const o=t[s];if(e.indexed)if("string"===e.type)n.push(tr(o));else if("bytes"===e.type)n.push(pt(o));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(ee(zs,this).encode([e.type],[o]))}else r.push(e),i.push(o)}),{data:ee(zs,this).encode(r,i),topics:n}}decodeEventLog(e,t,n){if("string"===typeof e){const t=this.getEvent(e);Je(t,"unknown event","eventFragment",e),e=t}if(null!=n&&!e.anonymous){const t=e.topicHash;Je(tt(n[0],32)&&n[0].toLowerCase()===t,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],i=[],s=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(r.push(qr.from({type:"bytes32",name:e.name})),s.push(!0)):(r.push(e),s.push(!1)):(i.push(e),s.push(!1))});const o=null!=n?ee(zs,this).decode(r,st(n)):null,a=ee(zs,this).decode(i,t,!0),c=[],l=[];let u=0,d=0;return e.inputs.forEach((e,t)=>{let n=null;if(e.indexed)if(null==o)n=new Us(null);else if(s[t])n=new Us(o[d++]);else try{n=o[d++]}catch(r){n=r}else try{n=a[u++]}catch(r){n=r}c.push(n),l.push(e.name||null)}),un.fromItems(c,l)}parseTransaction(e){const t=$e(e.data,"tx.data"),n=Ct(null!=e.value?e.value:0,"tx.value"),r=this.getFunction(it(t.slice(0,4)));if(!r)return null;const i=ee(zs,this).decode(r.inputs,t.slice(4));return new Rs(r,r.selector,i,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Ns(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=it(e),n=this.getError(at(t,0,4));if(!n)return null;const r=ee(zs,this).decode(n.inputs,at(t,4));return new Ms(n,n.selector,r)}static from(e){return e instanceof qs?e:"string"===typeof e?new qs(JSON.parse(e)):"function"===typeof e.formatJson?new qs(e.formatJson()):"function"===typeof e.format?new qs(e.format("json")):new qs(e)}}function Hs(e,t,n){if(tt(e)){const t=e.toLowerCase();for(const e of ee(Fs,this).values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const r=[];for(const[t,n]of ee(Fs,this))t.split("(")[0]===e&&r.push(n);if(t){const e=t.length>0?t[t.length-1]:null;let n=t.length,i=!0;Nn.isTyped(e)&&"overrides"===e.type&&(i=!1,n--);for(let t=r.length-1;t>=0;t--){const e=r[t].inputs.length;e===n||i&&e===n-1||r.splice(t,1)}for(let s=r.length-1;s>=0;s--){const e=r[s].inputs;for(let n=0;n<t.length;n++)if(Nn.isTyped(t[n])){if(n>=e.length){if("overrides"===t[n].type)continue;r.splice(s,1);break}if(t[n].type!==e[n].baseType){r.splice(s,1);break}}}}if(1===r.length&&t&&t.length!==r[0].inputs.length){const e=t[t.length-1];(null==e||Array.isArray(e)||"object"!==typeof e)&&r.splice(0,1)}if(0===r.length)return null;if(r.length>1&&n){const t=r.map(e=>JSON.stringify(e.format())).join(", ");Je(!1,"ambiguous function description (i.e. matches ".concat(t,")"),"key",e)}return r[0]}const r=ee(Fs,this).get(Xr.from(e).format());return r||null}function Vs(e,t,n){if(tt(e)){const t=e.toLowerCase();for(const e of ee(js,this).values())if(t===e.topicHash)return e;return null}if(-1===e.indexOf("(")){const r=[];for(const[t,n]of ee(js,this))t.split("(")[0]===e&&r.push(n);if(t){for(let e=r.length-1;e>=0;e--)r[e].inputs.length<t.length&&r.splice(e,1);for(let e=r.length-1;e>=0;e--){const n=r[e].inputs;for(let i=0;i<t.length;i++)if(Nn.isTyped(t[i])&&t[i].type!==n[i].baseType){r.splice(e,1);break}}}if(0===r.length)return null;if(r.length>1&&n){const t=r.map(e=>JSON.stringify(e.format())).join(", ");Je(!1,"ambiguous event description (i.e. matches ".concat(t,")"),"key",e)}return r[0]}const r=ee(js,this).get(Zr.from(e).format());return r||null}const Gs=BigInt(0);function Ks(e){return null==e?null:e}function Js(e){return null==e?null:e.toString()}class Zs{constructor(e,t,n){(0,Bt.A)(this,"gasPrice",void 0),(0,Bt.A)(this,"maxFeePerGas",void 0),(0,Bt.A)(this,"maxPriorityFeePerGas",void 0),We(this,{gasPrice:Ks(e),maxFeePerGas:Ks(t),maxPriorityFeePerGas:Ks(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Js(e),maxFeePerGas:Js(t),maxPriorityFeePerGas:Js(n)}}}function Qs(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=it(e.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)i in e&&null!=e[i]&&(t[i]=Ct(e[i],"request.".concat(i)));const r="type,nonce".split(/,/);for(const i of r)i in e&&null!=e[i]&&(t[i]=Rt(e[i],"request.".concat(i)));return e.accessList&&(t.accessList=_t(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map(e=>nt(e)?it(e):Object.assign({},e))),t}var Ys=new WeakMap;class Xs{constructor(e,t){(0,Bt.A)(this,"provider",void 0),(0,Bt.A)(this,"number",void 0),(0,Bt.A)(this,"hash",void 0),(0,Bt.A)(this,"timestamp",void 0),(0,Bt.A)(this,"parentHash",void 0),(0,Bt.A)(this,"parentBeaconBlockRoot",void 0),(0,Bt.A)(this,"nonce",void 0),(0,Bt.A)(this,"difficulty",void 0),(0,Bt.A)(this,"gasLim
2it",void 0),(0,Bt.A)(this,"gasUsed",void 0),(0,Bt.A)(this,"stateRoot",void 0),(0,Bt.A)(this,"receiptsRoot",void 0),(0,Bt.A)(this,"blobGasUsed",void 0),(0,Bt.A)(this,"excessBlobGas",void 0),(0,Bt.A)(this,"miner",void 0),(0,Bt.A)(this,"prevRandao",void 0),(0,Bt.A)(this,"extraData",void 0),(0,Bt.A)(this,"baseFeePerGas",void 0),X(this,Ys,void 0),te(Ys,this,e.transactions.map(e=>"string"!==typeof e?new ro(e,t):e)),We(this,{provider:t,hash:Ks(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Ks(e.prevRandao),extraData:e.extraData,baseFeePerGas:Ks(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return ee(Ys,this).map(e=>"string"===typeof e?e:e.hash)}get prefetchedTransactions(){const e=ee(Ys,this).slice();return 0===e.length?[]:(Ke("object"===typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:r,gasUsed:i,hash:s,miner:o,prevRandao:a,nonce:c,number:l,parentHash:u,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,timestamp:f,transactions:g}=this;return{_type:"Block",baseFeePerGas:Js(e),difficulty:Js(t),extraData:n,gasLimit:Js(r),gasUsed:Js(i),blobGasUsed:Js(this.blobGasUsed),excessBlobGas:Js(this.excessBlobGas),hash:s,miner:o,prevRandao:a,nonce:c,number:l,parentHash:u,timestamp:f,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:p,transactions:g}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return ee(Ys,this).length}get date(){return null==this.timestamp?null:new Date(1e3*this.timestamp)}async getTransaction(e){let t;if("number"===typeof e)t=ee(Ys,this)[e];else{const n=e.toLowerCase();for(const e of ee(Ys,this)){if("string"===typeof e){if(e!==n)continue;t=e;break}if(e.hash===n){t=e;break}}}if(null==t)throw new Error("no such tx");return"string"===typeof t?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if("number"===typeof e)return t[e];e=e.toLowerCase();for(const n of t)if(n.hash===e)return n;Je(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return{orphan:"drop-block",hash:(e=this).hash,number:e.number};var e}}class $s{constructor(e,t){(0,Bt.A)(this,"provider",void 0),(0,Bt.A)(this,"transactionHash",void 0),(0,Bt.A)(this,"blockHash",void 0),(0,Bt.A)(this,"blockNumber",void 0),(0,Bt.A)(this,"removed",void 0),(0,Bt.A)(this,"address",void 0),(0,Bt.A)(this,"data",void 0),(0,Bt.A)(this,"topics",void 0),(0,Bt.A)(this,"index",void 0),(0,Bt.A)(this,"transactionIndex",void 0),this.provider=t;const n=Object.freeze(e.topics.slice());We(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:n,data:r,index:i,removed:s,topics:o,transactionHash:a,transactionIndex:c}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:r,index:i,removed:s,topics:o,transactionHash:a,transactionIndex:c}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return Ke(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return Ke(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return Ke(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return function(e){return{orphan:"drop-log",log:{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}}}(this)}}var eo=new WeakMap;class to{constructor(e,t){(0,Bt.A)(this,"provider",void 0),(0,Bt.A)(this,"to",void 0),(0,Bt.A)(this,"from",void 0),(0,Bt.A)(this,"contractAddress",void 0),(0,Bt.A)(this,"hash",void 0),(0,Bt.A)(this,"index",void 0),(0,Bt.A)(this,"blockHash",void 0),(0,Bt.A)(this,"blockNumber",void 0),(0,Bt.A)(this,"logsBloom",void 0),(0,Bt.A)(this,"gasUsed",void 0),(0,Bt.A)(this,"blobGasUsed",void 0),(0,Bt.A)(this,"cumulativeGasUsed",void 0),(0,Bt.A)(this,"gasPrice",void 0),(0,Bt.A)(this,"blobGasPrice",void 0),(0,Bt.A)(this,"type",void 0),(0,Bt.A)(this,"status",void 0),(0,Bt.A)(this,"root",void 0),X(this,eo,void 0),te(eo,this,Object.freeze(e.logs.map(e=>new $s(e,t))));let n=Gs;null!=e.effectiveGasPrice?n=e.effectiveGasPrice:null!=e.gasPrice&&(n=e.gasPrice),We(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return ee(eo,this)}toJSON(){const{to:e,from:t,contractAddress:n,hash:r,index:i,blockHash:s,blockNumber:o,logsBloom:a,logs:c,status:l,root:u}=this;return{_type:"TransactionReceipt",blockHash:s,blockNumber:o,contractAddress:n,cumulativeGasUsed:Js(this.cumulativeGasUsed),from:t,gasPrice:Js(this.gasPrice),blobGasUsed:Js(this.blobGasUsed),blobGasPrice:Js(this.blobGasPrice),gasUsed:Js(this.gasUsed),hash:r,index:i,logs:c,logs
2Bloom:a,root:u,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(null==e)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(null==e)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return so(this)}reorderedEvent(e){return Ke(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),io(this,e)}}var no=new WeakMap;class ro{constructor(e,t){(0,Bt.A)(this,"provider",void 0),(0,Bt.A)(this,"blockNumber",void 0),(0,Bt.A)(this,"blockHash",void 0),(0,Bt.A)(this,"index",void 0),(0,Bt.A)(this,"hash",void 0),(0,Bt.A)(this,"type",void 0),(0,Bt.A)(this,"to",void 0),(0,Bt.A)(this,"from",void 0),(0,Bt.A)(this,"nonce",void 0),(0,Bt.A)(this,"gasLimit",void 0),(0,Bt.A)(this,"gasPrice",void 0),(0,Bt.A)(this,"maxPriorityFeePerGas",void 0),(0,Bt.A)(this,"maxFeePerGas",void 0),(0,Bt.A)(this,"maxFeePerBlobGas",void 0),(0,Bt.A)(this,"data",void 0),(0,Bt.A)(this,"value",void 0),(0,Bt.A)(this,"chainId",void 0),(0,Bt.A)(this,"signature",void 0),(0,Bt.A)(this,"accessList",void 0),(0,Bt.A)(this,"blobVersionedHashes",void 0),(0,Bt.A)(this,"authorizationList",void 0),X(this,no,void 0),this.provider=t,this.blockNumber=null!=e.blockNumber?e.blockNumber:null,this.blockHash=null!=e.blockHash?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=null!=e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:null,this.maxFeePerGas=null!=e.maxFeePerGas?e.maxFeePerGas:null,this.maxFeePerBlobGas=null!=e.maxFeePerBlobGas?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=null!=e.accessList?e.accessList:null,this.blobVersionedHashes=null!=e.blobVersionedHashes?e.blobVersionedHashes:null,this.authorizationList=null!=e.authorizationList?e.authorizationList:null,te(no,this,-1)}toJSON(){const{blockNumber:e,blockHash:t,index:n,hash:r,type:i,to:s,from:o,nonce:a,data:c,signature:l,accessList:u,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:u,blockNumber:e,blockHash:t,blobVersionedHashes:d,chainId:Js(this.chainId),data:c,from:o,gasLimit:Js(this.gasLimit),gasPrice:Js(this.gasPrice),hash:r,maxFeePerGas:Js(this.maxFeePerGas),maxPriorityFeePerGas:Js(this.maxPriorityFeePerGas),maxFeePerBlobGas:Js(this.maxFeePerBlobGas),nonce:a,signature:l,to:s,index:n,type:i,value:Js(this.value)}}async getBlock(){let e=this.blockNumber;if(null==e){const t=await this.getTransaction();t&&(e=t.blockNumber)}if(null==e)return null;const t=this.provider.getBlock(e);if(null==t)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(null==this.blockNumber){const{tx:e,blockNumber:t}=await ze({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return null==e||null==e.blockNumber?0:t-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const n=null==e?1:e,r=null==t?0:t;let i=ee(no,this),s=-1,o=-1===i;const a=async()=>{if(o)return null;const{blockNumber:e,nonce:t}=await ze({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(t<this.nonce)return void(i=e);if(o)return null;const r=await this.getTransaction();if(!r||null==r.blockNumber)for(-1===s&&(s=i-3,s<ee(no,this)&&(s=ee(no,this)));s<=e;){if(o)return null;const t=await this.provider.getBlock(s,!0);if(null==t)return;for(const e of t)if(e===this.hash)return;for(let r=0;r<t.length;r++){const s=await t.getTransaction(r);if(s.from===this.from&&s.nonce===this.nonce){if(o)return null;const t=await this.provider.getTransactionReceipt(s.hash);if(null==t)return;if(e-t.blockNumber+1<n)return;let r="replaced";s.data===this.data&&s.to===this.to&&s.value===this.value?r="repriced":"0x"===s.data&&s.from===s.to&&s.value===Gs&&(r="cancelled"),Ke(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:"replaced"===r||"cancelled"===r,reason:r,replacement:s.replaceableTransaction(i),hash:s.hash,receipt:t})}}s++}},c=e=>{if(null==e||0!==e.status)return e;Ke(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},l=await this.provider.getTransactionReceipt(this.hash);if(0===n)return c(l);if(l){if(1===n||await l.confirmations()>=n)return c(l)}else if(await a(),0===n)return null;const u=new Promise((e,t)=>
2{const s=[],l=()=>{s.forEach(e=>e())};if(s.push(()=>{o=!0}),r>0){const e=setTimeout(()=>{l(),t(Ge("wait for transaction timeout","TIMEOUT"))},r);s.push(()=>{clearTimeout(e)})}const u=async r=>{if(await r.confirmations()>=n){l();try{e(c(r))}catch(i){t(i)}}};if(s.push(()=>{this.provider.off(this.hash,u)}),this.provider.on(this.hash,u),i>=0){const e=async()=>{try{await a()}catch(n){if(He(n,"TRANSACTION_REPLACED"))return l(),void t(n)}o||this.provider.once("block",e)};s.push(()=>{this.provider.off("block",e)}),this.provider.once("block",e)}});return await u}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return Ke(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),so(this)}reorderedEvent(e){return Ke(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ke(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),io(this,e)}replaceableTransaction(e){Je(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new ro(this,this.provider);return te(no,t,e),t}}function io(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function so(e){return{orphan:"drop-transaction",tx:e}}var oo=new WeakMap;class ao{constructor(e,t,n){(0,Bt.A)(this,"filter",void 0),(0,Bt.A)(this,"emitter",void 0),X(this,oo,void 0),te(oo,this,t),We(this,{emitter:e,filter:n})}async removeListener(){null!=ee(oo,this)&&await this.emitter.off(this.filter,ee(oo,this))}}class co extends $s{constructor(e,t,n){super(e,e.provider),(0,Bt.A)(this,"interface",void 0),(0,Bt.A)(this,"fragment",void 0),(0,Bt.A)(this,"args",void 0);We(this,{args:t.decodeEventLog(n,e.data,e.topics),fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class lo extends $s{constructor(e,t){super(e,e.provider),(0,Bt.A)(this,"error",void 0),We(this,{error:t})}}var uo=new WeakMap;class ho extends to{constructor(e,t,n){super(n,t),X(this,uo,void 0),te(uo,this,e)}get logs(){return super.logs.map(e=>{const t=e.topics.length?ee(uo,this).getEvent(e.topics[0]):null;if(t)try{return new co(e,ee(uo,this),t)}catch(n){return new lo(e,n)}return e})}}var po=new WeakMap;class fo extends ro{constructor(e,t,n){super(n,t),X(this,po,void 0),te(po,this,e)}async wait(e,t){const n=await super.wait(e,t);return null==n?null:new ho(ee(po,this),this.provider,n)}}class go extends ao{constructor(e,t,n,r){super(e,t,n),(0,Bt.A)(this,"log",void 0),We(this,{log:r})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class mo extends go{constructor(e,t,n,r,i){super(e,t,n,new co(i,e.interface,r));We(this,{args:e.interface.decodeEventLog(r,this.log.data,this.log.topics),fragment:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const yo=BigInt(0);function vo(e){return e&&"function"===typeof e.call}function wo(e){return e&&"function"===typeof e.estimateGas}function bo(e){return e&&"function"===typeof e.resolveName}function Ao(e){return e&&"function"===typeof e.sendTransaction}function _o(e){if(null!=e){if(bo(e))return e;if(e.provider)return e.provider}}var xo=new WeakMap;class Eo{constructor(e,t,n){if(X(this,xo,void 0),(0,Bt.A)(this,"fragment",void 0),We(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");const r=ko(e.runner,"resolveName"),i=bo(r)?r:null;te(xo,this,async function(){const r=await Promise.all(t.inputs.map((e,t)=>null==n[t]?null:e.walkAsync(n[t],(e,t)=>"address"===e?Array.isArray(t)?Promise.all(t.map(e=>ui(e,i))):ui(t,i):t)));return e.interface.encodeFilterTopics(t,r)}())}getTopicFilter(){return ee(xo,this)}}function ko(e,t){return null==e?null:"function"===typeof e[t]?e:e.provider&&"function"===typeof e.provider[t]?e.provider:null}function So(e){return null==e?null:e.provider||null}async function Io(e,t){const n=Nn.dereference(e,"overrides");Je("object"===typeof n,"invalid overrides parameter","overrides",e);const r=Qs(n);return Je(null==r.to||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Je(null==r.data||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}function To(e){const t=async function(t){const n=await Io(t,["data"]);n.to=await e.getAddress(),n.from&&(n.from=await ui(n.from,_o(e.runner)));const r=e.interface,i=Ct(n.value||yo,"overrides.value")===yo,s="0x"===(n.data||"0x");!r.fallback||r.fallback.payable||!r.receive||s||i||Je(!1,"cannot send data to receive or send value to non-payable fallback","overrides",t),Je(r.fallback||s,"cannot send data to receive-only contract","overrides.data",n.data);return Je(r.receive||r.fallback&&r.fallback.payable||i,"cannot send value to non-payable fallback","overrides.value",n.value),Je(r.fallback||s,"cannot send data to receive-only contract","overrides.data",n.data),n},n=async function(n){const r=e.runner;Ke(Ao(r),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await r.sendTransaction(await t(n)),s=So(e.runner);return new fo(e.interface,s,i)},r=async e=>await n(e);return We(r,{_contract:e,estimateGas:async function(n){const r=ko(e.runner,"estimateGas");return Ke(wo(r),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await r.estimateGas(await t(n))},populateTransaction:t,send:n,staticCall:async function(n){const r=ko(e.runner,"call");Ke(vo(r),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const i=await t(n);try{return await r.call(i)}catch(s){if(Ve(s)&&s.data)throw e.interface.makeError(s.data,i);throw s}}}),r}function Co(e,t){const n=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];const s=e.interface.getFunction(t,r);return Ke(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),s},r=async function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];const s=n(...r);let o={};if(s.inputs.length+1===r.length&&(o=await Io(r.pop()),o.from&&(o.from=await ui(o.from,_o(e.runner)))),s.inputs.length!==r.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const a=await async function(e,t,n){const r=ko(e,"resolveName"),i=bo(r)?r:null;return await Promise.all(t.map((e,t)=>e.walkAsync(n[t],(e,t)=>(t=Nn.dereference(t,e),"address"===e?ui(t,i):t))))}(e.runner,s.inputs,r);return Object.assign({},o,await ze({to:e.getAddress(),data:e.interface.encodeFunctionData(s,a)}))},i=async function(){const e=await o(...arguments);return 1===e.length?e[0]:e},s=async function(){const t=e.runner;Ke(Ao(t),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const n=await t.sendTransaction(await r(...arguments)),i=So(e.runner);return new fo(e.interface,i,n)},o=async function(){const t=ko(e.runner,"call");Ke(vo(t),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const i=await r(...arguments);let s="0x";try{s=await t.call(i)}catch(a){if(Ve(a)&&a.data)throw e.interface.makeError(a.data,i);throw a}const o=n(...arguments);return e.interface.decodeFunctionResult(o,s)},a=async function(){return n(...arguments).constant?await i(...arguments):await s(...arguments)};return We(a,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:n,estimateGas:async function(){const t=ko(e.runner,"estimateGas");return Ke(wo(t),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await t.estimateGas(await r(...arguments))},populateTransaction:r,send:s,staticCall:i,staticCallResult:o}),Object.defineProperty(a,"fragment",{configurable:!1,enumerable:!0,get:()=>{const n=e.interface.getFunction(t);return Ke(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),n}}),a}const Po=Symbol.for("_ethersInternal_contract"),Oo=new WeakMap;function No(e){return Oo.get(e[Po])}async function Ro(e,t){let n,r=null;if(Array.isArray(t)){const r=function(t){if(tt(t,32))return t;const n=e.interface.getEvent(t);return Je(n,"unknown fragment","name",t),n.topicHash};n=t.map(e=>null==e?null:Array.isArray(e)?e.map(r):r(e))}else"*"===t?n=[null]:"string"===typeof t?tt(t,32)?n=[t]:(r=e.interface.getEvent(t),Je(r,"unknown fragment","event",t),n=[r.topicHash]):(i=t)&&"object"===typeof i&&"getTopicFilter"in i&&"function"===typeof i.getTopicFilter&&i.fragment?n=await t.getTopicFilter():"fragment"in t?(r=t.fragment,n=[r.topicHash]):Je(!1,"unknown event name","event",t);var i;n=n.map(e=>{if(null==e)return null;if(Array.isArray(e)){const t=Array.from(new Set(e.map(e=>e.toLowerCase())).values());return 1===t.length?t[0]:(t.sort(),t)}return e.toLowerCase()});return{fragment:r,tag:n.map(e=>null==e?"null":Array.isArray(e)?e.join("|"):e).join("&"),topics:n}}async function Mo(e,t){const{subs:n}=No(e);return n.get((await Ro(e,t)).tag)||null}async function Uo(e,t,n){const r=So(e.runner);Ke(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:i,tag:s,topics:o}=await Ro(e,n),{addr:a,subs:c}=No(e);let l=c.get(s);if(!l){const t={address:a||e,topics:o},u=t=>{let r=i;if(null==r)try{r=e.interface.getEvent(t.topics[0])}catch(s){}if(r){const s=r,o=i?e.interface.decodeEventLog(i,t.data,t.topics):[];Bo(e,n,o,r=>
2new mo(e,r,n,s,t))}else Bo(e,n,[],r=>new go(e,r,n,t))};let d=[];l={tag:s,listeners:[],start:()=>{d.length||d.push(r.on(t,u))},stop:async()=>{if(0==d.length)return;let e=d;d=[],await Promise.all(e),r.off(t,u)}},c.set(s,l)}return l}let Lo=Promise.resolve();async function Bo(e,t,n,r){try{await Lo}catch(s){}const i=async function(e,t,n,r){await Lo;const i=await Mo(e,t);if(!i)return!1;const o=i.listeners.length;return i.listeners=i.listeners.filter(t=>{let{listener:i,once:o}=t;const a=Array.from(n);r&&a.push(r(o?null:i));try{i.call(e,...a)}catch(s){}return!o}),0===i.listeners.length&&(i.stop(),No(e).subs.delete(i.tag)),o>0}(e,t,n,r);return Lo=i,await i}const Do=["then"];class jo{constructor(e,t,n,r){(0,Bt.A)(this,"target",void 0),(0,Bt.A)(this,"interface",void 0),(0,Bt.A)(this,"runner",void 0),(0,Bt.A)(this,"filters",void 0),(0,Bt.A)(this,Po,void 0),(0,Bt.A)(this,"fallback",void 0),Je("string"===typeof e||ci(e),"invalid value for Contract target","target",e),null==n&&(n=null);const i=qs.from(t);let s;We(this,{target:e,runner:n,interface:i}),Object.defineProperty(this,Po,{value:{}});let o=null,a=null;if(r){const e=So(n);a=new fo(this.interface,e,r)}let c=new Map;if("string"===typeof e)if(tt(e))o=e,s=Promise.resolve(e);else{const t=ko(n,"resolveName");if(!bo(t))throw Ge("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});s=t.resolveName(e).then(t=>{if(null==t)throw Ge("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return No(this).addr=t,t})}else s=e.getAddress().then(e=>{if(null==e)throw new Error("TODO");return No(this).addr=e,e});var l,u;l=this,u={addrPromise:s,addr:o,deployTx:a,subs:c},Oo.set(l[Po],u);const d=new Proxy({},{get:(e,t,n)=>{if("symbol"===typeof t||Do.indexOf(t)>=0)return Reflect.get(e,t,n);try{return this.getEvent(t)}catch(r){if(!He(r,"INVALID_ARGUMENT")||"key"!==r.argument)throw r}},has:(e,t)=>Do.indexOf(t)>=0?Reflect.has(e,t):Reflect.has(e,t)||this.interface.hasEvent(String(t))});return We(this,{filters:d}),We(this,{fallback:i.receive||i.fallback?To(this):null}),new Proxy(this,{get:(e,t,n)=>{if("symbol"===typeof t||t in e||Do.indexOf(t)>=0)return Reflect.get(e,t,n);try{return e.getFunction(t)}catch(r){if(!He(r,"INVALID_ARGUMENT")||"key"!==r.argument)throw r}},has:(e,t)=>"symbol"===typeof t||t in e||Do.indexOf(t)>=0?Reflect.has(e,t):e.interface.hasFunction(t)})}connect(e){return new jo(this.target,this.interface,e)}attach(e){return new jo(e,this.interface,this.runner)}async getAddress(){return await No(this).addrPromise}async getDeployedCode(){const e=So(this.runner);Ke(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return"0x"===t?null:t}async waitForDeployment(){const e=this.deploymentTransaction();
2if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const t=So(this.runner);return Ke(null!=t,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((e,n)=>{const r=async()=>{try{if(null!=await this.getDeployedCode())return e(this);t.once("block",r)}catch(i){n(i)}};r()})}deploymentTransaction(){return No(this).deployTx}getFunction(e){"string"!==typeof e&&(e=e.format());return Co(this,e)}getEvent(e){return"string"!==typeof e&&(e=e.format()),function(e,t){const n=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];const s=e.interface.getEvent(t,r);return Ke(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),s},r=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return new Eo(e,n(...r),r)};return We(r,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const n=e.interface.getEvent(t);return Ke(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),n}}),r}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){null==t&&(t=0),null==n&&(n="latest");const{addr:r,addrPromise:i}=No(this),s=r||await i,{fragment:o,topics:a}=await Ro(this,e),c={address:s,topics:a,fromBlock:t,toBlock:n},l=So(this.runner);return Ke(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(c)).map(e=>{let t=o;if(null==t)try{t=this.interface.getEvent(e.topics[0])}catch(n){}if(t)try{return new co(e,this.interface,t)}catch(n){return new lo(e,n)}return new $s(e,l)})}async on(e,t){const n=await Uo(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){const n=await Uo(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return await Bo(this,e,n,null)}async listenerCount(e){if(e){const t=await Mo(this,e);return t?t.listeners.length:0}const{subs:t}=No(this);let n=0;for(const{listeners:r}of t.values())n+=r.length;return n}async listeners(e){if(e){const t=await Mo(this,e);return t?t.listeners.map(e=>{let{listener:t}=e;return t}):[]}const{subs:t}=No(this);let n=[];for(const{listeners:r}of t.values())n=n.concat(r.map(e=>{let{listener:t}=e;return t}));return n}async off(e,t){const n=await Mo(this,e);if(!n)return this;if(t){const e=n.listeners.map(e=>{let{listener:t}=e;return t}).indexOf(t);e>=0&&n.listeners.splice(e,1)}return null!=t&&0!==n.listeners.length||(n.stop(),No(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const t=await Mo(this,e);if(!t)return this;t.stop(),No(this).subs.delete(t.tag)}else{const{subs:e}=No(this);for(const{tag:t,stop:n}of e.values())n(),e.delete(t)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){return class extends jo{constructor(t){super(t,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)}}}static from(e,t,n){null==n&&(n=null);return new this(e,t,n)}}class Fo extends(function(){return jo}()){}const zo=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function Wo(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),i=1,s=[0,1];for(let b=1;b<r;b++)s.push(i+=n());let o=n(),a=t;t+=o;let c=0,l=0;function u(){return 0==c&&(l=l<<8|e[t++],c=8),l>>--c&1}const d=2**31,h=d>>>1,p=h>>1,f=d-1;let g=0;for(let b=0;b<31;b++)g=g<<1|u();let m=[],y=0,v=d;for(;;){let e=Math.floor(((g-y+1)*i-1)/v),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e<s[r]?n=r:t=r}if(0==t)break;m.push(t);let o=y+Math.floor(v*s[t]/i),a=y+Math.floor(v*s[t+1]/i)-1;for(;0==((o^a)&h);)g=g<<1&f|u(),o=o<<1&f,a=a<<1&f|1;for(;o&~a&p;)g=g&h|g<<1&f>>>1|u(),o=o<<1^h,a=(a^h)<<1|h|1;y=o,v=1+a-o}let w=r-4;return m.map(t=>
2{switch(t-w){case 3:return w+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return w+256+(e[a++]<<8|e[a++]);case 1:return w+e[a++];default:return t-1}})}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((e,n)=>t[e.charCodeAt(0)]=n);let n=e.length,r=new Uint8Array(6*n>>3);for(let i=0,s=0,o=0,a=0;i<n;i++)a=a<<6|t[e.charCodeAt(i)],o+=6,o>=8&&(r[s++]=a>>(o-=8));return r}(e)))}function qo(e){return 1&e?~e>>1:e>>1}function Ho(e,t){let n=Array(e);for(let r=0,i=0;r<e;r++)n[r]=i+=qo(t());return n}function Vo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];for(;;){let r=e(),i=e();if(!i)break;t+=r;for(let e=0;e<i;e++)n.push(t+e);t+=i+1}return n}function Go(e){return Jo(()=>{let t=Vo(e);if(t.length)return t})}function Ko(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(Qo(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(Yo(n,e))}return t.flat()}function Jo(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function Zo(e,t,n){let r=Array(e).fill().map(()=>[]);for(let i=0;i<t;i++)Ho(e,n).forEach((e,t)=>r[t].push(e));return r}function Qo(e,t){let n=1+t(),r=t(),i=Jo(t);return Zo(i.length,1+e,t).flatMap((e,t)=>{let[s,...o]=e;return Array(i[t]).fill().map((e,t)=>{let i=t*r;return[s+t*n,o.map(e=>e+i)]})})}function Yo(e,t){return Zo(1+t(),1+e,t).map(e=>[e[0],e.slice(1)])}function Xo(e){return"{".concat(function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e),"}")}function $o(e){let t=[];for(let n=0,r=e.length;n<r;){let r=e.codePointAt(n);n+=r<65536?1:2,t.push(r)}return t}function ea(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let n=[];for(let r=0;r<t;)n.push(String.fromCodePoint(...e.slice(r,r+=4096)));return n.join("")}function ta(e,t){let n=e.length,r=n-t.length;for(let i=0;0==r&&i<n;i++)r=e[i]-t[i];return r}const na=44032,ra=4352,ia=4449,sa=4519,oa=28,aa=588;function ca(e){return e>>24&255}function la(e){return 16777215&e}let ua,da,ha,pa;function fa(e){return e>=na&&e<55204}function ga(e,t){if(e>=ra&&e<4371&&t>=ia&&t<4470)return na+(e-ra)*aa+(t-ia)*oa;if(fa(e)&&t>sa&&t<4547&&(e-na)%oa==0)return e+(t-sa);{let n=pa.get(e);return n&&(n=n.get(t),n)?n:-1}}function ma(e){ua||function(){let e=Wo
vendor: 7,456 bytes, line 2
2("AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g");
vendor: 2,745 bytes, line 2
2ua=new Map(Go(e).flatMap((e,t)=>e.map(e=>[e,t+1<<24]))),da=new Set(Vo(e)),ha=new Map,pa=new Map;for(let[t,n]of Ko(e)){if(!da.has(t)&&2==n.length){let[e,r]=n,i=pa.get(e);i||(i=new Map,pa.set(e,i)),i.set(r,t)}ha.set(t,n.reverse())}}();let t=[],n=[],r=!1;function i(e){let n=ua.get(e);n&&(r=!0,e|=n),t.push(e)}for(let s of e)for(;;){if(s<128)t.push(s);else if(fa(s)){let e=s-na,t=e%aa/oa|0,n=e%oa;i(ra+(e/aa|0)),i(ia+t),n>0&&i(sa+n)}else{let e=ha.get(s);e?n.push(...e):i(s)}if(!n.length)break;s=n.pop()}if(r&&t.length>1){let e=ca(t[0]);for(let n=1;n<t.length;n++){let r=ca(t[n]);if(0==r||e<=r){e=r;continue}let i=n-1;for(;;){let n=t[i+1];if(t[i+1]=t[i],t[i]=n,!i)break;if(e=ca(t[--i]),e<=r)break}e=ca(t[n])}}return t}function ya(e){return ma(e).map(la)}function va(e){return function(e){let t=[],n=[],r=-1,i=0;for(let s of e){let e=ca(s),o=la(s);if(-1==r)0==e?r=o:t.push(o);else if(i>0&&i>=e)0==e?(t.push(r,...n),n.length=0,r=o):n.push(o),i=e;else{let s=ga(r,o);s>=0?r=s:0==i&&0==e?(t.push(r),r=o):(n.push(o),i=e)}}return r>=0&&t.push(r,...n),t}(ma(e))}const wa=".",ba=e=>Array.from(e);function Aa(e,t){return e.P.has(t)||e.Q.has(t)}class _a extends Array{get is_emoji(){return!0}}let xa,Ea,ka,Sa,Ia,Ta,Ca,Pa,Oa,Na,Ra,Ma;function Ua(){if(xa)return;let e=Wo("AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhT
2yiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9ey
2MgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduP
2jbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESV
2FFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI");const t=()=>Vo(e),n=()=>new Set(t()),r=(e,t)=>t.forEach(t=>e.add(t));xa=new Map(Ko(e)),Ea=n(),ka=t(),Sa=new Set(t().map(e=>ka[e])),ka=new Set(ka),Ia=n(),Ta=n();let i=Go(e),s=e();const o=()=>{let e=new Set;
2return t().forEach(t=>r(e,i[t])),r(e,t()),e};Ca=Jo(t=>{let n=Jo(e).map(e=>e+96);if(n.length){let r=t>=s;return n[0]-=32,n=ea(n),r&&(n="Restricted[".concat(n,"]")),{N:n,P:o(),Q:o(),M:!e(),R:r}}}),Pa=n(),Oa=new Map;let a=t().concat(ba(Pa)).sort((e,t)=>e-t);a.forEach((t,n)=>{let r=e(),i=a[n]=r?a[n-r]:{V:[],M:new Map};i.V.push(t),Pa.has(t)||Oa.set(t,i)});for(let{V:u,M:d}of new Set(Oa.values())){let e=[];for(let n of u){let t=Ca.filter(e=>Aa(e,n)),i=e.find(e=>{let{G:n}=e;return t.some(e=>n.has(e))});i||(i={G:new Set,V:[]},e.push(i)),i.V.push(n),r(i.G,t)}let t=e.flatMap(e=>ba(e.G));for(let{G:n,V:r}of e){let e=new Set(t.filter(e=>!n.has(e)));for(let t of r)d.set(t,e)}}Na=new Set;let c=new Set;const l=e=>Na.has(e)?c.add(e):Na.add(e);for(let u of Ca){for(let e of u.P)l(e);for(let e of u.Q)l(e)}for(let u of Na)Oa.has(u)||c.has(u)||Oa.set(u,1);r(Na,ya(Na)),Ra=function(e){let t=[],n=Vo(e);return function e(n,r,i){let{S:s,B:o}=n;if(!(4&s&&i===r[r.length-1])){2&s&&(i=r[r.length-1]),1&s&&t.push(r);for(let t of o)for(let n of t.Q)e(t,[...r,n],i)}}(function t(r){return{S:e(),B:Jo(()=>{let r=Vo(e).map(e=>n[e]);if(r.length)return t(r)}),Q:r}}([]),[]),t}(e).map(e=>_a.from(e)).sort(ta),Ma=new Map;for(let u of Ra){let e=[Ma];for(let t of u){let n=e.map(e=>{let n=e.get(t);return n||(n=new Map,e.set(t,n)),n});65039===t?e.push(...n):e=n}for(let t of e)t.V=u}}function La(e){return(ja(e)?"":"".concat(Ba(Da([e]))," "))+Xo(e)}function Ba(e){return'"'.concat(e,'"\u200e')}function Da(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Xo,r=[];var i;i=e[0],Ua(),ka.has(i)&&r.push("\u25cc"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,o=e.length;for(let a=0;a<o;a++){let t=e[a];ja(t)&&(r.push(ea(e.slice(s,a))),r.push(n(t)),s=a+1)}return r.push(ea(e.slice(s,o))),r.join("")}function ja(e){return Ua(),Ia.has(e)}function Fa(e,t,n){if(!e)return[];Ua();let r=0;return e.split(wa).map(e=>{let i=$o(e),s={input:i,offset:r};r+=i.length+1;try{let e,r=s.tokens=Va(i,t,n),o=r.length;if(!o)throw new Error("empty label");let a=s.output=r.flat();if(function(e){for(let t=e.lastIndexOf(95);t>0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}(a),!(s.emoji=o>1||r[0].is_emoji)&&a.every(e=>e<128))!function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw new Error('invalid label extension: "'.concat(ea(e.slice(0,4)),'"'))}(a),e="ASCII";else{let t=r.flatMap(e=>e.is_emoji?[]:e);if(t.length){if(ka.has(a[0]))throw Ha("leading combining mark");for(let e=1;e<o;e++){let t=r[e];
2if(!t.is_emoji&&ka.has(t[0]))throw Ha('emoji + combining mark: "'.concat(ea(r[e-1])," + ").concat(Da([t[0]]),'"'))}!function(e){let t=e[0],n=zo.get(t);if(n)throw Ha("leading ".concat(n));let r=e.length,i=-1;for(let s=1;s<r;s++){t=e[s];let r=zo.get(t);if(r){if(i==s)throw Ha("".concat(n," + ").concat(r));i=s+1,n=r}}if(i==r)throw Ha("trailing ".concat(n))}(a);let n=ba(new Set(t)),[i]=function(e){let t=Ca;for(let n of e){let e=t.filter(e=>Aa(e,n));if(!e.length)throw Ca.some(e=>Aa(e,n))?qa(t[0],n):Wa(n);if(t=e,1==e.length)break}return t}(n);!function(e,t){for(let n of t)if(!Aa(e,n))throw qa(e,n);if(e.M){let e=ya(t);for(let t=1,n=e.length;t<n;t++)if(Sa.has(e[t])){let r=t+1;for(let i;r<n&&Sa.has(i=e[r]);r++)for(let n=t;n<r;n++)if(e[n]==i)throw new Error("duplicate non-spacing marks: ".concat(La(i)));if(r-t>4)throw new Error("excessive non-spacing marks: ".concat(Ba(Da(e.slice(t-1,r)))," (").concat(r-t,"/").concat(4,")"));t=r}}}(i,t),function(e,t){let n,r=[];for(let i of t){let e=Oa.get(i);if(1===e)return;if(e){let t=e.M.get(i);if(n=n?n.filter(e=>t.has(e)):ba(t),!n.length)return}else r.push(i)}if(n)for(let i of n)if(r.every(e=>Aa(i,e)))throw new Error("whole-script confusable: ".concat(e.N,"/").concat(i.N))}(i,n),e=i.N}else e="Emoji"}s.type=e}catch(o){s.error=o}return s})}function za(e){return e.map(t=>{let{input:n,error:r,output:i}=t;if(r){let t=r.message;throw new Error(1==e.length?t:"Invalid label ".concat(Ba(Da(n,63)),": ").concat(t))}return ea(i)}).join(wa)}function Wa(e){return new Error("disallowed character: ".concat(La(e)))}function qa(e,t){let n=La(t),r=Ca.find(e=>e.P.has(t));return r&&(n="".concat(r.N," ").concat(n)),new Error("illegal mixture: ".concat(e.N," + ").concat(n))}function Ha(e){return new Error("illegal placement: ".concat(e))}function Va(e,t,n){let r=[],i=[];for(e=e.slice().reverse();e.length;){let s=Ka(e);if(s)i.length&&(r.push(t(i)),i=[]),r.push(n(s));else{let t=e.pop();if(Na.has(t))i.push(t);else{let e=xa.get(t);if(e)i.push(...e);else if(!Ea.has(t))throw Wa(t)}}}return i.length&&r.push(t(i)),r}function Ga(e){return e.filter(e=>65039!=e)}function Ka(e,t){let n,r=Ma,i=e.length;for(;i&&(r=r.get(e[--i]),r);){let{V:s}=r;s&&(n=s,t&&t.push(...e.slice(i).reverse()),e.length=i)}return n}const Ja=new Uint8Array(32);function Za(e){return Je(0!==e.length,"invalid ENS name; empty component","comp",e),e}function Qa(e){const t=Yn(function(e){try{if(0===e.length)throw new Error("empty label");return function(e){return za(Fa(e,va,Ga))}(e)}catch(t){Je(!1,"invalid ENS name (".concat(t.message,")"),"name",e)}}(e)),n=[];if(0===e.length)return n;let r=0;for(let i=0;i<t.length;i++){46===t[i]&&(n.push(Za(t.slice(r,i))),r=i+1)}return Je(r<t.length,"invalid ENS name; empty component","name",e),n.push(Za(t.slice(r))),n}function Ya(e){Je("string"===typeof e,"invalid ENS name; not a string","name",e),Je(e.length,"invalid ENS name (empty label)","name",e);let t=Ja;const n=Qa(e);for(;n.length;)t=pt(st([t,pt(n.pop())]));return it(t)}function Xa(e,t){const n=null!=t?t:63;return Je(n<=255,"DNS encoded label cannot exceed 255","length",n),it(st(Qa(e).map(t=>{Je(t.length<=n,"label ".concat(JSON.stringify(e)," exceeds ").concat(n," bytes"),"name",e);const r=new Uint8Array(t.length+1);return r.set(t,1),r[0]=r.length-1,r})))+"00"}Ja.fill(0);class $a extends Ae{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ve(this.buffer)}update(e){se(this);const{view:t,buffer:n,blockLen:r}=this,i=(e=be(e)).length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);if(o===r){const t=ve(e);for(;r<=i-s;s+=r)this.process(t,s);continue}n.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){se(this),oe(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:i}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>r-s&&(this.process(n,0),s=0);for(let u=s;u<r;u++)t[u]=0;!function(e,t,n,r){if("function"===typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,a,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);const o=ve(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<c;u++)o.setUint32(4*u,l[u],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:i,destroyed:s,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=s,r%t&&e.buffer.set(n),e}}const ec=(e,t,n)=>e&t^~e&n,tc=(e,t,n)=>e&t^e&n^t&n,nc=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 2,155 bytes, line 2
2734187,3204031479,3329325298]),rc=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ic=new Uint32Array(64);class sc extends $a{constructor(){super(64,32,8,!1),this.A=0|rc[0],this.B=0|rc[1],this.C=0|rc[2],this.D=0|rc[3],this.E=0|rc[4],this.F=0|rc[5],this.G=0|rc[6],this.H=0|rc[7]}get(){const{A:e,B:t,C:n,D:r,E:i,F:s,G:o,H:a}=this;return[e,t,n,r,i,s,o,a]}set(e,t,n,r,i,s,o,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let u=0;u<16;u++,t+=4)ic[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const e=ic[u-15],t=ic[u-2],n=we(e,7)^we(e,18)^e>>>3,r=we(t,17)^we(t,19)^t>>>10;ic[u]=r+ic[u-7]+n+ic[u-16]|0}let{A:n,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;for(let u=0;u<64;u++){const e=l+(we(o,6)^we(o,11)^we(o,25))+ec(o,a,c)+nc[u]+ic[u]|0,t=(we(n,2)^we(n,13)^we(n,22))+tc(n,r,i)|0;l=c,c=a,a=o,o=s+e|0,s=i,i=r,r=n,n=e+t|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,s,o,a,c,l)}roundClean(){ic.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const oc=_e(()=>new sc),[ac,cc]=(()=>ge.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
25771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),lc=new Uint32Array(80),uc=new Uint32Array(80);class dc extends $a{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:s,Dh:o,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:p,Hh:f,Hl:g}=this;return[e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g]}set(e,t,n,r,i,s,o,a,c,l,u,d,h,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|s,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let v=0;v<16;v++,t+=4)lc[v]=e.getUint32(t),uc[v]=e.getUint32(t+=4);for(let v=16;v<80;v++){const e=0|lc[v-15],t=0|uc[v-15],n=ge.rotrSH(e,t,1)^ge.rotrSH(e,t,8)^ge.shrSH(e,t,7),r=ge.rotrSL(e,t,1)^ge.rotrSL(e,t,8)^ge.shrSL(e,t,7),i=0|lc[v-2],s=0|uc[v-2],o=ge.rotrSH(i,s,19)^ge.rotrBH(i,s,61)^ge.shrSH(i,s,6),a=ge.rotrSL(i,s,19)^ge.rotrBL(i,s,61)^ge.shrSL(i,s,6),c=ge.add4L(r,a,uc[v-7],uc[v-16]),l=ge.add4H(c,n,o,lc[v-7],lc[v-16]);lc[v]=0|l,uc[v]=0|c}let{Ah:n,Al:r,Bh:i,Bl:s,Ch:o,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:p,Gh:f,Gl:g,Hh:m,Hl:y}=this;for(let v=0;v<80;v++){const e=ge.rotrSH(u,d,14)^ge.rotrSH(u,d,18)^ge.rotrBH(u,d,41),t=ge.rotrSL(u,d,14)^ge.rotrSL(u,d,18)^ge.rotrBL(u,d,41),w=u&h^~u&f,b=d&p^~d&g,A=ge.add5L(y,t,b,cc[v],uc[v]),_=ge.add5H(A,m,e,w,ac[v],lc[v]),x=0|A,E=ge.rotrSH(n,r,28)^ge.rotrBH(n,r,34)^ge.rotrBH(n,r,39),k=ge.rotrSL(n,r,28)^ge.rotrBL(n,r,34)^ge.rotrBL(n,r,39),S=n&i^n&o^i&o,I=r&s^r&a^s&a;m=0|f,y=0|g,f=0|h,g=0|p,h=0|u,p=0|d,({h:u,l:d}=ge.add(0|c,0|l,0|_,0|x)),c=0|o,l=0|a,o=0|i,a=0|s,i=0|n,s=0|r;const T=ge.add3L(x,k,I);n=ge.add3H(T,_,E,S),r=0|T}({h:n,l:r}=ge.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:s}=ge.add(0|this.Bh,0|this.Bl,0|i,0|s)),({h:o,l:a}=ge.add(0|this.Ch,0|this.Cl,0|o,0|a)),({h:c,l:l}=ge.add(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=ge.add(0|this.Eh,0|this.El,0|u,0|d)),({h:h,l:p}=ge.add(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:g}=ge.add(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:y}=ge.add(0|this.Hh,0|this.Hl,0|m,0|y)),this.set(n,r,i,s,o,a,c,l,u,d,h,p,f,g,m,y)}roundClean(){lc.fill(0),uc.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const hc=_e(()=>new dc);const pc=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("unable to locate global object")}();pc.crypto||pc.msCrypto;function fc(e){switch(e){case"sha256":return oc.create();case"sha512":return hc.create()}Je(!1,"invalid hashing algorithm name","algorithm",e)}const gc=function(e){return fc("sha256").update(e).digest()},mc=function(e){return fc("sha512").update(e).digest()};let yc=gc,vc=mc,wc=!1,bc=!1;function Ac(e){const t=$e(e,"data");return it(yc(t))}function _c(e){const t=$e(e,"data");return it(vc(t))}Ac._=gc,Ac.lock=function(){wc=!0},Ac.register=function(e){if(wc)throw new Error("sha256 is locked");yc=e},Object.freeze(Ac),_c._=mc,_c.lock=function(){bc=!0},_c.register=function(e){if(bc)throw new Error("sha512 is locked");vc=e},Object.freeze(Ac);BigInt(0);const xc=BigInt(1),Ec=BigInt(2),kc=e=>e instanceof Uint8Array,Sc=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ic(e){if(!kc(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=Sc[e[n]];return t}function Tc(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":"0x".concat(e))}function Cc(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){const t=2*r,i=e.slice(t,t+2),s=Number.parseInt(i,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");n[r]=s}return n}function Pc(e){return Tc(Ic(e))}function Oc(e){if(!kc(e))throw new Error("Uint8Array expected");return Tc(Ic(Uint8Array.from(e).reverse()))}function Nc(e,t){return Cc(e.toString(16).padStart(2*t,"0"))}function Rc(e,t){return Nc(e,t).reverse()}function Mc(e,t,n){let r;if("string"===typeof t)try{r=Cc(t)}catch(s){throw new Error("".concat(e,' must be valid hex string, got "').concat(t,'". Cause: ').concat(s))}else{if(!kc(t))throw new Error("".concat(e," must be hex string or Uint8Array"));r=Uint8Array.from(t)}const i=r.length;if("number"===typeof n&&i!==n)throw new Error("".concat(e," expected ").concat(n," bytes, got ").concat(i));return r}function Uc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];
2const r=new Uint8Array(t.reduce((e,t)=>e+t.length,0));let i=0;return t.forEach(e=>{if(!kc(e))throw new Error("Uint8Array expected");r.set(e,i),i+=e.length}),r}const Lc=e=>(Ec<<BigInt(e-1))-xc,Bc=e=>new Uint8Array(e),Dc=e=>Uint8Array.from(e);function jc(e,t,n){if("number"!==typeof e||e<2)throw new Error("hashLen must be a number");if("number"!==typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!==typeof n)throw new Error("hmacFn must be a function");let r=Bc(e),i=Bc(e),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return n(i,r,...t)},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bc();i=a(Dc([0]),e),r=a(),0!==e.length&&(i=a(Dc([1]),e),r=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=a();const t=r.slice();n.push(t),e+=r.length}return Uc(...n)};return(e,t)=>{let n;for(o(),c(e);!(n=t(l()));)c();return o(),n}}const Fc={bigint:e=>"bigint"===typeof e,function:e=>"function"===typeof e,boolean:e=>"boolean"===typeof e,string:e=>"string"===typeof e,stringOrUint8Array:e=>"string"===typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"===typeof e&&Number.isSafeInteger(e.outputLen)};function zc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(t,n,r)=>{const i=Fc[n];if("function"!==typeof i)throw new Error('Invalid validator "'.concat(n,'", expected function'));const s=e[t];if((!r||void 0!==s)&&!i(s,e))throw new Error("Invalid param ".concat(String(t),"=").concat(s," (").concat(typeof s,"), expected ").concat(n))};for(const[i,s]of Object.entries(t))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return e}const Wc=BigInt(0),qc=BigInt(1),Hc=BigInt(2),Vc=BigInt(3),Gc=BigInt(4),Kc=BigInt(5),Jc=BigInt(8);BigInt(9),BigInt(16);function Zc(e,t){const n=e%t;return n>=Wc?n:t+n}function Qc(e,t,n){if(n<=Wc||t<Wc)throw new Error("Expected power/modulo > 0");if(n===qc)return Wc;let r=qc;for(;t>Wc;)t&qc&&(r=r*e%n),e=e*e%n,t>>=qc;return r}function Yc(e,t,n){let r=e;for(;t-- >Wc;)r*=r,r%=n;return r}function Xc(e,t){if(e===Wc||t<=Wc)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));let n=Zc(e,t),r=t,i=Wc,s=qc,o=qc,a=Wc;for(;n!==Wc;){const e=r/n,t=r%n,c=i-o*e,l=s-a*e;r=n,n=t,i=o,s=a,o=c,a=l}if(r!==qc)throw new Error("invert: does not exist");return Zc(i,t)}function $c(e){if(e%Gc===Vc){const t=(e+qc)/Gc;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%Jc===Kc){const t=(e-Kc)/Jc;return function(e,n){const r=e.mul(n,Hc),i=e.pow(r,t),s=e.mul(n,i),o=e.mul(e.mul(s,Hc),i),a=e.mul(s,e.sub(o,e.ONE));if(!e.eql(e.sqr(a),n))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-qc)/Hc;let n,r,i;for(n=e-qc,r=0;n%Hc===Wc;n/=Hc,r++);for(i=Hc;i<e&&Qc(i,t,e)!==e-qc;i++);if(1===r){const t=(e+qc)/Gc;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}const s=(n+qc)/Hc;return function(e,o){if(e.pow(o,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=r,c=e.pow(e.mul(e.ONE,i),n),l=e.pow(o,s),u=e.pow(o,n);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(u);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const n=e.pow(c,qc<<BigInt(a-t-1));c=e.sqr(n),l=e.mul(l,n),u=e.mul(u,c),a=t}return l}}(e)}const el=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tl(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function nl(e){if("bigint"!==typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function rl(e){const t=nl(e);return t+Math.ceil(t/2)}class il extends Ae{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ie(e);const n=be(t);if(this.iHash=e.create(),"function"!==typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let s=0;s<i.length;s++)i[s]^=54;this.iHash.update(i),this.oHash=e.create();for(let s=0;s<i.length;s++)i[s]^=106;this.oHash.update(i),i.fill(0)}update(e){return se(this),this.iHash.update(e),this}digestInto(e){se(this),re(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:s,outputLen:o}=this;return e.finished=r,e.destroyed=i,e.blockLen=s,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const sl=(e,t,n)=>new il(e,t).update(n).digest();sl.create=(e,t)=>
2new il(e,t);const ol=BigInt(0),al=BigInt(1);function cl(e){return zc(e.Fp,el.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),zc(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze((0,i.A)((0,i.A)((0,i.A)({},tl(e.n,e.nBitLength)),e),{p:e.Fp.ORDER}))}const{Ph:ll,aT:ul}=e,dl={Err:class extends Error{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}},_parseInt(e){const{Err:t}=dl;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:ll(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=dl,n="string"===typeof e?ul(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:i,l:s}=dl._parseInt(n.subarray(2)),{d:o,l:a}=dl._parseInt(s);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?"0".concat(t):t},r=t(n(e.s)),i=t(n(e.r)),s=r.length/2,o=i.length/2,a=n(s),c=n(o);return"30".concat(n(o+s+4),"02").concat(c).concat(i,"02").concat(a).concat(r)}},hl=BigInt(0),pl=BigInt(1),fl=(BigInt(2),BigInt(3));BigInt(4);function gl(e){const t=function(e){const t=cl(e);zc(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!==typeof n||"bigint"!==typeof n.beta||"function"!==typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze((0,i.A)({},t))}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const i=t.toAffine();return Uc(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),s=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function o(e){const{a:r,b:i}=t,s=n.sqr(e),o=n.mul(s,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){return"bigint"===typeof e&&hl<e&&e<t.n}function c(e){if(!a(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:s}=t;if(n&&"bigint"!==typeof e){if(e instanceof Uint8Array&&(e=Ic(e)),"string"!==typeof e||!n.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*r,"0")}let o;try{o="bigint"===typeof e?e:Pc(Mc("private key",e,r))}catch(a){throw new Error("private key must be ".concat(r," bytes, hex or bigint, not ").concat(typeof e))}return i&&(o=Zc(o,s)),c(o),o}const u=new Map;function d(e){if(!(e instanceof h))throw new Error("ProjectivePoint expected")}class h{constructor(e,t,r){if(this.px=e,this.py=t,this.pz=r,null==e||!n.isValid(e))throw new Error("x required");if(null==t||!n.isValid(t))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required")}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof h)throw new Error("projective point not allowed");const i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?h.ZERO:new h(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(h.fromAffine)}static fromHex(e){const t=h.fromAffine(s(Mc("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return h.BASE.multiply(l(e))}_setWindowSize(e){this._WINDOW_SIZE=e,u.delete(this)}
vendor: 4,456 bytes, line 2
2assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const i=n.sqr(r),s=o(e);if(!n.eql(i,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){d(e);const{px:t,py:r,pz:i}=this,{px:s,py:o,pz:a}=e,c=n.eql(n.mul(t,a),n.mul(s,i)),l=n.eql(n.mul(r,a),n.mul(o,i));return c&&l}negate(){return new h(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,i=n.mul(r,fl),{px:s,py:o,pz:a}=this;let c=n.ZERO,l=n.ZERO,u=n.ZERO,d=n.mul(s,s),p=n.mul(o,o),f=n.mul(a,a),g=n.mul(s,o);return g=n.add(g,g),u=n.mul(s,a),u=n.add(u,u),c=n.mul(e,u),l=n.mul(i,f),l=n.add(c,l),c=n.sub(p,l),l=n.add(p,l),l=n.mul(c,l),c=n.mul(g,c),u=n.mul(i,u),f=n.mul(e,f),g=n.sub(d,f),g=n.mul(e,g),g=n.add(g,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,f),d=n.mul(d,g),l=n.add(l,d),f=n.mul(o,a),f=n.add(f,f),d=n.mul(f,g),c=n.sub(c,d),u=n.mul(f,p),u=n.add(u,u),u=n.add(u,u),new h(c,l,u)}add(e){d(e);const{px:r,py:i,pz:s}=this,{px:o,py:a,pz:c}=e;let l=n.ZERO,u=n.ZERO,p=n.ZERO;const f=t.a,g=n.mul(t.b,fl);let m=n.mul(r,o),y=n.mul(i,a),v=n.mul(s,c),w=n.add(r,i),b=n.add(o,a);w=n.mul(w,b),b=n.add(m,y),w=n.sub(w,b),b=n.add(r,s);let A=n.add(o,c);return b=n.mul(b,A),A=n.add(m,v),b=n.sub(b,A),A=n.add(i,s),l=n.add(a,c),A=n.mul(A,l),l=n.add(y,v),A=n.sub(A,l),p=n.mul(f,b),l=n.mul(g,v),p=n.add(l,p),l=n.sub(y,p),p=n.add(y,p),u=n.mul(l,p),y=n.add(m,m),y=n.add(y,m),v=n.mul(f,v),b=n.mul(g,b),y=n.add(y,v),v=n.sub(m,v),v=n.mul(f,v),b=n.add(b,v),m=n.mul(y,b),u=n.add(u,m),m=n.mul(A,b),l=n.mul(w,l),l=n.sub(l,m),m=n.mul(w,y),p=n.mul(A,p),p=n.add(p,m),new h(l,u,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(h.ZERO)}wNAF(e){return f.wNAFCached(this,u,e,e=>{const t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(h.fromAffine)})}multiplyUnsafe(e){const r=h.ZERO;if(e===hl)return r;if(c(e),e===pl)return this;const{endo:i}=t;if(!i)return f.unsafeLadder(this,e);let{k1neg:s,k1:o,k2neg:a,k2:l}=i.splitScalar(e),u=r,d=r,p=this;for(;o>hl||l>hl;)o&pl&&(u=u.add(p)),l&pl&&(d=d.add(p)),p=p.double(),o>>=pl,l>>=pl;return s&&(u=u.negate()),a&&(d=d.negate()),d=new h(n.mul(d.px,i.beta),d.py,d.pz),u.add(d)}multiply(e){c(e);let r,i,s=e;const{endo:o}=t;if(o){const{k1neg:e,k1:t,k2neg:a,k2:c}=o.splitScalar(s);let{p:l,f:u}=this.wNAF(t),{p:d,f:p}=this.wNAF(c);l=f.constTimeNegate(e,l),d=f.constTimeNegate(a,d),d=new h(n.mul(d.px,o.beta),d.py,d.pz),r=l.add(d),i=u.add(p)}else{const{p:e,f:t}=this.wNAF(s);r=e,i=t}return h.normalizeZ([r,i])[0]}multiplyAndAddUnsafe(e,t,n){const r=h.BASE,i=(e,t)=>t!==hl&&t!==pl&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,n));return s.is0()?void 0:s}toAffine(e){const{px:t,py:r,pz:i}=this,s=this.is0();null==e&&(e=s?n.ONE:n.inv(i));const o=n.mul(t,e),a=n.mul(r,e),c=n.mul(i,e);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===pl)return!0;if(n)return n(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===pl?this:n?n(h,this):this.multiplyUnsafe(t.h)}toRawBytes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.assertValidity(),r(h,this,e)}toHex(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Ic(this.toRawBytes(e))}}h.BASE=new h(t.Gx,t.Gy,n.ONE),h.ZERO=new h(n.ZERO,n.ONE,n.ZERO);const p=t.nBitLength,f=function(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>ol;)n&al&&(r=r.add(i)),i=i.double(),n>>=al;return r},precomputeWindow(e,t){const{windows:n,windowSize:i}=r(t),s=[];let o=e,a=o;for(let r=0;r<n;r++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(t,i,s){const{windows:o,windowSize:a}=r(t);let c=e.ZERO,l=e.BASE;const u=BigInt(2**t-1),d=2**t,h=BigInt(t);for(let e=0;e<o;e++){const t=e*a;let r=Number(s&u);s>>=h,r>a&&(r-=d,s+=al);const o=t,p=t+Math.abs(r)-1,f=e%2!==0,g=r<0;0===r?l=l.add(n(f,i[o])):c=c.add(n(g,i[p]))}return{p:c,f:l}}
2,wNAFCached(e,t,n,r){const i=e._WINDOW_SIZE||1;let s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,r(s))),this.wNAF(i,s,n)}}}(h,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}function ml(e){const t=function(e){const t=cl(e);return zc(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze((0,i.A)({lowS:!0},t))}(e),{Fp:n,n:r}=t,s=n.BYTES+1,o=2*n.BYTES+1;function a(e){return Zc(e,r)}function c(e){return Xc(e,r)}const{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:h}=gl((0,i.A)((0,i.A)({},t),{},{toBytes(e,t,r){const i=t.toAffine(),s=n.toBytes(i.x),o=Uc;return r?o(Uint8Array.from([t.hasEvenY()?2:3]),s):o(Uint8Array.from([4]),s,n.toBytes(i.y))},fromBytes(e){const t=e.length,r=e[0],i=e.subarray(1);if(t!==s||2!==r&&3!==r){if(t===o&&4===r){return{x:n.fromBytes(i.subarray(0,n.BYTES)),y:n.fromBytes(i.subarray(n.BYTES,2*n.BYTES))}}throw new Error("Point of length ".concat(t," was invalid. Expected ").concat(s," compressed bytes or ").concat(o," uncompressed bytes"))}{const e=Pc(i);if(!(hl<(a=e)&&a<n.ORDER))throw new Error("Point is not on curve");const t=d(e);let s=n.sqrt(t);return 1===(1&r)!==((s&pl)===pl)&&(s=n.neg(s)),{x:e,y:s}}var a}})),p=e=>Ic(Nc(e,t.nByteLength));function f(e){return e>r>>pl}const g=(e,t,n)=>Pc(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=Mc("compactSignature",e,2*n),new m(g(e,0,n),g(e,n,2*n))}static fromDER(e){const{r:t,s:n}=dl.toSig(Mc("DER",e));return new m(t,n)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:i,recovery:s}=this,o=b(Mc("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw new Error("recovery id invalid");const u=2===s||3===s?r+t.n:r;if(u>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=0===(1&s)?"02":"03",h=l.fromHex(d+p(u)),f=c(u),g=a(-o*f),m=a(i*f),y=l.BASE.multiplyAndAddUnsafe(h,g,m);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Cc(this.toDERHex())}toDERHex(){return dl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Cc(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const y={isValidPrivateKey(e){try{return u(e),!0}catch(t){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const e=rl(t.n);return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.length,i=nl(t),s=rl(t);if(r<16||r<s||r>1024)throw new Error("expected ".concat(s,"-1024 bytes of input, got ").concat(r));const o=Zc(n?Pc(e):Oc(e),t-qc)+qc;return n?Rc(o,i):Nc(o,i)}(t.randomBytes(e),t.n)},precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function v(e){const t=e instanceof Uint8Array,n="string"===typeof e,r=(t||n)&&e.length;return t?r===s||r===o:n?r===2*s||r===2*o:e instanceof l}const w=t.bits2int||function(e){const n=Pc(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},b=t.bits2int_modN||function(e){return a(w(e))},A=Lc(t.nBitLength);function _(e){if("bigint"!==typeof e)throw new Error("bigint expected");if(!(hl<=e&&e<A))throw new Error("bigint expected < 2^".concat(t.nBitLength));return Nc(e,t.nByteLength)}function x(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;if(["recovered","canonical"].some(e=>e in i))throw new Error("sign() legacy options not supported");const{hash:s,randomBytes:o}=t;let{lowS:d,prehash:p,extraEntropy:g}=i;null==d&&(d=!0),e=Mc("msgHash",e),p&&(e=Mc("prehashed msgHash",s(e)));const y=b(e),v=u(r),A=[_(v),_(y)];if(null!=g){const e=!0===g?o(n.BYTES):g;A.push(Mc("extraEntropy",e))}const x=Uc(...A),k=y;return{seed:x,k2sig:function(e){const t=w(e);if(!h(t))return;const n=c(t),r=l.BASE.multiply(t).toAffine(),i=a(r.x);if(i===hl)return;const s=a(n*a(k+i*v));if(s===hl)return;let o=(r.x===i?0:2)|Number(r.y&pl),u=s;return d&&f(s)&&(u=function(e){return f(e)?a(-e):e}(s),o^=1),new m(i,u,o)}}}const E={lowS:t.lowS,prehash:!1},k={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(v(e))throw new Error("first arg must be private key");if(!v(t))throw new Error("second arg must be public key");return l.fromHex(t).multiply(u(e)).toRawBytes(n)},sign:function(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;const{seed:i,k2sig:s}=x(e,n,r),o=t;return jc(o.hash.outputLen,o.nByteLength,o.hmac)(i,s)},verify:function(e,n,r){var i;let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k;const o=e;if(n=Mc("msgHash",n),r=Mc("publicKey",r),"strict"in s)throw new Error("options.strict was renamed to lowS");const{lowS:u,prehash:d}=s;let h,p;try{if("string"===typeof o||o instanceof Uint8Array)try{h=m.fromDER(o)}
2catch(x){if(!(x instanceof dl.Err))throw x;h=m.fromCompact(o)}else{if("object"!==typeof o||"bigint"!==typeof o.r||"bigint"!==typeof o.s)throw new Error("PARSE");{const{r:e,s:t}=o;h=new m(e,t)}}p=l.fromHex(r)}catch(E){if("PARSE"===E.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&h.hasHighS())return!1;d&&(n=t.hash(n));const{r:f,s:g}=h,y=b(n),v=c(g),w=a(y*v),A=a(f*v),_=null===(i=l.BASE.multiplyAndAddUnsafe(p,w,A))||void 0===i?void 0:i.toAffine();return!!_&&a(_.x)===f},ProjectivePoint:l,Signature:m,utils:y}}function yl(e){return{hash:e,hmac:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return sl(e,t,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=new Uint8Array(t.reduce((e,t)=>e+t.length,0));let i=0;return t.forEach(e=>{if(!ye(e))throw new Error("Uint8Array expected");r.set(e,i),i+=e.length}),r}(...r))},randomBytes:xe}}const vl=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),wl=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),bl=BigInt(1),Al=BigInt(2),_l=(e,t)=>
vendor: 6,551 bytes, line 2
2(e+t/Al)/t;function xl(e){const t=vl,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Yc(u,n,t)*u%t,h=Yc(d,n,t)*u%t,p=Yc(h,Al,t)*l%t,f=Yc(p,i,t)*p%t,g=Yc(f,s,t)*f%t,m=Yc(g,a,t)*g%t,y=Yc(m,c,t)*m%t,v=Yc(y,a,t)*g%t,w=Yc(v,n,t)*u%t,b=Yc(w,o,t)*f%t,A=Yc(b,r,t)*l%t,_=Yc(A,Al,t);if(!El.eql(El.sqr(_),e))throw new Error("Cannot find square root");return _}const El=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e<=Wc)throw new Error("Expected Field ORDER > 0, got ".concat(e));const{nBitLength:i,nByteLength:s}=tl(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=$c(e),a=Object.freeze({ORDER:e,BITS:i,BYTES:s,MASK:Lc(i),ZERO:Wc,ONE:qc,create:t=>Zc(t,e),isValid:t=>{if("bigint"!==typeof t)throw new Error("Invalid field element: expected bigint, got ".concat(typeof t));return Wc<=t&&t<e},is0:e=>e===Wc,isOdd:e=>(e&qc)===qc,neg:t=>Zc(-t,e),eql:(e,t)=>e===t,sqr:t=>Zc(t*t,e),add:(t,n)=>Zc(t+n,e),sub:(t,n)=>Zc(t-n,e),mul:(t,n)=>Zc(t*n,e),pow:(e,t)=>function(e,t,n){if(n<Wc)throw new Error("Expected power > 0");if(n===Wc)return e.ONE;if(n===qc)return t;let r=e.ONE,i=t;for(;n>Wc;)n&qc&&(r=e.mul(r,i)),i=e.sqr(i),n>>=qc;return r}(a,e,t),div:(t,n)=>Zc(t*Xc(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Xc(t,e),sqrt:r.sqrt||(e=>o(a,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}(a,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?Rc(e,s):Nc(e,s),fromBytes:e=>{if(e.length!==s)throw new Error("Fp.fromBytes: expected ".concat(s,", got ").concat(e.length));return n?Oc(e):Pc(e)}});return Object.freeze(a)}(vl,void 0,void 0,{sqrt:xl}),kl=function(e,t){const n=t=>ml((0,i.A)((0,i.A)({},e),yl(t)));return Object.freeze((0,i.A)((0,i.A)({},n(t)),{},{create:n}))}({a:BigInt(0),b:BigInt(7),Fp:El,n:wl,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=wl,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-bl*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),a=_l(s*e,t),c=_l(-r*e,t);let l=Zc(e-a*n-c*i,t),u=Zc(-a*r-c*s,t);const d=l>o,h=u>o;if(d&&(l=t-l),h&&(u=t-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:h,k2:u}}}},oc);BigInt(0);kl.ProjectivePoint;var Sl=new WeakMap;class Il{constructor(e){X(this,Sl,void 0),Je(32===ot(e),"invalid private key","privateKey","[REDACTED]"),te(Sl,this,it(e))}get privateKey(){return ee(Sl,this)}get publicKey(){return Il.computePublicKey(ee(Sl,this))}get compressedPublicKey(){return Il.computePublicKey(ee(Sl,this),!0)}sign(e){Je(32===ot(e),"invalid digest length","digest",e);const t=kl.sign(et(e),et(ee(Sl,this)),{lowS:!0});return Hi.from({r:Mt(t.r,32),s:Mt(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=Il.computePublicKey(e);return it(kl.getSharedSecret(et(ee(Sl,this)),$e(t),!1))}static computePublicKey(e,t){let n=$e(e,"key");if(32===n.length){return it(kl.getPublicKey(n,!!t))}if(64===n.length){const e=new Uint8Array(65);e[0]=4,e.set(n,1),n=e}return it(kl.ProjectivePoint.fromHex(n).toRawBytes(t))}static recoverPublicKey(e,t){Je(32===ot(e),"invalid digest length","digest",e);const n=Hi.from(t);let r=kl.Signature.fromCompact(et(st([n.r,n.s])));r=r.addRecoveryBit(n.yParity);const i=r.recoverPublicKey(et(e));return Je(null!=i,"invalid signature for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){const r=kl.ProjectivePoint.fromHex(Il.computePublicKey(e).substring(2)),i=kl.ProjectivePoint.fromHex(Il.computePublicKey(t).substring(2));return"0x"+r.add(i).toHex(!!n)}}function Tl(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function Cl(e,t,n){let r=0;for(let i=0;i<n;i++)r=256*r+e[t+i];return r}function Pl(e,t,n,r){const i=[];for(;n<t+1+r;){const s=Ol(e,n);i.push(s.result),Ke((n+=s.consumed)<=t+1+r,"child data too short","BUFFER_OVERRUN",{buffer:e,length:r,offset:t})}return{consumed:1+r,result:i}}function Ol(e,t){Ke(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const n=t=>{Ke(t<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:t})};if(e[t]>=248){const r=e[t]-247;n(t+1+r);const i=Cl(e,t+1,r);return n(t+1+r+i),Pl(e,t,t+1+r,r+i)}if(e[t]>=192){const r=e[t]-192;return n(t+1+r),Pl(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;n(t+1+r);const i=Cl(e,t+1,r);n(t+1+r+i);return{consumed:1+r+i,result:it(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){const r=e[t]-128;n(t+1+r);return{consumed:1+r,result:it(e.slice(t+1,t+1+r))}}return{consumed:1,result:Tl(e[t])}}function Nl(e){const t=$e(e,"data"),n=Ol(t,0);return Je(n.consumed===t.length,"unexpected junk after rlp payload","data",e),n.result}function Rl(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function Ml(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(Ml(e))}),t.length<=55)return t.unshift(192+t.length),t;const n=Rl(t.length);return n.unshift(247+n.length),n.concat(t)}const t=Array.prototype.slice.call($e(e,"object"));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=Rl(t.length);return n.unshift(183+n.length),n.concat(t)}const Ul="0123456789abcdef";function Ll(e){let t="0x";for(const n of Ml(e))t+=Ul[n>>4],t+=Ul[15&n];return t}function Bl(e,t){return function(e){let t;return t="string"===typeof e?Il.computePublicKey(e,!1):e.publicKey,bt(pt("0x"+t.substring(4)).substring(26))}(Il.recoverPublicKey(e,t))}const Dl=BigInt(0),jl=BigInt(2),Fl=BigInt(27),zl=BigInt(28),Wl=BigInt(35),ql=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Hl=131072;function Vl(e,t){let n=e.toString(16);for(;n.length<2;)n="0"+n;return n+=Ac(t).substring(4),"0x"+n}function Gl(e){return"0x"===e?null:bt(e)}function Kl(e,t){try{return _t(e)}catch(n){Je(!1,n.message,t,e)}}function Jl(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(!Array.isArray(r))throw new Error("authorization[".concat(n,"]: invali
2d array"));if(6!==r.length)throw new Error("authorization[".concat(n,"]: wrong length"));if(!r[1])throw new Error("authorization[".concat(n,"]: null address"));t.push({address:Gl(r[1]),nonce:Ql(r[2],"nonce"),chainId:Ql(r[0],"chainId"),signature:Hi.from({yParity:Zl(r[3],"yParity"),r:lt(r[4],32),s:lt(r[5],32)})})}return t}catch(n){Je(!1,n.message,t,e)}}function Zl(e,t){return"0x"===e?0:Rt(e,t)}function Ql(e,t){if("0x"===e)return Dl;const n=Ct(e,t);return Je(n<=ql,"value exceeds uint size",t,n),n}function Yl(e,t){const n=Ct(e,"value"),r=Ut(n);return Je(r.length<=32,"value too large","tx.".concat(t),n),r}function Xl(e){return _t(e).map(e=>[e.address,e.storageKeys])}function $l(e,t){Je(Array.isArray(e),"invalid ".concat(t),"value",e);for(let n=0;n<e.length;n++)Je(tt(e[n],32),"invalid ${ param } hash","value[".concat(n,"]"),e[n]);return e}function eu(e,t){let n;try{if(n=Zl(t[0],"yParity"),0!==n&&1!==n)throw new Error("bad yParity")}catch(o){Je(!1,"invalid yParity","yParity",t[0])}const r=lt(t[1],32),i=lt(t[2],32),s=Hi.from({r:r,
2s:i,yParity:n});e.signature=s}var tu=new WeakMap,nu=new WeakMap,ru=new WeakMap,iu=new WeakMap,su=new WeakMap,ou=new WeakMap,au=new WeakMap,cu=new WeakMap,lu=new WeakMap,uu=new WeakMap,du=new WeakMap,hu=new WeakMap,pu=new WeakMap,fu=new WeakMap,gu=new WeakMap,mu=new WeakMap,yu=new WeakMap,vu=new WeakSet;class wu{get type(){return ee(tu,this)}set type(e){switch(e){case null:te(tu,this,null);break;case 0:case"legacy":te(tu,this,0);break;case 1:case"berlin":case"eip-2930":te(tu,this,1);break;case 2:case"london":case"eip-1559":te(tu,this,2);break;case 3:case"cancun":case"eip-4844":te(tu,this,3);break;case 4:case"pectra":case"eip-7702":te(tu,this,4);break;default:Je(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=ee(nu,this);return null==e&&3===this.type?Os:e}set to(e){te(nu,this,null==e?null:bt(e))}get nonce(){return ee(iu,this)}set nonce(e){te(iu,this,Rt(e,"value"))}get gasLimit(){return ee(su,this)}set gasLimit(e){te(su,this,Ct(e))}get gasPrice(){const e=ee(ou,this);return null!=e||0!==this.type&&1!==this.type?e:Dl}set gasPrice(e){te(ou,this,null==e?null:Ct(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=ee(au,this);return null==e?2===this.type||3===this.type?Dl:null:e}set maxPriorityFeePerGas(e){te(au,this,null==e?null:Ct(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=ee(cu,this);return null==e?2===this.type||3===this.type?Dl:null:e}set maxFeePerGas(e){te(cu,this,null==e?null:Ct(e,"maxFeePerGas"))}get data(){return ee(ru,this)}set data(e){te(ru,this,it(e))}get value(){return ee(lu,this)}set value(e){te(lu,this,Ct(e,"value"))}get chainId(){return ee(uu,this)}set chainId(e){te(uu,this,Ct(e))}get signature(){return ee(du,this)||null}set signature(e){te(du,this,null==e?null:Hi.from(e))}get accessList(){const e=ee(hu,this)||null;return null==e?1===this.type||2===this.type||3===this.type?[]:null:e}set accessList(e){te(hu,this,null==e?null:_t(e))}get authorizationList(){const e=ee(yu,this)||null;return null==e&&4===this.type?[]:e}set authorizationList(e){te(yu,this,null==e?null:e.map(e=>Vi(e)))}get maxFeePerBlobGas(){const e=ee(pu,this);return null==e&&3===this.type?Dl:e}set maxFeePerBlobGas(e){te(pu,this,null==e?null:Ct(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=ee(fu,this);return null==e&&3===this.type?[]:e}set blobVersionedHashes(e){if(null!=e){Je(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)Je(tt(e[t],32),"invalid blobVersionedHash","value[".concat(t,"]"),e[t])}te(fu,this,e)}get blobs(){return null==ee(mu,this)?null:ee(mu,this).map(e=>Object.assign({},e))}set blobs(e){if(null==e)return void te(mu,this,null);const t=[],n=[];for(let r=0;r<e.length;r++){const i=e[r];if(nt(i)){Ke(ee(gu,this),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let e=$e(i);if(Je(e.length<=Hl,"blob is too large","blobs[".concat(r,"]"),i),e.length!==Hl){const t=new Uint8Array(Hl);t.set(e),e=t}const s=ee(gu,this).blobToKzgCommitment(e),o=it(ee(gu,this).computeBlobKzgProof(e,s));t.push({data:it(e),commitment:it(s),proof:o}),n.push(Vl(1,s))}else{const e=it(i.commitment);t.push({data:it(i.data),commitment:e,proof:it(i.proof)}),n.push(Vl(1,e))}}te(mu,this,t),te(fu,this,n)}get kzg(){return ee(gu,this)}set kzg(e){te(gu,this,null==e?null:function(e){return{blobToKzgCommitment:t=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&"function"===typeof e.blobToKzgCommitment)return $e(e.blobToKzgCommitment(it(t)))}else if("blobToKzgCommitment"in e&&"function"===typeof e.blobToKzgCommitment)return $e(e.blobToKzgCommitment(t));if("blobToKZGCommitment"in e&&"function"===typeof e.blobToKZGCommitment)return $e(e.blobToKZGCommitment(it(t)));Je(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(t,n)=>"computeBlobProof"in e&&"function"===typeof e.computeBlobProof?$e(e.computeBlobProof(it(t),it(n))):"computeBlobKzgProof"in e&&"function"===typeof e.computeBlobKzgProof?e.computeBlobKzgProof(t,n):"c
2omputeBlobKZGProof"in e&&"function"===typeof e.computeBlobKZGProof?$e(e.computeBlobKZGProof(it(t),it(n))):void Je(!1,"unsupported KZG library","kzg",e)}}(e))}constructor(){Xt(this,vu),X(this,tu,void 0),X(this,nu,void 0),X(this,ru,void 0),X(this,iu,void 0),X(this,su,void 0),X(this,ou,void 0),X(this,au,void 0),X(this,cu,void 0),X(this,lu,void 0),X(this,uu,void 0),X(this,du,void 0),X(this,hu,void 0),X(this,pu,void 0),X(this,fu,void 0),X(this,gu,void 0),X(this,mu,void 0),X(this,yu,void 0),te(tu,this,null),te(nu,this,null),te(iu,this,0),te(su,this,Dl),te(ou,this,null),te(au,this,null),te(cu,this,null),te(ru,this,"0x"),te(lu,this,Dl),te(uu,this,Dl),te(du,this,null),te(hu,this,null),te(pu,this,null),te(fu,this,null),te(gu,this,null),te(mu,this,null),te(yu,this,null)}get hash(){return null==this.signature?null:pt($(vu,this,bu).call(this,!0,!1))}get unsignedHash(){return pt(this.unsignedSerialized)}get from(){return null==this.signature?null:Bl(this.unsignedHash,this.signature)}get fromPublicKey(){return null==this.signature?null:Il.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}get serialized(){return $(vu,this,bu).call(this,!0,!0)}get unsignedSerialized(){return $(vu,this,bu).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,t=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,n=null!=this.accessList,r=null!=ee(pu,this)||ee(fu,this);null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&Ke(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Ke(!t||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Ke(0!==this.type||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return null!=this.type?i.push(this.type):this.authorizationList&&this.authorizationList.length?i.push(4):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(r&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return wu.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new wu;if("string"===typeof e){const t=$e(e);if(t[0]>=127)return wu.from(function(e){const t=Nl(e);Je(Array.isArray(t)&&(9===t.length||6===t.length),"invalid field count for legacy transaction","data",e);const n={type:0,nonce:Zl(t[0],"nonce"),gasPrice:Ql(t[1],"gasPrice"),gasLimit:Ql(t[2],"gasLimit"),to:Gl(t[3]),value:Ql(t[4],"value"),data:it(t[5]),chainId:Dl};if(6===t.length)return n;const r=Ql(t[6],"v"),i=Ql(t[7],"r"),s=Ql(t[8],"s");if(i===Dl&&s===Dl)n.chainId=r;else{let e=(r-Wl)/jl;e<Dl&&(e=Dl),n.chainId=e,Je(e!==Dl||r===Fl||r===zl,"non-canonical legacy v","v",t[6]),n.signature=Hi.from({r:lt(t[7],32),s:lt(t[8],32),v:r})}return n}(t));switch(t[0]){case 1:return wu.from(function(e){const t=Nl($e(e).slice(1));Je(Array.isArray(t)&&(8===t.length||11===t.length),"invalid field count for transaction type: 1","data",it(e));const n={type:1,chainId:Ql(t[0],"chainId"),nonce:Zl(t[1],"nonce"),gasPrice:Ql(t[2],"gasPrice"),gasLimit:Ql(t[3],"gasLimit"),to:Gl(t[4]),value:Ql(t[5],"value"),data:it(t[6]),accessList:Kl(t[7],"accessList")};return 8===t.length||eu(n,t.slice(8)),n}(t));case 2:return wu.from(function(e){const t=Nl($e(e).slice(1));Je(Array.isArray(t)&&(9===t.length||12===t.length),"invalid field count for transaction type: 2","data",it(e));const n={type:2,chainId:Ql(t[0],"chainId"),nonce:Zl(t[1],"nonce"),maxPriorityFeePerGas:Ql(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ql(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ql(t[4],"gasLim
2it"),to:Gl(t[5]),value:Ql(t[6],"value"),data:it(t[7]),accessList:Kl(t[8],"accessList")};return 9===t.length||eu(n,t.slice(9)),n}(t));case 3:return wu.from(function(e){let t=Nl($e(e).slice(1)),n="3",r=null;if(4===t.length&&Array.isArray(t[0])){n="3 (network format)";const e=t[1],i=t[2],s=t[3];Je(Array.isArray(e),"invalid network format: blobs not an array","fields[1]",e),Je(Array.isArray(i),"invalid network format: commitments not an array","fields[2]",i),Je(Array.isArray(s),"invalid network format: proofs not an array","fields[3]",s),Je(e.length===i.length,"invalid network format: blobs/commitments length mismatch","fields",t),Je(e.length===s.length,"invalid network format: blobs/proofs length mismatch","fields",t),r=[];for(let n=0;n<t[1].length;n++)r.push({data:e[n],commitment:i[n],proof:s[n]});t=t[0]}Je(Array.isArray(t)&&(11===t.length||14===t.length),"invalid field count for transaction type: ".concat(n),"data",it(e));const i={type:3,chainId:Ql(t[0],"chainId"),nonce:Zl(t[1],"nonce"),maxPriorityFeePerGas:Ql(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ql(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ql(t[4],"gasLimit"),to:Gl(t[5]),value:Ql(t[6],"value"),data:it(t[7]),accessList:Kl(t[8],"accessList"),maxFeePerBlobGas:Ql(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};r&&(i.blobs=r),Je(null!=i.to,"invalid address for transaction type: ".concat(n),"data",e),Je(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let s=0;s<i.blobVersionedHashes.length;s++)Je(tt(i.blobVersionedHashes[s],32),"invalid blobVersionedHash at index ".concat(s,": must be length 32"),"data",e);return 11===t.length||eu(i,t.slice(11)),i}(t));case 4:return wu.from(function(e){const t=Nl($e(e).slice(1));Je(Array.isArray(t)&&(10===t.length||13===t.length),"invalid field count for transaction type: 4","data",it(e));const n={type:4,chainId:Ql(t[0],"chainId"),nonce:Zl(t[1],"nonce"),maxPriorityFeePerGas:Ql(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Ql(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Ql(t[4],"gasLimit"),to:Gl(t[5]),value:Ql(t[6],"value"),data:it(t[7]),accessList:Kl(t[8],"accessList"),authorizationList:Jl(t[9],"authorizationList")};return 10===t.length||eu(n,t.slice(10)),n}(t))}Ke(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new wu;return null!=e.type&&(t.type=e.type),null!=e.to&&(t.to=e.to),null!=e.nonce&&(t.nonce=e.nonce),null!=e.gasLimit&&(t.gasLimit=e.gasLimit),null!=e.gasPrice&&(t.gasPrice=e.gasPrice),null!=e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),null!=e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null!=e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),null!=e.data&&(t.data=e.data),null!=e.value&&(t.value=e.value),null!=e.chainId&&(t.chainId=e.chainId),null!=e.signature&&(t.signature=Hi.from(e.signature)),null!=e.accessList&&(t.accessList=e.accessList),null!=e.authorizationList&&(t.authorizationList=e.authorizationList),null!=e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),null!=e.kzg&&(t.kzg=e.kzg),null!=e.blobs&&(t.blobs=e.blobs),null!=e.hash&&(Je(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),Je(t.hash===e.hash,"hash mismatch","tx",e)),null!=e.from&&(Je(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),Je(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}function bu(e,t){Ke(!e||null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return function(e,t){const n=[Yl(e.nonce,"nonce"),Yl(e.gasPrice||0,"gasPrice"),Yl(e.gasLimit,"gasLimit"),e.to||"0x",Yl(e.value,"value"),e.data];let r=Dl;if(e.chainId!=Dl)r=Ct(e.chainId,"tx.chainId"),Je(!t||null==t.networkV||t.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(r=t)}if(!t)return r!==Dl&&(n.push(Ut(r)),n.push("0x"),n.push("0x")),Ll(n);let i=BigInt(27+t.yParity);return r!==Dl?i=Hi.getChainIdV(r,t.v):BigInt(t.v)!==i&&Je(!1,"tx.chainId/sig.v mismatch","sig",t),n.push(Ut(i)),n.push(Ut(t.r)),n.push(Ut(t.s)),Ll(n)}(this,n);case 1:return function(e,t){const n=[Yl(e.chainId,"chainId"),Yl(e.nonce,"nonce"),Yl(e.gasPrice||0,"gasPrice"),Yl(e.gasLim
2it,"gasLimit"),e.to||"0x",Yl(e.value,"value"),e.data,Xl(e.accessList||[])];return t&&(n.push(Yl(t.yParity,"recoveryParam")),n.push(Ut(t.r)),n.push(Ut(t.s))),st(["0x01",Ll(n)])}(this,n);case 2:return function(e,t){const n=[Yl(e.chainId,"chainId"),Yl(e.nonce,"nonce"),Yl(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Yl(e.maxFeePerGas||0,"maxFeePerGas"),Yl(e.gasLimit,"gasLimit"),e.to||"0x",Yl(e.value,"value"),e.data,Xl(e.accessList||[])];return t&&(n.push(Yl(t.yParity,"yParity")),n.push(Ut(t.r)),n.push(Ut(t.s))),st(["0x02",Ll(n)])}(this,n);case 3:return function(e,t,n){const r=[Yl(e.chainId,"chainId"),Yl(e.nonce,"nonce"),Yl(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Yl(e.maxFeePerGas||0,"maxFeePerGas"),Yl(e.gasLimit,"gasLimit"),e.to||Os,Yl(e.value,"value"),e.data,Xl(e.accessList||[]),Yl(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),$l(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(r.push(Yl(t.yParity,"yParity")),r.push(Ut(t.r)),r.push(Ut(t.s)),n)?st(["0x03",Ll([r,n.map(e=>e.data),n.map(e=>e.commitment),n.map(e=>e.proof)])]):st(["0x03",Ll(r)])}(this,n,t?this.blobs:null);case 4:return function(e,t){const n=[Yl(e.chainId,"chainId"),Yl(e.nonce,"nonce"),Yl(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Yl(e.maxFeePerGas||0,"maxFeePerGas"),Yl(e.gasLimit,"gasLimit"),e.to||"0x",Yl(e.value,"value"),e.data,Xl(e.accessList||[]),(r=e.authorizationList||[],r.map(e=>[Yl(e.chainId,"chainId"),e.address,Yl(e.nonce,"nonce"),Yl(e.signature.yParity,"yParity"),Ut(e.signature.r),Ut(e.signature.s)]))];var r;return t&&(n.push(Yl(t.yParity,"yParity")),n.push(Ut(t.r)),n.push(Ut(t.s))),st(["0x04",Ll(n)])}(this,n)}Ke(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}const Au="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const _u=BigInt(58);var xu;function Eu(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Je(!1,"unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}class ku{constructor(e){(0,Bt.A)(this,"name",void 0),We(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const Su=new RegExp("^(ipfs)://(.*)$","i"),Iu=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Su,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Tu=new WeakMap,Cu=new WeakMap,Pu=new WeakSet;class Ou{constructor(e,t,n){Xt(this,Pu),(0,Bt.A)(this,"provider",void 0),(0,Bt.A)(this,"address",void 0),(0,Bt.A)(this,"name",void 0),X(this,Tu,void 0),X(this,Cu,void 0),We(this,{provider:e,address:t,name:n}),te(Tu,this,null),te(Cu,this,new Fo(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return null==ee(Tu,this)&&te(Tu,this,(async()=>{try{return await ee(Cu,this).supportsInterface("0x9061b923")}catch(e){if(He(e,"CALL_EXCEPTION"))return!1;throw te(Tu,this,null),e}})()),await ee(Tu,this)}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await $(Pu,this,Nu).call(this,"addr(bytes32)");return null==e||e===Os?null:e}catch(i){if(He(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let t=e+2147483648;const n=await $(Pu,this,Nu).call(this,"addr(bytes32,uint)",[t]);if(tt(n,20))return bt(n)}let t=null;for(const s of this.provider.plugins)if(s instanceof ku&&s.supportsCoinType(e)){t=s;break}if(null==t)return null;const n=await $(Pu,this,Nu).call(this,"addr(bytes32,uint)",[e]);if(null==n||"0x"===n)return null;const r=await t.decodeAddress(e,n);if(null!=r)return r;Ke(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:"getAddress(".concat(e,")"),info:{coinType:e,data:n}})}async getText(e){const t=await $(Pu,this,Nu).call(this,"text(bytes32,string)",[e]);return null==t||"0x"===t?null:t}async getContentHash(){const e=await $(Pu,this,Nu).call(this,"contenthash(bytes32)");if(null==e||"0x"===e)return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e="e3010170"===t[1]?"ipfs":"ipns",n=parseInt(t[4],16);if(t[5].length===2*n)return"".concat(e,"://").concat(function(e){const t=$e(e);let n=Nt(t),r="";for(;n;)r=Au[Number(n%_u)]+r,n/=_u;for(let i=0;i<t.length&&!t[i];i++)r=Au[0]+r;return r}("0x"+t[2]))}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://".concat(n[1]);Ke(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(null==n)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r<Iu.length;r++){const i=n.match(Iu[r]);if(null==i)continue;const s=i[1].toLowerCase();switch(s){case"https":case"data":return e.push({type:"url",value:n}),{linkage:e,url:n};case"ipfs":{const t=Eu(n);return e.push({type:"ipfs",value:n}),e.push({type:"url",value:t}),{linkage:e,url:t}}case"erc721":case"erc1155":{const r="erc721"===s?"tokenURI(uint256)":"uri(uint256)";e.push({type:s,value:n});const o=await this.getAddress();if(null==o)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const a=(i[2]||"").split("/");if(2!==a.length)return e.push({type:"!".concat(s,"caip"),value:i[2]||""}),{url:null,linkage:e};const c=a[1],l=new Fo(a[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if("erc721"===s){const t=await l.ownerOf(c);if(o!==t)return e.push({type:"!owner",value:t}),{url:null,linkage:e};e.push({type:"owner",value:t})}else if("erc1155"===s){const t=await l.balanceOf(o,c);
2if(!t)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:t.toString()})}let u=await l[r](c);if(null==u||"0x"===u)return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:u}),"erc1155"===s&&(u=u.replace("{id}",Mt(c,32).substring(2)),e.push({type:"metadata-url-expanded",value:u})),u.match(/^ipfs:/i)&&(u=Eu(u)),e.push({type:"metadata-url",value:u});let d={};const h=await new As(u).send();h.assertOk();try{d=h.bodyJson}catch(t){try{e.push({type:"!metadata",value:h.bodyText})}catch(t){const n=h.body;return n&&e.push({type:"!metadata",value:it(n)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let p=d.image;if("string"!==typeof p)return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(p.match(/^(https:\/\/|data:)/i));else{if(null==p.match(Su))return e.push({type:"!imageUrl-ipfs",value:p}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:p}),p=Eu(p)}return e.push({type:"url",value:p}),{linkage:e,url:p}}}}}catch(t){}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return Ke(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async fromName(e,t){let n=t;for(;;){if(""===n||"."===n)return null;if("eth"!==t&&"eth"===n)return null;const r=await Ru.call(Ou,e,n);if(null!=r){const i=new Ou(e,r,t);return n===t||await i.supportsWildcard()?i:null}n=n.split(".").slice(1).join(".")}}}async function Nu(e,t){t=(t||[]).slice();const n=ee(Cu,this).interface;t.unshift(Ya(this.name));let r=null;await this.supportsWildcard()&&(r=n.getFunction(e),Ke(r,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[Xa(this.name,255),n.encodeFunctionData(r,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const i=await ee(Cu,this)[e](...t);return r?n.decodeFunctionResult(r,i)[0]:i}catch(i){if(!He(i,"CALL_EXCEPTION"))throw i}return null}async function Ru(e,t){const n=await xu.getEnsAddress(e);try{const r=new Fo(n,["function resolver(bytes32) view returns (address)"],e),i=await r.resolver(Ya(t),{enableCcipRead:!0});return i===Os?null:i}catch(r){throw r}}xu=Ou;const Mu=BigInt(0);function Uu(e,t){return function(n){return null==n?t:e(n)}}function Lu(e,t){return n=>{if(t&&null==n)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(t=>e(t))}}function Bu(e,t){return n=>{const r={};for(const s in e){let o=s;if(t&&s in t&&!(o in n))for(const e of t[s])if(e in n){o=e;break}try{const t=e[s](n[o]);void 0!==t&&(r[s]=t)}catch(i){const e=i instanceof Error?i.message:"not-an-error";Ke(!1,"invalid value for value.".concat(s," (").concat(e,")"),"BAD_DATA",{value:n})}}return r}}function Du(e){return Je(tt(e,!0),"invalid data","value",e),e}function ju(e){return Je(tt(e,32),"invalid hash","value",e),e}const Fu=Bu({address:bt,blockHash:ju,blockNumber:Rt,data:Du,index:Rt,removed:Uu(function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}Je(!1,"invalid boolean; ".concat(JSON.stringify(e)),"value",e)},!1),topics:Lu(ju),transactionHash:ju,transactionIndex:Rt},{index:["logIndex"]});const zu=Bu({hash:Uu(ju),parentHash:ju,parentBeaconBlockRoot:Uu(ju,null),number:Rt,timestamp:Rt,nonce:Uu(Du),difficulty:Ct,gasLimit:Ct,gasUsed:Ct,stateRoot:Uu(ju,null),receiptsRoot:Uu(ju,null),blobGasUsed:Uu(Ct,null),excessBlobGas:Uu(Ct,null),miner:Uu(bt),prevRandao:Uu(ju,null),extraData:Du,baseFeePerGas:Uu(Ct)},{prevRandao:["mixHash"]});const Wu=Bu({transactionIndex:Rt,blockNumber:Rt,transactionHash:ju,address:bt,topics:Lu(ju),data:Du,index:Rt,blockHash:ju},{index:["logIndex"]});const qu=Bu({to:Uu(bt,null),from:Uu(bt,null),contractAddress:Uu(bt,null),index:Rt,root:Uu(it),gasUsed:Ct,blobGasUsed:Uu(Ct,null),logsBloom:Uu(Du),blockHash:ju,hash:ju,logs:Lu(function(e){return Wu(e)}),blockNumber:Rt,cumulativeGasUsed:Ct,effectiveGasPrice:Uu(Ct),blobGasPrice:Uu(Ct,null),status:Uu(Rt),type:Uu(Rt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Hu(e){e.to&&Ct(e.to)===Mu&&(e.to="0x0000000000000000000000000000000000000000");const t=Bu({hash:ju,index:Uu(Rt,void 0),type:e=>"0x"===e||null==e?0:Rt(e),accessList:Uu(_t,null),blobVersionedHashes:Uu(Lu(ju,!0),null),authorizationList:Uu(Lu(e=>{let t;if(e.signature)t=e.signature;else{let n=e.yParity;"0x1b"===n?n=0:"0x1c"===n&&(n=1),t=Object.assign({},e,{yParity:n})}return{address:bt(e.address),chainId:Ct(e.chainId),nonce:Ct(e.nonce),signature:Hi.from(t)}},!1),null),blockHash:Uu(ju,null),blockNumber:Uu(Rt,null),transactionIndex:Uu(Rt,null),from:bt,gasPrice:Uu(Ct),maxPriorityFeePerGas:Uu(Ct),maxFeePerGas:Uu(Ct),maxFeePerBlobGas:Uu(Ct,null),gasLimit:Ct,to:Uu(bt,null),value:Ct,nonce:Rt,data:Du,creates:Uu(bt,null),chainId:Uu(Ct,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==t.to&&null==t.creates&&(t.creates=function(e){const t=bt(e.from);let n=Ct(e.nonce,"tx.nonce").toString(16);return n="0"===n?"0x":n.length%2?"0x0"+n:"0x"+n,bt(at(pt(Ll([t,n])),12))}(t)),1!==e.type&&2!==e.type||null!=e.accessList||(t.accessList=[]),e.signature?t.signature=Hi.from(e.signature):t.signature=Hi.from(e),null==t.chainId){const e=t.signature.legacyChainId;null!=e&&(t.chainId=e)}return t.blockHash&&Ct(t.blockHash)===Mu&&(t.blockHash=null),t}function Vu(e){return JSON.parse(JSON.stringify(e))}var Gu=new WeakMap,Ku=new WeakMap,Ju=new WeakMap,Zu=new WeakMap,Qu=new WeakSet;class Yu{constructor(e){Xt(this,Qu),X(this,Gu,void 0),X(this,Ku,void 0),X(this,Ju,void 0),X(this,Zu,void 0),te(Gu,this,e),te(Ku,this,null),te(Ju,this,4e3),te(Zu,this,-2)}get pollingInterval(){return ee(Ju,this)}set pollingInterval(e){te(Ju,this,e)}start(){ee(Ku,this)||(te(Ku,this,ee(Gu,this)._setTimeout($(Qu,this,Xu).bind(this),ee(Ju,this))),$(Qu,this,Xu).call(this))}stop(){ee(Ku,this)&&(ee(Gu,this)._clearTimeout(ee(Ku,this)),te(Ku,this,null))}pause(e){this.stop(),e&&te(Zu,this,-2)}resume(){this.start()}}async function Xu(){try{const e=await ee(Gu,this).getBlockNumber();if(-2===ee(Zu,this))return void te(Zu,this,e);if(e!==ee(Zu,this)){for(let t=ee(Zu,this)+1;t<=e;
2t++){if(null==ee(Ku,this))return;await ee(Gu,this).emit("block",t)}te(Zu,this,e)}}catch(e){}null!=ee(Ku,this)&&te(Ku,this,ee(Gu,this)._setTimeout($(Qu,this,Xu).bind(this),ee(Ju,this)))}var $u=new WeakMap,ed=new WeakMap,td=new WeakMap;class nd{constructor(e){X(this,$u,void 0),X(this,ed,void 0),X(this,td,void 0),te($u,this,e),te(td,this,!1),te(ed,this,e=>{this._poll(e,ee($u,this))})}async _poll(e,t){throw new Error("sub-classes must override this")}start(){ee(td,this)||(te(td,this,!0),ee(ed,this).call(this,-2),ee($u,this).on("block",ee(ed,this)))}stop(){ee(td,this)&&(te(td,this,!1),ee($u,this).off("block",ee(ed,this)))}pause(e){this.stop()}resume(){this.start()}}var rd=new WeakMap,id=new WeakMap;class sd extends nd{constructor(e,t){super(e),X(this,rd,void 0),X(this,id,void 0),te(rd,this,t),te(id,this,-2)}pause(e){e&&te(id,this,-2),super.pause(e)}async _poll(e,t){const n=await t.getBlock(ee(rd,this));null!=n&&(-2===ee(id,this)?te(id,this,n.number):n.number>ee(id,this)&&(t.emit(ee(rd,this),n.number),te(id,this,n.number)))}}var od=new WeakMap;class ad extends nd{constructor(e,t){super(e),X(this,od,void 0),te(od,this,Vu(t))}async _poll(e,t){throw new Error("@TODO")}}var cd=new WeakMap;class ld extends nd{constructor(e,t){super(e),X(this,cd,void 0),te(cd,this,t)}async _poll(e,t){const n=await t.getTransactionReceipt(ee(cd,this));n&&t.emit(ee(cd,this),n)}}var ud=new WeakMap,dd=new WeakMap,hd=new WeakMap,pd=new WeakMap,fd=new WeakMap,gd=new WeakSet;class md{constructor(e,t){Xt(this,gd),X(this,ud,void 0),X(this,dd,void 0),X(this,hd,void 0),X(this,pd,void 0),X(this,fd,void 0),te(ud,this,e),te(dd,this,Vu(t)),te(hd,this,$(gd,this,yd).bind(this)),te(pd,this,!1),te(fd,this,-2)}start(){ee(pd,this)||(te(pd,this,!0),-2===ee(fd,this)&&ee(ud,this).getBlockNumber().then(e=>{te(fd,this,e)}),ee(ud,this).on("block",ee(hd,this)))}stop(){ee(pd,this)&&(te(pd,this,!1),ee(ud,this).off("block",ee(hd,this)))}pause(e){this.stop(),e&&te(fd,this,-2)}resume(){this.start()}}async function yd(e){if(-2===ee(fd,this))return;const t=Vu(ee(dd,this));t.fromBlock=ee(fd,this)+1,t.toBlock=e;const n=await ee(ud,this).getLogs(t);if(0!==n.length)for(const r of n)ee(ud,this).emit(ee(dd,this),r),te(fd,this,r.blockNumber);else ee(fd,this)<e-60&&te(fd,this,e-60)}const vd=BigInt(2);function wd(e){return e&&"function"===typeof e.then}function bd(e,t){return e+":"+JSON.stringify(t,(e,t)=>{if(null==t)return"null";if("bigint"===typeof t)return"bigint:".concat(t.toString());if("string"===typeof t)return t.toLowerCase();if("object"===typeof t&&!Array.isArray(t)){const e=Object.keys(t);return e.sort(),e.reduce((e,n)=>(e[n]=t[n],e),{})}return t})}class Ad{constructor(e){(0,Bt.A)(this,"name",void 0),We(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function _d(e){return(e=Array.from(new Set(e).values())).sort(),e}async function xd(e,t){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"===typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if(tt(e,32)){const t=e.toLowerCase();return{type:"transaction",tag:bd("tx",{hash:t}),hash:t}}if(e.orphan){const t=e;return{type:"orphan",tag:bd("orphan",t),filter:(n=t,JSON.parse(JSON.stringify(n)))}}var n;if(e.address||e.topics){const n=e,r={topics:(n.topics||[]).map(e=>null==e?null:Array.isArray(e)?_d(e.map(e=>e.toLowerCase())):e.toLowerCase())};if(n.address){const e=[],i=[],s=n=>{tt(n)?e.push(n):i.push((async()=>{e.push(await ui(n,t))})())};Array.isArray(n.address)?n.address.forEach(s):s(n.address),i.length&&await Promise.all(i),r.address=_d(e.map(e=>e.toLowerCase()))}return{filter:r,tag:bd("event",r),type:"event"}}Je(!1,"unknown ProviderEvent","event",e)}function Ed(){return(new Date).getTime()}const kd={cacheTimeout:250,pollingInterval:4e3};var Sd=new WeakMap,Id=new WeakMap,Td=new WeakMap,Cd=new WeakMap,Pd=new WeakMap,Od=new WeakMap,Nd=new WeakMap,Rd=new WeakMap,Md=new WeakMap,Ud=new WeakMap,Ld=new WeakMap,Bd=new WeakMap,Dd=new WeakSet;class jd{constructor(e,t){if(Xt(this,Dd),X(this,Sd,void 0),X(this,Id,void 0),X(this,Td,void 0),X(this,Cd,void 0),X(this,Pd,void 0),X(this,Od,void 0),X(this,Nd,void 0),X(this,Rd,void 0),X(this,Md,void 0),X(this,Ud,void 0),X(this,Ld,void 0),X(this,Bd,void 0),te(Bd,this,Object.assign({},kd,t||{})),"any"===e)te(Od,this,!0),te(Pd,this,null);else if(e){const t=Jt.from(e);te(Od,this,!1),te(Pd,this,Promise.resolve(t)),setTimeout(()=>
2{this.emit("network",t,null)},0)}else te(Od,this,!1),te(Pd,this,null);te(Rd,this,-1),te(Nd,this,new Map),te(Sd,this,new Map),te(Id,this,new Map),te(Td,this,null),te(Cd,this,!1),te(Md,this,1),te(Ud,this,new Map),te(Ld,this,!1)}get pollingInterval(){return ee(Bd,this).pollingInterval}get provider(){return this}get plugins(){return Array.from(ee(Id,this).values())}attachPlugin(e){if(ee(Id,this).get(e.name))throw new Error("cannot replace existing plugin: ".concat(e.name," "));return ee(Id,this).set(e.name,e.connect(this)),this}getPlugin(e){return ee(Id,this).get(e)||null}get disableCcipRead(){return ee(Ld,this)}set disableCcipRead(e){te(Ld,this,!!e)}async ccipReadFetch(e,t,n){if(this.disableCcipRead||0===n.length||null==e.to)return null;const r=e.to.toLowerCase(),i=t.toLowerCase(),s=[];for(let a=0;a<n.length;a++){const t=n[a],c=t.replace("{sender}",r).replace("{data}",i),l=new As(c);-1===t.indexOf("{data}")&&(l.body={data:i,sender:r}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:l,index:a,urls:n});let u,d="unknown error";try{u=await l.send()}catch(o){s.push(o.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:l,result:{error:o}});continue}try{const e=u.bodyJson;if(e.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:l,result:e}),e.data;e.message&&(d=e.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:l,result:e})}catch(o){}Ke(u.statusCode<400||u.statusCode>=500,"response not found during CCIP fetch: ".concat(d),"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:t,errorMessage:d}}),s.push(d)}Ke(!1,"error encountered during CCIP fetch: ".concat(s.map(e=>JSON.stringify(e)).join(", ")),"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:s}})}_wrapBlock(e,t){return new Xs(function(e){const t=zu(e);return t.transactions=e.transactions.map(e=>"string"===typeof e?e:Hu(e)),t}(e),this)}_wrapLog(e,t){return new $s(function(e){return Fu(e)}(e),this)}_wrapTransactionReceipt(e,t){return new to(function(e){return qu(e)}(e),this)}_wrapTransactionResponse(e,t){return new ro(Hu(e),this)}_detectNetwork(){Ke(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Ke(!1,"unsupported method: ".concat(e.method),"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Rt(await $(Dd,this,Fd).call(this,{method:"getBlockNumber"}),"%response");return ee(Rd,this)>=0&&te(Rd,this,e),e}_getAddress(e){return ui(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return tt(e)?tt(e,32)?e:Lt(e):("bigint"===typeof e&&(e=Rt(e,"blockTag")),"number"===typeof e?e>=0?Lt(e):ee(Rd,this)>=0?Lt(ee(Rd,this)+e):this.getBlockNumber().then(t=>Lt(t+e)):void Je(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const t=(e.topics||[]).map(e=>null==e?null:Array.isArray(e)?_d(e.map(e=>e.toLowerCase())):e.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,r=(e,r,i
2)=>{let s;switch(e.length){case 0:break;case 1:s=e[0];break;default:e.sort(),s=e}if(n&&(null!=r||null!=i))throw new Error("invalid filter");const o={};return s&&(o.address=s),t.length&&(o.topics=t),r&&(o.fromBlock=r),i&&(o.toBlock=i),n&&(o.blockHash=n),o};let i,s,o=[];if(e.address)if(Array.isArray(e.address))for(const a of e.address)o.push(this._getAddress(a));else o.push(this._getAddress(e.address));return"fromBlock"in e&&(i=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),o.filter(e=>"string"!==typeof e).length||null!=i&&"string"!==typeof i||null!=s&&"string"!==typeof s?Promise.all([Promise.all(o),i,s]).then(e=>r(e[0],e[1],e[2])):r(o,i,s)}_getTransactionRequest(e){const t=Qs(e),n=[];if(["to","from"].forEach(e=>{if(null==t[e])return;const r=ui(t[e],this);wd(r)?n.push(async function(){t[e]=await r}()):t[e]=r}),null!=t.blockTag){const e=this._getBlockTag(t.blockTag);wd(e)?n.push(async function(){t.blockTag=await e}()):t.blockTag=e}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(null==ee(Pd,this)){const e=(async()=>{try{const e=await this._detectNetwork();return this.emit("network",e,null),e}catch(t){throw ee(Pd,this)===e&&te(Pd,this,null),t}})();return te(Pd,this,e),(await e).clone()}const e=ee(Pd,this),[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(ee(Od,this)?(this.emit("network",n,t),ee(Pd,this)===e&&te(Pd,this,Promise.resolve(n))):Ke(!1,"network changed: ".concat(t.chainId," => ").concat(n.chainId," "),"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:t,gasPrice:n,priorityFee:r}=await ze({_block:$(Dd,this,Hd).call(this,"latest",!1),gasPrice:(async()=>{try{return Ct(await $(Dd,this,Fd).call(this,{method:"getGasPrice"}),"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{return Ct(await $(Dd,this,Fd).call(this,{method:"getPriorityFee"}),"%response")}catch(e){}return null})()});let i=null,s=null;const o=this._wrapBlock(t,e);return o&&o.baseFeePerGas&&(s=null!=r?r:BigInt("1000000000"),i=o.baseFeePerGas*vd+s),new Zs(n,i,s)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const e=new As(n.url),r=await n.processFunc(t,this,e);return new Zs(r.gasPrice,r.maxFeePerGas,r.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return wd(t)&&(t=await t),Ct(await $(Dd,this,Fd).call(this,{method:"estimateGas",transaction:t}),"%response")}async call(e){const{tx:t,blockTag:n}=await ze({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await $(Dd,this,Wd).call(this,$(Dd,this,zd).call(this,t,n,e.enableCcipRead?0:-1))}async getBalance(e,t){return Ct(await $(Dd,this,qd).call(this,{method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return Rt(await $(Dd,this,qd).call(this,{method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return it(await $(Dd,this,qd).call(this,{method:"getCode"},e,t))}async getStorage(e,t,n){const r=Ct(t,"position");return it(await $(Dd,this,qd).call(this,{method:"getStorage",position:r},e,n))}async broadcastTransaction(e){const{blockNumber:t,hash:n,network:r}=await ze({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=wu.from(e);if(i.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,r).replaceableTransaction(t)}async getBlock(e,t){const{network:n,params:r}=await ze({network:this.getNetwork(),params:$(Dd,this,Hd).call(this,e,!!t)});return null==r?null:this._wrapBlock(r,n)}async getTransaction(e){const{network:t,params:n}=await ze({network:this.getNetwork(),params:$(Dd,this,Fd).call(this,{method:"getTransaction",hash:e})});return null==n?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){const{network:t,params:n}=await ze({network:this.getNetwork(),params:$(Dd,this,Fd).call(this,{method:"getTransactionReceipt",hash:e})});if(null==n)return null;if(null==n.gasPrice&&null==n.effectiveGasPrice){const t=await $(Dd,this,Fd).call(this,{method:"getTransaction",hash:e});if(null==t)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=t.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){const{result:t}=await ze({network:this.getNetwork(),result:$(Dd,this,Fd).call(this,{method:"getTransactionResult",hash:e})});return null==t?null:it(t)}async getLogs(e){let t=this._getFilter(e);wd(t)&&(t=await t);const{network:n,params:r}=await ze({network:this.getNetwork(),params:$(Dd,this,Fd).call(this,{method:"getLogs",filter:t})});return r.map(e=>this._wrapLog(e,n))}_getProvider(e){Ke(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Ou.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){const t=Ya((e=bt(e)).substring(2).toLowerCase()+".addr.reverse");try{const n=await Ou.getEnsAddress(this),r=new Fo(n,["function resolver(bytes32) view returns (address)"],this),i=await r.resolver(t);if(null==i||i===Os)return null;const s=new Fo(i,["function name(bytes32) view returns (string)"],this),o=await s.name(t);return await this.resolveName(o)!==e?null:o}catch(n){if(He(n,"BAD_DATA")&&"0x"===n.value)return null;if(He(n,"CALL_EXCEPTION"))return null;throw n}}async waitForTransaction(e,t,n){const r=null!=t?t:1;return 0===r?this.getTransactionReceipt(e):new Promise(async(t,i)=>{let s=null;const o=async n=>{try{const i=await this.getTransactionReceipt(e);
2if(null!=i&&n-i.blockNumber+1>=r)return t(i),void(s&&(clearTimeout(s),s=null))}catch(i){console.log("EEE",i)}this.once("block",o)};null!=n&&(s=setTimeout(()=>{null!=s&&(s=null,this.off("block",o),i(Ge("timeout","TIMEOUT",{reason:"timeout"})))},n)),o(await this.getBlockNumber())})}async waitForBlock(e){Ke(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=ee(Ud,this).get(e);t&&(t.timer&&clearTimeout(t.timer),ee(Ud,this).delete(e))}_setTimeout(e,t){var n,r;null==t&&(t=0);const i=(te(Md,this,(n=ee(Md,this),r=n++,n)),r),s=()=>{ee(Ud,this).delete(i),e()};if(this.paused)ee(Ud,this).set(i,{timer:null,func:s,time:t});else{const e=setTimeout(s,t);ee(Ud,this).set(i,{timer:e,func:s,time:Ed()})}return i}_forEachSubscriber(e){for(const t of ee(Sd,this).values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Ad(e.type);case"block":{const e=new Yu(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new sd(this,e.type);case"event":return new md(this,e.filter);case"transaction":return new ld(this,e.hash);case"orphan":return new ad(this,e.filter)}throw new Error("unsupported event: ".concat(e.type))}_recoverSubscriber(e,t){for(const n of ee(Sd,this).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),null!=ee(Td,this)&&t.pause(ee(Td,this));break}}async on(e,t){const n=await $(Dd,this,Gd).call(this,e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,null!=ee(Td,this)&&n.subscriber.pause(ee(Td,this))),this}async once(e,t){const n=await $(Dd,this,Gd).call(this,e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,null!=ee(Td,this)&&n.subscriber.pause(ee(Td,this))),this}async emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=await $(Dd,this,Vd).call(this,e,n);if(!i||0===i.listeners.length)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(t=>{let{listener:r,once:i}=t;const s=new ao(this,i?null:r,e);try{r.call(this,...n,s)}catch(o){}return!i}),0===i.listeners.length&&(i.started&&i.subscriber.stop(),ee(Sd,this).delete(i.tag)),s>0}async listenerCount(e){if(e){const t=await $(Dd,this,Vd).call(this,e);return t?t.listeners.length:0}let t=0;for(const{listeners:n}of ee(Sd,this).values())t+=n.length;return t}async listeners(e){if(e){const t=await $(Dd,this,Vd).call(this,e);return t?t.listeners.map(e=>{let{listener:t}=e;return t}):[]}let t=[];for(const{listeners:n}of ee(Sd,this).values())t=t.concat(n.map(e=>{let{listener:t}=e;return t}));return t}async off(e,t){const n=await $(Dd,this,Vd).call(this,e);if(!n)return this;if(t){const e=n.listeners.map(e=>{let{listener:t}=e;return t}).indexOf(t);e>=0&&n.listeners.splice(e,1)}return t&&0!==n.listeners.length||(n.started&&n.subscriber.stop(),ee(Sd,this).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:n,subscriber:r}=await $(Dd,this,Gd).call(this,e);n&&r.stop(),ee(Sd,this).delete(t)}else for(const[t,{started:n,subscriber:r}]of ee(Sd,this))n&&r.stop(),ee(Sd,this).delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return ee(Cd,this)}destroy(){this.removeAllListeners();for(const e of ee(Ud,this).keys())this._clearTimeout(e);te(Cd,this,!0)}get paused(){return null!=ee(Td,this)}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(te(Rd,this,-1),null!=ee(Td,this)){if(ee(Td,this)==!!e)return;Ke(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),te(Td,this,!!e);for(const t of ee(Ud,this).values())t.timer&&clearTimeout(t.timer),t.time=Ed()-t.time}resume(){if(null!=ee(Td,this)){this._forEachSubscriber(e=>e.resume()),te(Td,this,null);for(const e of ee(Ud,this).values()){let t=e.time;t<0&&(t=0),e.time=Ed(),setTimeout(e.func,t)}}}}async function Fd(e){const t=ee(Bd,this).cacheTimeout;if(t<0)return await this._perform(e);const n=bd(e.method,e);let r=ee(Nd,this).get(n);return r||(r=this._perform(e),ee(Nd,this).set(n,r),setTimeout(()=>{ee(Nd,this).get(n)===r&&ee(Nd,this).delete(n)},t)),await r}async function zd(e,t,n){Ke(n<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const r=Qs(e);try{return it(await this._perform({method:"call",transaction:r,blockTag:t}))}catch(i){if(!this.disableCcipRead&&Ve(i)&&i.data&&n>=0&&"latest"===t&&null!=r.to&&"0x556f1830"===at(i.data,0,4)){const e=i.data,s=await ui(r.to,this);let o;try{o=function(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};Ke(ot(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=at(e,0,32);Ke(at(n,0,12)===at($d,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=at(n,12);try{const n=[],r=Rt(at(e,32,64)),i=Rt(at(e,r,r+32)),s=at(e,r+32);for(let e=0;e<i;e++){const t=Kd(s,32*e);if(null==t)throw new Error("abort");n.push(t)}t.urls=n}catch(i){Ke(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=Jd(e,64);if(null==n)throw new Error("abort");t.calldata=n}catch(i){Ke(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}Ke(at(e,100,128)===at($d,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=at(e,96,100);try{const n=Jd(e,128);if(null==n)throw new Error("abort");t.extraData=n}catch(i){Ke(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}
2return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(e=>t[e]),t}(at(i.data,4))}catch(i){Ke(!1,i.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:r,info:{data:e}})}Ke(o.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:e,reason:"OffchainLookup",transaction:r,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:o.errorArgs}});const a=await this.ccipReadFetch(r,o.calldata,o.urls);Ke(null!=a,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:r,info:{data:i.data,errorArgs:o.errorArgs}});const c={to:s,data:st([o.selector,Xd([a,o.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const e=await $(Dd,this,zd).call(this,c,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:e}),e}catch(i){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:i}),i}}throw i}}async function Wd(e){const{value:t}=await ze({network:this.getNetwork(),value:e});return t}async function qd(e,t,n){let r=this._getAddress(t),i=this._getBlockTag(n);return"string"===typeof r&&"string"===typeof i||([r,i]=await Promise.all([r,i])),await $(Dd,this,Wd).call(this,$(Dd,this,Fd).call(this,Object.assign(e,{address:r,blockTag:i})))}async function Hd(e,t){if(tt(e,32))return await $(Dd,this,Fd).call(this,{method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return"string"!==typeof n&&(n=await n),await $(Dd,this,Fd).call(this,{method:"getBlock",blockTag:n,includeTransactions:t})}async function Vd(e,t){let n=await xd(e,this);return"event"===n.type&&t&&t.length>0&&!0===t[0].removed&&(n=await xd({orphan:"drop-log",log:t[0]},this)),ee(Sd,this).get(n.tag)||null}async function Gd(e){const t=await xd(e,this),n=t.tag;let r=ee(Sd,this).get(n);if(!r){r={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},ee(Sd,this).set(n,r)}return r}function Kd(e,t){try{const n=Jd(e,t);if(n)return Xn(n)}catch(n){}return null}function Jd(e,t){if("0x"===e)return null;try{const n=Rt(at(e,t,t+32)),r=Rt(at(e,n,n+32));return at(e,n+32,n+32+r)}catch(n){}return null}function Zd(e){const t=Ut(e);if(t.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(t,32-t.length),n}function Qd(e){if(e.length%32===0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}const Yd=new Uint8Array([]);function Xd(e){const t=[];let n=0;for(let r=0;r<e.length;r++)t.push(Yd),n+=32;for(let r=0;r<e.length;r++){const i=$e(e[r]);t[r]=Zd(n),t.push(Zd(i.length)),t.push(Qd(i)),n+=32+32*Math.ceil(i.length/32)}return st(t)}const $d="0x0000000000000000000000000000000000000000000000000000000000000000";function eh(e,t){if(e.provider)return e.provider;Ke(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function th(e,t){let n=Qs(t);if(null!=n.to&&(n.to=ui(n.to,e)),null!=n.from){const t=n.from;n.from=Promise.all([e.getAddress(),ui(t,e)]).then(e=>{let[t,n]=e;return Je(t.toLowerCase()===n.toLowerCase(),"transaction from mismatch","tx.from",n),t})}else n.from=e.getAddress();return await ze(n)}class nh{constructor(e){(0,Bt.A)(this,"provider",void 0),We(this,{provider:e||null})}async getNonce(e){return eh(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await th(this,e)}async populateTransaction(e){const t=eh(this,"populateTransaction"),n=await th(this,e);null==n.nonce&&(n.nonce=await this.getNonce("pending")),null==n.gasLimit&&(n.gasLimit=await this.estimateGas(n));const r=await this.provider.getNetwork();if(null!=n.chainId){Je(Ct(n.chainId)===r.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=r.chainId;const i=null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas;if(null==n.gasPrice||2!==n.type&&!i?0!==n.type&&1!==n.type||!i||Je(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):Je(!1,"eip-1559 transaction do n
2ot support gasPrice","tx",e),2!==n.type&&null!=n.type||null==n.maxFeePerGas||null==n.maxPriorityFeePerGas)if(0===n.type||1===n.type){const e=await t.getFeeData();Ke(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==n.gasPrice&&(n.gasPrice=e.gasPrice)}else{const e=await t.getFeeData();if(null==n.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,null!=n.gasPrice){const e=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=e,n.maxPriorityFeePerGas=e}else null==n.maxFeePerGas&&(n.maxFeePerGas=e.maxFeePerGas),null==n.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(Ke(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==n.gasPrice&&(n.gasPrice=e.gasPrice),n.type=0):Ke(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==n.type&&3!==n.type&&4!==n.type||(null==n.maxFeePerGas&&(n.maxFeePerGas=e.maxFeePerGas),null==n.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else n.type=2;return await ze(n)}async populateAuthorization(e){const t=Object.assign({},e);return null==t.chainId&&(t.chainId=(await eh(this,"getNetwork").getNetwork()).chainId),null==t.nonce&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return eh(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return eh(this,"call").call(await this.populateCall(e))}async resolveName(e){const t=eh(this,"resolveName");return await t.resolveName(e)}async sendTransaction(e){const t=eh(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const r=wu.from(n);return await t.broadcastTransaction(await this.signTransaction(r))}authorize(e){Ke(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}var rh=new WeakMap,ih=new WeakMap,sh=new WeakMap,oh=new WeakMap,ah=new WeakMap,ch=new WeakMap,lh=new WeakSet;class uh{constructor(e){Xt(this,lh),X(this,rh,void 0),X(this,ih,void 0),X(this,sh,void 0),X(this,oh,void 0),X(this,ah,void 0),X(this,ch,void 0),te(rh,this,e),te(ih,this,null),te(sh,this,$(lh,this,dh).bind(this)),te(oh,this,!1),te(ah,this,null),te(ch,this,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){ee(oh,this)||(te(oh,this,!0),$(lh,this,dh).call(this,-2))}stop(){ee(oh,this)&&(te(oh,this,!1),te(ch,this,!0),$(lh,this,hh).call(this),ee(rh,this).off("block",ee(sh,this)))}pause(e){e&&$(lh,this,hh).call(this),ee(rh,this).off("block",ee(sh,this))}resume(){this.start()}}async function dh(e){try{null==ee(ih,this)&&te(ih,this,this._subscribe(ee(rh,this)));let e=null;try{e=await ee(ih,this)}catch(t){if(!He(t,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==t.operation)throw t}if(null==e)return te(ih,this,null),void ee(rh,this)._recoverSubscriber(this,this._recover(ee(rh,this)));const n=await ee(rh,this).getNetwork();if(ee(ah,this)||te(ah,this,n),ee(ah,this).chainId!==n.chainId)throw new Error("chaid changed");if(ee(ch,this))return;const r=await ee(rh,this).send("eth_getFilterChanges",[e]);await this._emitResults(ee(rh,this),r)}catch(t){console.log("@TODO",t)}ee(rh,this).once("block",ee(sh,this))}function hh(){const e=ee(ih,this);e&&(te(ih,this,null),e.then(e=>{ee(rh,this).destroyed||ee(rh,this).send("eth_uninstallFilter",[e])}))}var ph=new WeakMap;class fh extends uh{constructor(e,t){var n;super(e),X(this,ph,void 0),te(ph,this,(n=t,JSON.parse(JSON.stringify(n))))}_recover(e){return new md(e,ee(ph,this))}async _subscribe(e){return await e.send("eth_newFilter",[ee(ph,this)])}async _emitResults(e,t){for(const n of t)e.emit(ee(ph,this),e._wrapLog(n,e._network))}}class gh extends uh{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const n of t)e.emit("pending",n)}}const mh="bigint,boolean,function,number,string,symbol".split(/,/g);function yh(e){if(null==e||mh.indexOf(typeof e)>=0)return e;if("function"===typeof e.getAddress)return e;if(Array.isArray(e))return e.map(yh);if("object"===typeof e)return Object.keys(e).reduce((t,n)=>(t[n]=e[n],t),{});throw new Error("should not happen: ".concat(e," (").concat(typeof e,")"))}function vh(e){return new Promise(t=>{setTimeout(t,e)})}function wh(e){return e?e.toLowerCase():e}function bh(e){return e&&"number"===typeof e.pollingInterval}const Ah={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class _h extends nh{constructor(e,t){super(e),(0,Bt.A)(this,"address",void 0),We(this,{address:t=bt(t)})}connect(e){Ke(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=yh(e),n=[];if(t.from){const r=t.from;n.push((async()=>{const n=await ui(r,this.provider);Je(null!=n&&n.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=n})())}else t.from=this.address;if(null==t.gasLimit&&n.push((async()=>
2{t.gasLimit=await this.provider.estimateGas((0,i.A)((0,i.A)({},t),{},{from:this.address}))})()),null!=t.to){const e=t.to;n.push((async()=>{t.to=await ui(e,this.provider)})())}n.length&&await Promise.all(n);const r=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[r])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((e,r)=>{const i=[1e3,100];let s=0;const o=async()=>{try{const r=await this.provider.getTransaction(n);if(null!=r)return void e(r.replaceableTransaction(t))}catch(a){if(He(a,"CANCELLED")||He(a,"BAD_DATA")||He(a,"NETWORK_ERROR")||He(a,"UNSUPPORTED_OPERATION"))return null==a.info&&(a.info={}),a.info.sendTransactionHash=n,void r(a);if(He(a,"INVALID_ARGUMENT")&&(s++,null==a.info&&(a.info={}),a.info.sendTransactionHash=n,s>10))return void r(a);this.provider.emit("error",Ge("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:a}))}this.provider._setTimeout(()=>{o()},i.pop()||4e3)};o()})}async signTransaction(e){const t=yh(e);if(t.from){const n=await ui(t.from,this.provider);Je(null!=n&&n.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=n}else t.from=this.address;const n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){const t="string"===typeof e?Yn(e):e;return await this.provider.send("personal_sign",[it(t),this.address.toLowerCase()])}async signTypedData(e,t,n){const r=yh(n),i=await Ci.resolveNames(e,t,r,async e=>{const t=await ui(e);return Je(null!=t,"TypedData does not support null address","value",e),t});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(Ci.getPayload(i.domain,t,i.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t="string"===typeof e?Yn(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),it(t)])}}var xh=new WeakMap,Eh=new WeakMap,kh=new WeakMap,Sh=new WeakMap,Ih=new WeakMap,Th=new WeakMap,Ch=new WeakMap,Ph=new WeakSet;class Oh extends jd{constructor(e,t){super(e,t),Xt(this,Ph),X(this,xh,void 0),X(this,Eh,void 0),X(this,kh,void 0),X(this,Sh,void 0),X(this,Ih,void 0),X(this,Th,void 0),X(this,Ch,void 0),te(Eh,this,1),te(xh,this,Object.assign({},Ah,t||{})),te(kh,this,[]),te(Sh,this,null),te(Th,this,null),te(Ch,this,null);{let e=null;const t=new Promise(t=>{e=t});te(Ih,this,{promise:t,resolve:e})}const n=this._getOption("staticNetwork");"boolean"===typeof n?(Je(!n||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",t),n&&null!=e&&te(Th,this,Jt.from(e))):n&&(Je(null==e||n.matches(e),"staticNetwork MUST match network object","options",t),te(Th,this,n))}_getOption(e){return ee(xh,this)[e]}get _network(){return Ke(ee(Th,this),"network is not available yet","NETWORK_ERROR"),ee(Th,this)}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let t=e.transaction;if(t&&null!=t.type&&Ct(t.type)&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const n=await this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},t,{type:void 0})}))}}const t=this.getRpcRequest(e);return null!=t?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(ee(Th,this))return ee(Th,this)}return ee(Ch,this)?await ee(Ch,this):this.ready?(te(Ch,this,(async()=>{try{const e=Jt.from(Ct(await this.send("eth_chainId",[])));return te(Ch,this,null),e}catch(e){throw te(Ch,this,null),e}})()),await ee(Ch,this)):(te(Ch,this,(async(e,t)=>{const n={id:(te(Eh,this,(e=ee(Eh,this),t=e++,e)),t),method:"eth_chainId",params:[],jsonrpc:"2.0"};let r;this.emit("debug",{action:"sendRpcPayload",payload:n});try{r=(await this._send(n))[0],te(Ch,this,null)}catch(i){throw te(Ch,this,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}
2if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return Jt.from(Ct(r.result));throw this.getRpcError(n,r)})()),await ee(Ch,this))}_start(){null!=ee(Ih,this)&&null!=ee(Ih,this).resolve&&(ee(Ih,this).resolve(),te(Ih,this,null),(async()=>{for(;null==ee(Th,this)&&!this.destroyed;)try{te(Th,this,await this._detectNetwork())}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Ge("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await vh(1e3)}$(Ph,this,Nh).call(this)})())}async _waitUntilReady(){if(null!=ee(Ih,this))return await ee(Ih,this).promise}_getSubscriber(e){return"pending"===e.type?new gh(this):"event"===e.type?this._getOption("polling")?new md(this,e.filter):new fh(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new Ad("orphan"):super._getSubscriber(e)}get ready(){return null==ee(Ih,this)}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(null==e[n])return;let r=n;"gasLimit"===n&&(r="gas"),t[r]=Lt(Ct(e[n],"tx.".concat(n)))}),["from","to","data"].forEach(n=>{null!=e[n]&&(t[n]=it(e[n]))}),e.accessList&&(t.accessList=_t(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(e=>e.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(e=>{const t=Vi(e);return{address:t.address,nonce:Lt(t.nonce),chainId:Lt(t.chainId),yParity:Lt(t.signature.yParity),r:Lt(t.signature.r),s:Lt(t.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[wh(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[wh(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[wh(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[wh(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(wh):e.filter.address=wh(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:n}=e,{error:r}=t;if("eth_estimateGas"===n&&r.message){const t=r.message;if(!t.match(/revert/i)&&t.match(/insufficient funds/i))return Ge("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:r}});if(t.match(/nonce/i)&&t.match(/too low/i))return Ge("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:r}})}if("eth_call"===n||"eth_estimateGas"===n){const t=Bh(r),i=oi.getBuiltinCallException("eth_call"===n?"call":"estimateGas",e.params[0],t?t.data:null);return i.info={error:r,payload:e},i}const i=JSON.stringify(function(e){const t=[];return Dh(e,t),t}(r));if("string"===typeof r.message&&r.message.match(/user denied|ethers-user-denied/i)){return Ge("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[n]||"unknown",reason:"rejected",info:{payload:e,error:r}})}if("eth_sendRawTransaction"===n||"eth_sendTransaction"===n){const t=e.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return Ge("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t,info:{error:r}});if(i.match(/nonce/i)&&i.match(/too low/i))return Ge("nonce has already been used","NONCE_EXPIRED",{transaction:t,info:{error:r}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return Ge("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t,info:{error:r}});if(i.match(/only replay-protected/i))return Ge("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:t,info:{error:r}}})}let s=!!i.match(/the method .* does not exist/i);return s||r&&r.details&&r.details.startsWith("Unauthorized method:")&&(s=!0),s?Ge("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:r,payload:e}}):Ge("could not coalesce error","UNKNOWN_ERROR",{error:r,payload:e})}send(e,t){var n,r;if(this.destroyed)return Promise.reject(Ge("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const i=(te(Eh,this,(n=ee(Eh,this),r=n++,n)),r),s=new Promise((n,r)=>{ee(kh,this).push({resolve:n,reject:r,payload:{method:e,params:t,id:i,jsonrpc:"2.0"}})});return $(Ph,this,Nh).call(this),s}async getSigner(e){null==e&&(e=0);const t=this.send("eth_accounts",[]);if("number"===typeof e){const n=await t;if(e>=n.length)throw new Error("no such account");return new _h(this,n[e])}const{accounts:n}=await ze({network:this.getNetwork(),accounts:t});e=bt(e);for(const r of n)if(bt(r)===e)return new _h(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(e=>new _h(this,e))}destroy(){ee(Sh,this)&&(clearTimeout(ee(Sh,this)),te(Sh,this,null));for(const{payload:e,reject:t}of ee(kh,this))t(Ge("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));te(kh,this,[]),super.destroy()}}function Nh(){if(ee(Sh,this))return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");te(Sh,this,setTimeout(()=>{te(Sh,this,null);const e=ee(kh,this);for(te(kh,this,[]);e.length;){const t=[e.shift()];for(;
2e.length&&t.length!==ee(xh,this).batchMaxCount;){t.push(e.shift());if(JSON.stringify(t.map(e=>e.payload)).length>ee(xh,this).batchMaxSize){e.unshift(t.pop());break}}(async()=>{const e=1===t.length?t[0].payload:t.map(e=>e.payload);this.emit("debug",{action:"sendRpcPayload",payload:e});try{const n=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:n});for(const{resolve:e,reject:r,payload:i}of t){if(this.destroyed){r(Ge("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:i.method}));continue}const t=n.filter(e=>e.id===i.id)[0];if(null==t){const e=Ge("missing response for request","BAD_DATA",{value:n,info:{payload:i}});this.emit("error",e),r(e);continue}"error"in t?r(this.getRpcError(i,t)):e(t.result)}}catch(n){this.emit("debug",{action:"receiveRpcError",error:n});for(const{reject:e}of t)e(n)}})()}},e))}var Rh=new WeakMap;class Mh extends Oh{constructor(e,t){super(e,t),X(this,Rh,void 0);let n=this._getOption("pollingInterval");null==n&&(n=Ah.pollingInterval),te(Rh,this,n)}_getSubscriber(e){const t=super._getSubscriber(e);return bh(t)&&(t.pollingInterval=ee(Rh,this)),t}get pollingInterval(){return ee(Rh,this)}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");te(Rh,this,e),this._forEachSubscriber(e=>{bh(e)&&(e.pollingInterval=ee(Rh,this))})}}var Uh=new WeakMap;class Lh extends Mh{constructor(e,t,n){null==e&&(e="http://localhost:8545"),super(t,n),X(this,Uh,void 0),te(Uh,this,"string"===typeof e?new As(e):e.clone())}_getConnection(){return ee(Uh,this).clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){const t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");const n=await t.send();n.assertOk();let r=n.bodyJson;return Array.isArray(r)||(r=[r]),r}}function Bh(e){if(null==e)return null;if("string"===typeof e.message&&e.message.match(/revert/i)&&tt(e.data))return{message:e.message,data:e.data};if("object"===typeof e){for(const t in e){const n=Bh(e[t]);if(n)return n}return null}if("string"===typeof e)try{return Bh(JSON.parse(e))}catch(t){}return null}function Dh(e,t){if(null!=e){if("string"===typeof e.message&&t.push(e.message),"object"===typeof e)for(const n in e)Dh(e[n],t);if("string"===typeof e)try{return Dh(JSON.parse(e),t)}catch(n){}}}var jh,Fh=new WeakMap,zh=new WeakMap;class Wh extends Mh{constructor(e,t,n){const r=Object.assign({},null!=n?n:{},{batchMaxCount:1});Je(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(t,r),X(this,Fh,void 0),X(this,zh,void 0),te(zh,this,null),n&&n.providerInfo&&te(zh,this,n.providerInfo),te(Fh,this,async(t,n)=>{const r={method:t,params:n};this.emit("debug",{action:"sendEip1193Request",payload:r});try{const t=await e.request(r);return this.emit("debug",{action:"receiveEip1193Result",result:t}),t}catch(i){const e=new Error(i.message);throw e.code=i.code,e.data=i.data,e.payload=r,this.emit("debug",{action:"receiveEip1193Error",error:e}),e}})}get providerInfo(){return ee(zh,this)}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){Je(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const t=await ee(Fh,this).call(this,e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch((t=JSON.parse(JSON.stringify(t))).error.code||-1){case 4001:t.error.message="ethers-user-denied: ".concat(t.error.message);break;case 4200:t.error.message="ethers-unsupported: ".concat(t.error.message)}return super.getRpcError(e,t)}async hasSigner(e){null==e&&(e=0);const t=await this.send("eth_accounts",[]);return"number"===typeof e?t.length>e:(e=e.toLowerCase(),0!==t.filter(t=>t.toLowerCase()===e).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await ee(Fh,this).call(this,"eth_requestAccounts",[])}catch(t){const e=t.payload;throw this.getRpcError(e,{id:e.id,error:t})}return await super.getSigner(e)}static async discover(e){if(null==e&&(e={}),e.provider)return new Wh(e.provider);const t=e.window?e.window:"undefined"!==typeof window?window:null;if(null==t)return null;const n=e.anyProvider;if(n&&t.ethereum)return new Wh(t.ethereum);if(!("addEventListener"in t&&"dispatchEvent"in t&&"removeEventListener"in t))return null;const r=e.timeout?e.timeout:300;return 0===r?null:await new Promise((i,s)=>{let o=[];const a=e=>{o.push(e.detail),n&&c()},c=()=>
2{if(clearTimeout(l),o.length)if(e&&e.filter){const t=e.filter(o.map(e=>Object.assign({},e.info)));if(null==t)i(null);else if(t instanceof Wh)i(t);else{let e=null;if(t.uuid){e=o.filter(e=>t.uuid===e.info.uuid)[0]}if(e){const{provider:t,info:n}=e;i(new Wh(t,void 0,{providerInfo:n}))}else s(Ge("filter returned unknown info","UNSUPPORTED_OPERATION",{value:t}))}}else{const{provider:e,info:t}=o[0];i(new Wh(e,void 0,{providerInfo:t}))}else i(null);t.removeEventListener("eip6963:announceProvider",a)},l=setTimeout(()=>{c()},r);t.addEventListener("eip6963:announceProvider",a),t.dispatchEvent(new Event("eip6963:requestProvider"))})}}const qh=BigInt(-1),Hh=BigInt(0),Vh=BigInt(1),Gh=BigInt(5),Kh={};let Jh="0000";for(;Jh.length<80;)Jh+=Jh;function Zh(e){let t=Jh;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function Qh(e,t,n){const r=BigInt(t.width);if(t.signed){const t=Vh<<r-Vh;Ke(null==n||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=e>Hh?St(Tt(e,r),r):-St(Tt(-e,r),r)}else{const t=Vh<<r;Ke(null==n||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=(e%t+t)%t&t-Vh}return e}function Yh(e){"number"===typeof e&&(e="fixed128x".concat(e));let t=!0,n=128,r=18;if("string"===typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Je(i,"invalid fixed format","format",e),t="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(e){const i=e,s=(e,t,n)=>null==i[e]?n:(Je(typeof i[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,i[e]),i[e]);t=s("signed","boolean",t),n=s("width","number",n),r=s("decimals","number",r)}Je(n%8===0,"invalid FixedNumber width (not byte aligned)","format.width",n),Je(r<=80,"invalid FixedNumber decimals (too large)","format.decimals",r);return{signed:t,width:n,decimals:r,name:(t?"":"u")+"fixed"+String(n)+"x"+String(r)}}var Xh=new WeakMap,$h=new WeakMap,ep=new WeakMap,tp=new WeakSet;class np{constructor(e,t,n){Xt(this,tp),(0,Bt.A)(this,"format",void 0),X(this,Xh,void 0),X(this,$h,void 0),X(this,ep,void 0),(0,Bt.A)(this,"_value",void 0),Ye(e,Kh,"FixedNumber"),te($h,this,t),te(Xh,this,n);const r=function(e,t){let n="";e<Hh&&(n="-",e*=qh);let r=e.toString();if(0===t)return n+r;for(;r.length<=t;)r=Jh+r;const i=r.length-t;for(r=r.substring(0,i)+"."+r.substring(i);"0"===r[0]&&"."!==r[1];)r=r.substring(1);for(;"0"===r[r.length-1]&&"."!==r[r.length-2];)r=r.substring(0,r.length-1);return n+r}(t,n.decimals);We(this,{format:n.name,_value:r}),te(ep,this,Zh(n.decimals))}get signed(){return ee(Xh,this).signed}get width(){return ee(Xh,this).width}get decimals(){return ee(Xh,this).decimals}get value(){return ee($h,this)}addUnsafe(e){return $(tp,this,sp).call(this,e)}add(e){return $(tp,this,sp).call(this,e,"add")}subUnsafe(e){return $(tp,this,op).call(this,e)}sub(e){return $(tp,this,op).call(this,e,"sub")}mulUnsafe(e){return $(tp,this,ap).call(this,e)}mul(e){return $(tp,this,ap).call(this,e,"mul")}mulSignal(e){$(tp,this,rp).call(this,e);const t=ee($h,this)*ee($h,e);return Ke(t%ee(ep,this)===Hh,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),$(tp,this,ip).call(this,t/ee(ep,this),"mulSignal")}divUnsafe(e){return $(tp,this,cp).call(this,e)}div(e){return $(tp,this,cp).call(this,e,"div")}divSignal(e){Ke(ee($h,e)!==Hh,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),$(tp,this,rp).call(this,e);const t=ee($h,this)*ee(ep,this);return Ke(t%ee($h,e)===Hh,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),$(tp,this,ip).call(this,t/ee($h,e),"divSignal")}cmp(e){let t=this.value,n=e.value;const r=this.decimals-e.decimals;return r>0?n*=Zh(r):r<0&&(t*=Zh(-r)),t<n?-1:t>n?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=ee($h,this);return ee($h,this)<Hh&&(e-=ee(ep,this)-Vh),e=ee($h,this)/ee(ep,this)*ee(ep,this),$(tp,this,ip).call(this,e,"floor")}ceiling(){let e=ee($h,this);return ee($h,this)>Hh&&(e+=ee(ep,this)-Vh),e=ee($h,this)/ee(ep,this)*ee(ep,this),$(tp,this,ip).call(this,e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,n=Gh*Zh(t-1);let r=this.value+n;const i=Zh(t);return r=r/i*i,Qh(r,ee(Xh,this),"round"),new np(Kh,r,ee(Xh,this))}isZero(){return ee($h,this)===Hh}isNegative(){return ee($h,this)<Hh}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return np.fromString(this.toString(),e)}static fromValue(e,t,n){const r=null==t?0:Rt(t),i=Yh(n);let s=Ct(e,"value");const o=r-i.decimals;if(o>0){const t=Zh(o);Ke(s%t===Hh,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=t}
2else o<0&&(s*=Zh(-o));return Qh(s,i,"fromValue"),new np(Kh,s,i)}static fromString(e,t){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);Je(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const r=Yh(t);let i=n[2]||"0",s=n[3]||"";for(;s.length<r.decimals;)s+=Jh;Ke(s.substring(r.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),s=s.substring(0,r.decimals);const o=BigInt(n[1]+i+s);return Qh(o,r,"fromString"),new np(Kh,o,r)}static fromBytes(e,t){let n=Nt($e(e,"value"));const r=Yh(t);return r.signed&&(n=St(n,r.width)),Qh(n,r,"fromBytes"),new np(Kh,n,r)}}function rp(e){Je(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}function ip(e,t){return e=Qh(e,ee(Xh,this),t),new jh(Kh,e,ee(Xh,this))}function sp(e,t){return $(tp,this,rp).call(this,e),$(tp,this,ip).call(this,ee($h,this)+ee($h,e),t)}function op(e,t){return $(tp,this,rp).call(this,e),$(tp,this,ip).call(this,ee($h,this)-ee($h,e),t)}function ap(e,t){return $(tp,this,rp).call(this,e),$(tp,this,ip).call(this,ee($h,this)*ee($h,e)/ee(ep,this),t)}function cp(e,t){return Ke(ee($h,e)!==Hh,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),$(tp,this,rp).call(this,e),$(tp,this,ip).call(this,ee($h,this)*ee(ep,this)/ee($h,e),t)}jh=np;const lp=["wei","kwei","mwei","gwei","szabo","finney","ether"];function up(e){return function(e,t){let n=18;if("string"===typeof t){const e=lp.indexOf(t);Je(e>=0,"invalid unit","unit",t),n=3*e}else null!=t&&(n=Rt(t,"unit"));return np.fromValue(e,n,{decimals:n,width:512}).toString()}(e,18)}const dp="0xa8Dc6cB4fF28804BcA04E58676BF61da3768f2E8",hp="0x06C7F79B0B2e1a5c169a71c1Db7CEa1883238A45",pp="https://bsc-dataseed.bnbchain.org",fp=56,gp="Binance",mp="BNB",yp="https://bscscan.com/",vp=18,wp="PAX",bp="https://raw.githubusercontent.com/mcret2024/tokendata/main/assets/images/pax.png",Ap=18,_p=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"AddressInsufficientBalance",type:"error"},{inputs:[],name:"FailedInnerCall",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"SafeERC20FailedOperation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"aggregatorInterface",outputs:[{internalType:"contract Aggregator",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"bnbBuyHelper",outputs:[{internalType:"uint256",name:"numOfTokens",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"buyWithBNB",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"buyWithUSDT",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_usdtAmount",type:"uint256"}],name:"calculateToken",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_startTime",type:"uint256"}],name:"changeSaleStartTime",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"convertBNBtoUSD",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBNBBalance",outputs:[{internalType:"uint256",name:"BNB",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentRoundIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLatestPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoundDetais",outputs:[{components:[{internalType:"uint256",name:"rate",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"uint256",name:"soldToken",type:"uint256"}],internalType:"struct Presale.Round",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTokenBalance",outputs:[{internalType:"uint256",name:"tokenBalance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTokenPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getUsdtBalance",outputs:[{internalType:"uint256",name:"usdtBalance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"minValuePurchaseUsd",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[{internalType:"bool",name:"success",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"rounds",outputs:[{internalType:"uint256",name:"rate",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"uint256",name:"soldToken",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"startTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalRounds",outputs:[{internalType:"uint256",name:"_rounds",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalTokenInPresale",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalTokensSold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalUsdAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[{internalType:"bool",name:"success",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_value",type:"uint256"}],name:"updateMinPurchaseValueUsd",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"rate",type:"uint256"},{internalType:"uint256",name:"_endTime",type:"uint256"}],name:"updateRounds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"usdt",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"withdrawBNB",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],xp=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"_decimal",type:"uint8"}],stateMutability:"nonpayable",type:"export constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}],Ep=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_upgradedAddress",type:"address"}],name:"deprecate",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"deprecated",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_evilUser",type:"address"}],name:"addBlackList",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"upgradedAddress",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"balances",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"maximumFee",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"_totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"unpause",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_maker",type:"address"}],name:"getBlackListStatus",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"},{name:"",type:"address"}],name:"allowed",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"paused",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"who",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"pause",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getOwner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"owner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"newBasisPoints",type:"uint256"},{name:"newMaxFee",type:"uint256"}],name:"setParams",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"amount",type:"uint256"}],name:"issue",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"amount",type:"uint256"}],name:"redeem",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"remaining",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"basisPointsRate",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"isBlackListed",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_clearedUser",type:"address"}],name:"removeBlackList",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"MAX_UINT",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_blackListedUser",type:"address"}],name:"destroyBlackFunds",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{name:"_initialSupply",type:"uint256"},{name:"_name",type:"string"},{name:"_symbol",type:"string"},{name:"_decimals",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:
vendor: 4,609 bytes, line 2
2[{indexed:!1,name:"amount",type:"uint256"}],name:"Issue",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"amount",type:"uint256"}],name:"Redeem",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"newAddress",type:"address"}],name:"Deprecate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"feeBasisPoints",type:"uint256"},{indexed:!1,name:"maxFee",type:"uint256"}],name:"Params",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"_blackListedUser",type:"address"},{indexed:!1,name:"_balance",type:"uint256"}],name:"DestroyedBlackFunds",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"_user",type:"address"}],name:"AddedBlackList",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"_user",type:"address"}],name:"RemovedBlackList",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[],name:"Pause",type:"event"},{anonymous:!1,inputs:[],name:"Unpause",type:"event"}];var kp,Sp,Ip=9e15,Tp=1e9,Cp="0123456789abcdef",Pp="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Op="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Np={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ip,maxE:Ip,crypto:!1},Rp=!0,Mp="[DecimalError] ",Up=Mp+"Invalid argument: ",Lp=Mp+"Precision limit exceeded",Bp=Mp+"crypto unavailable",Dp="[object Decimal]",jp=Math.floor,Fp=Math.pow,zp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Wp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,qp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Hp=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Vp=1e7,Gp=Pp.length-1,Kp=Op.length-1,Jp={toStringTag:Dp};function Zp(e){var t,n,r,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(s+=af(n)),s+=r;(n=7-(r=(o=e[t])+"").length)&&(s+=af(n))}else if(0===o)return"0";for(;o%10===0;)o/=10;return s+o}function Qp(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Up+e)}function Yp(e,t,n,r){var i,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),s=Fp(10,7-t),a=e[i]%s|0,null==r?t<3?(0==t?a=a/100|0:1==t&&(a=a/10|0),o=n<4&&99999==a||n>3&&49999==a||5e4==a||0==a):o=(n<4&&a+1==s||n>3&&a+1==s/2)&&(e[i+1]/s/100|0)==Fp(10,t-2)-1||(a==s/2||0==a)&&0==(e[i+1]/s/100|0):t<4?(0==t?a=a/1e3|0:1==t?a=a/100|0:2==t&&(a=a/10|0),o=(r||n<4)&&9999==a||!r&&n>3&&4999==a):o=((r||n<4)&&a+1==s||!r&&n>3&&a+1==s/2)&&(e[i+1]/s/1e3|0)==Fp(10,t-3)-1,o}
vendor: 9,667 bytes, line 2
2function Xp(e,t,n){for(var r,i,s=[0],o=0,a=e.length;o<a;){for(i=s.length;i--;)s[i]*=t;for(s[0]+=Cp.indexOf(e.charAt(o++)),r=0;r<s.length;r++)s[r]>n-1&&(void 0===s[r+1]&&(s[r+1]=0),s[r+1]+=s[r]/n|0,s[r]%=n)}return s.reverse()}Jp.absoluteValue=Jp.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),ef(e)},Jp.ceil=function(){return ef(new this.constructor(this),this.e+1,2)},Jp.clampedTo=Jp.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(Up+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},Jp.comparedTo=Jp.cmp=function(e){var t,n,r,i,s=this,o=s.d,a=(e=new s.constructor(e)).d,c=s.s,l=e.s;if(!o||!a)return c&&l?c!==l?c:o===a?0:!o^c<0?1:-1:NaN;if(!o[0]||!a[0])return o[0]?c:a[0]?-l:0;if(c!==l)return c;if(s.e!==e.e)return s.e>e.e^c<0?1:-1;for(t=0,n=(r=o.length)<(i=a.length)?r:i;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},Jp.cosine=Jp.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?i=(1/yf(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10");e.precision+=n,t=mf(e,1,t.times(i),new e(1));for(var s=n;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}(r,vf(r,n)),r.precision=e,r.rounding=t,ef(2==Sp||3==Sp?n.neg():n,e,t,!0)):new r(1):new r(NaN)},Jp.cubeRoot=Jp.cbrt=function(){var e,t,n,r,i,s,o,a,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(Rp=!1,(s=u.s*Fp(u.s*u,1/3))&&Math.abs(s)!=1/0?r=new d(s.toString()):(n=Zp(u.d),(s=((e=u.e)-n.length+1)%3)&&(n+=1==s||-2==s?"0":"00"),s=Fp(n,1/3),e=jp((e+1)/3)-(e%3==(e<0?-1:2)),(r=new d(n=s==1/0?"5e"+e:(n=s.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=u.s),o=(e=d.precision)+3;;)if(l=(c=(a=r).times(a).times(a)).plus(u),r=$p(l.plus(u).times(a),l.plus(c),o+2,1),Zp(a.d).slice(0,o)===(n=Zp(r.d)).slice(0,o)){if("9999"!=(n=n.slice(o-3,o+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(ef(r,e+1,1),t=!r.times(r).times(r).eq(u));break}if(!i&&(ef(a,e+1,0),a.times(a).times(a).eq(u))){r=a;break}o+=4,i=1}return Rp=!0,ef(r,e,d.rounding,t)},Jp.decimalPlaces=Jp.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-jp(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},Jp.dividedBy=Jp.div=function(e){return $p(this,new this.constructor(e))},Jp.dividedToIntegerBy=Jp.divToInt=function(e){var t=this.constructor;return ef($p(this,new t(e),0,1,1),t.precision,t.rounding)},Jp.equals=Jp.eq=function(e){return 0===this.cmp(e)},Jp.floor=function(){return ef(new this.constructor(this),this.e+1,3)},Jp.greaterThan=Jp.gt=function(e){return this.cmp(e)>0},Jp.greaterThanOrEqualTo=Jp.gte=function(e){var t=this.cmp(e);return 1==t||0===t},Jp.hyperbolicCosine=Jp.cosh=function(){var e,t,n,r,i,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;n=o.precision,r=o.rounding,o.precision=n+Math.max(s.e,s.sd())+4,o.rounding=1,(i=s.d.length)<32?t=(1/yf(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),s=mf(o,1,s.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=s.times(s),s=a.minus(c.times(u.minus(c.times(u))));return ef(s,o.precision=n,o.rounding=r,!0)},Jp.hyperbolicSine=Jp.sinh=function(){var e,t,n,r,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(t=s.precision,n=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,(r=i.d.length)<3)i=mf(s,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=mf(s,2,i=i.times(1/yf(5,e)),i,!0);for(var o,a=new s(5),c=new s(16),l=new s(20);e--;)o=i.times(i),i=i.times(a.plus(o.times(c.times(o).plus(l))))}return s.precision=t,s.rounding=n,ef(i,t,n,!0)},Jp.hyperbolicTangent=Jp.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,$p(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},Jp.inverseCosine=Jp.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return-1!==n?0===n?e.isNeg()?sf(t,r,i):new t(0):new t(NaN):e.isZero()?sf(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},Jp.inverseHyperbolicCosine=Jp.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Rp=!1,n=n.times(n).minus(1).sqrt().plus(n),Rp=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},Jp.inverseHyperbolicSine=Jp.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Rp=!1,n=n.times(n).plus(1).sqrt().plus(n),Rp=!0,r.precision=e,r.rounding=t,n.ln())},Jp.inverseHyperbolicTangent=Jp.atanh=function(){var e,t,n,r,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=s.precision,t=s.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?ef(new s(i),e,t,!0):(s.precision=n=r-i.e,i=$p(i.plus(1),new s(1).minus(i),n+e,1),s.precision=e+4,s.rounding=1,i=i.ln(),s.precision=e,s.rounding=t,i.times(.5))):new s(NaN)},Jp.inverseSine=Jp.asin=function(){var e,t,n,r,i=this,s=i.constructor;return i.isZero()?new s(i):(t=i.abs().cmp(1),n=s.precision,r=s.rounding,-1!==t?0===t?((e=sf(s,n+4,r).times(.5)).s=i.s,e):new s(NaN):(s.precision=n+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=n,s.rounding=r,i.times(2)))},Jp.inverseTangent=Jp.atan=function(){var e,t,n,r,i,s,o,a,c,l=this,u=l.constructor,d=u.precision,h=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=Kp)return(o=sf(u,d+4,h).times(.25)).s=l.s,o}else{if(!l.s)return new u(NaN);if(d+4<=Kp)return(o=sf(u,d+4,h).times(.5)).s=l.s,o}for(u.precision=a=d+10,u.rounding=1,e=n=Math.min(28,a/7+2|0);e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Rp=!1,t=Math.ceil(a/7),r=1,c=l.times(l),o=new u(l),i=l;-1!==e;)if(i=i.times(c),s=o.minus(i.div(r+=2)),i=i.times(c),void 0!==(o=s.plus(i.div(r+=2))).d[t])for(e=t;o.d[e]===s.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),Rp=!0,ef(o,u.precision=d,u.rounding=h,!0)},Jp.isFinite=function(){return!!this.d},Jp.isInteger=Jp.isInt=function(){return!!this.d&&jp(this.e/7)>this.d.length-2},Jp.isNaN=function(){return!this.s},Jp.isNegative=Jp.isNeg=function(){return this.s<0},Jp.isPositive=Jp.isPos=function(){return this.s>0},Jp.isZero=function(){return!!this.d&&0===this.d[0]},Jp.lessThan=Jp.lt=function(e){return this.cmp(e)<0},Jp.lessThanOrEqualTo=Jp.lte=function(e){return this.cmp(e)<1},Jp.logarithm=Jp.log=function(e){var t,n,r,i,s,o,a,c,l=this,u=l.constructor,d=u.precision,h=u.rounding;if(null==e)e=new u(10),t=!0;else{if(n=(e=new u(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new u(n&&!n[0]?-1/0:1!=l.s?NaN:n?0:1/0);if(t)if(n.length>1)s=!0;else{for(i=n[0];i%10===0;)i/=10;s=1!==i}if(Rp=!1,o=hf(l,a=d+5),r=t?rf(u,a+10):hf(e,a),Yp((c=$p(o,r,a,1)).d,i=d,h))do{if(o=hf(l,a+=10),r=t?rf(u,a+10):hf(e,a),c=$p(o,r,a,1),!s){+Zp(c.d).slice(i+1,i+15)+1==1e14&&(c=ef(c,d+1,0));break}}while(Yp(c.d,i+=10,h));return Rp=!0,ef(c,d,h)},Jp.minus=Jp.sub=function(e){var t,n,r,i,s,o,a,c,l,u,d,h,p=this,f=p.constructor;if(e=new f(e),!p.d||!e.d)return p.s&&e.s?p.d?e.s=-e.s:e=new f(e.d||p.s!==e.s?p:NaN):e=new f(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(l=p.d,h=e.d,a=f.precision,c=f.rounding,!l[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!l[0])return new f(3===c?-0:0);e=new f(p)}return Rp?ef(e,a,c):e}if(n=jp(e.e/7),u=jp(p.e/7),l=l.slice(),s=u-n){for((d=s<0)?(t=l,s=-s,o=h.length):(t=h,n=u,o=l.length),s>(r=Math.max(Math.ceil(a/7),o)+2)&&(s=r,t.length=1),t.reverse(),r=s;r--;)t.push(0);t.reverse()}else{for((d=(r=l.length)<(o=h.length))&&(o=r),r=0;r<o;r++)if(l[r]!=h[r]){d=l[r]<h[r];break}s=0}for(d&&(t=l,l=h,h=t,e.s=-e.s),o=l.length,r=h.length-o;r>0;--r)l[o++]=0;for(r=h.length;r>s;){if(l[--r]<h[r]){for(i=r;i&&0===l[--i];)l[i]=Vp-1;--l[i],l[r]+=Vp}l[r]-=h[r]}for(;0===l[--o];)l.pop();for(;0===l[0];l.shift())--n;return l[0]?(e.d=l,e.e=nf(l,n),Rp?ef(e,a,c):e):new f(3===c?-0:0)},Jp.modulo=Jp.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?ef(new r(n),r.precision,r.rounding):(Rp=!1,9==r.modulo?(t=$p(n,e.abs(),0,3,1)).s*=e.s:t=$p(n,e,0,r.modulo,1),t=t.times(e),Rp=!0,n.minus(t))},Jp.naturalExponential=Jp.exp=function(){return df(this)},Jp.naturalLogarithm=Jp.ln=function(){return hf(this)},Jp.negated=Jp.neg=function(){var e=new this.constructor(this);return e.s=-e.s,ef(e)},Jp.plus=Jp.add=function(e){var t,n,r,i,s,o,a,c,l,u,d=this,h=d.constructor;if(e=new h(e),!d.d||!e.d)return d.s&&e.s?d.d||(e=new h(e.d||d.s===e.s?d:NaN)):e=new h(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,a=h.precision,c=h.rounding,!l[0]||!u[0])return u[0]||(e=new h(d)),Rp?ef(e,a,c):e;if(s=jp(d.e/7),r=jp(e.e/7),l=l.slice(),i=s-r){for(i<0?(n=l,i=-i,o=u.length):(n=u,r=s,o=l.length),i>(o=(s=Math.ceil(a/7))>o?s+1:o+1)&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((o=l.length)-(i=u.length)<0&&(i=o,n=u,u=l,l=n),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/Vp|0,l[i]%=Vp;for(t&&(l.unshift(t),++r),o=l.length;0==l[--o];)l.pop();return e.d=l,e.e=nf(l,r),Rp?ef(e,a,c):e},Jp.precision=Jp.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(Up+e);return n.d?(t=of(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},Jp.round=function(){var e=this,t=e.constructor;
vendor: 5,175 bytes, line 2
2return ef(new t(e),e.e+1,t.rounding)},Jp.sine=Jp.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:mf(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=t.times(1/yf(5,n)),t=mf(e,2,t,t);for(var i,s=new e(5),o=new e(16),a=new e(20);n--;)i=t.times(t),t=t.times(s.plus(i.times(o.times(i).minus(a))));return t}(r,vf(r,n)),r.precision=e,r.rounding=t,ef(Sp>2?n.neg():n,e,t,!0)):new r(NaN)},Jp.squareRoot=Jp.sqrt=function(){var e,t,n,r,i,s,o=this,a=o.d,c=o.e,l=o.s,u=o.constructor;if(1!==l||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);for(Rp=!1,0==(l=Math.sqrt(+o))||l==1/0?(((t=Zp(a)).length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=jp((c+1)/2)-(c<0||c%2),r=new u(t=l==1/0?"5e"+c:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+c)):r=new u(l.toString()),n=(c=u.precision)+3;;)if(r=(s=r).plus($p(o,s,n+2,1)).times(.5),Zp(s.d).slice(0,n)===(t=Zp(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(ef(r,c+1,1),e=!r.times(r).eq(o));break}if(!i&&(ef(s,c+1,0),s.times(s).eq(o))){r=s;break}n+=4,i=1}return Rp=!0,ef(r,c,u.rounding,e)},Jp.tangent=Jp.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=$p(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,ef(2==Sp||4==Sp?n.neg():n,e,t,!0)):new r(NaN)},Jp.times=Jp.mul=function(e){var t,n,r,i,s,o,a,c,l,u=this,d=u.constructor,h=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!h||!h[0]||!p||!p[0])return new d(!e.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:h&&p?0*e.s:e.s/0);for(n=jp(u.e/7)+jp(e.e/7),(c=h.length)<(l=p.length)&&(s=h,h=p,p=s,o=c,c=l,l=o),s=[],r=o=c+l;r--;)s.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)a=s[i]+p[r]*h[i-r-1]+t,s[i--]=a%Vp|0,t=a/Vp|0;s[i]=(s[i]+t)%Vp|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=nf(s,n),Rp?ef(e,d.precision,d.rounding):e},Jp.toBinary=function(e,t){return wf(this,2,e,t)},Jp.toDecimalPlaces=Jp.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(Qp(e,0,Tp),void 0===t?t=r.rounding:Qp(t,0,8),ef(n,e+n.e+1,t))},Jp.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=tf(r,!0):(Qp(e,0,Tp),void 0===t?t=i.rounding:Qp(t,0,8),n=tf(r=ef(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},Jp.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return void 0===e?n=tf(i):(Qp(e,0,Tp),void 0===t?t=s.rounding:Qp(t,0,8),n=tf(r=ef(new s(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},Jp.toFraction=function(e){var t,n,r,i,s,o,a,c,l,u,d,h,p=this,f=p.d,g=p.constructor;if(!f)return new g(p);if(l=n=new g(1),r=c=new g(0),o=(s=(t=new g(r)).e=of(f)-p.e-1)%7,t.d[0]=Fp(10,o<0?7+o:o),null==e)e=s>0?t:l;else{if(!(a=new g(e)).isInt()||a.lt(l))throw Error(Up+a);e=a.gt(t)?s>0?t:l:a}for(Rp=!1,a=new g(Zp(f)),u=g.precision,g.precision=s=7*f.length*2;d=$p(a,t,0,1,1),1!=(i=n.plus(d.times(r))).cmp(e);)n=r,r=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=a.minus(d.times(i)),a=i;return i=$p(e.minus(n),r,0,1,1),c=c.plus(i.times(l)),n=n.plus(i.times(r)),c.s=l.s=p.s,h=$p(l,r,s,1).minus(p).abs().cmp($p(c,n,s,1).minus(p).abs())<1?[l,r]:[c,n],g.precision=u,Rp=!0,h},Jp.toHexadecimal=Jp.toHex=function(e,t){return wf(this,16,e,t)},Jp.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:Qp(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Rp=!1,n=$p(n,e,0,t,1).times(e),Rp=!0,ef(n)):(e.s=n.s,n=e),n},Jp.toNumber=function(){return+this},Jp.toOctal=function(e,t){return wf(this,8,e,t)},Jp.toPower=Jp.pow=function(e){var t,n,r,i,s,o,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(Fp(+a,l));if((a=new c(a)).eq(1))return a;if(r=c.precision,s=c.rounding,e.eq(1))return ef(a,r,s);if((t=jp(e.e/7))>=e.d.length-1&&(n=l<0?-l:l)<=9007199254740991)return i=cf(c,a,n,r),e.s<0?new c(1).div(i):ef(i,r,s);if((o=a.s)<0){if(t<e.d.length-1)return new c(NaN);if(0==(1&e.d[t])&&(o=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=o,a}return(t=0!=(n=Fp(+a,l))&&isFinite(n)?new c(n+"").e:jp(l*(Math.log("0."+Zp(a.d))/Math.LN10+a.e+1)))>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(Rp=!1,c.rounding=a.s=1,n=Math.min(12,(t+"").length),(i=df(e.times(hf(a,r+n)),r)).d&&Yp((i=ef(i,r+5,1)).d,r,s)&&(t=r+10,+Zp((i=ef(df(e.times(hf(a,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=ef(i,r+1,0))),i.s=o,Rp=!0,c.rounding=s,ef(i,r,s))},Jp.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=tf(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(Qp(e,1,Tp),void 0===t?t=i.rounding:Qp(t,0,8),n=tf(r=ef(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},Jp.toSignificantDigits=Jp.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(Qp(e,1,Tp),void 0===t?t=n.rounding:Qp(t,0,8)),ef(new n(this),e,t)},Jp.toString=function(){var e=this,t=e.constructor,n=tf(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n}
vendor: 10,818 bytes, line 2
2,Jp.truncated=Jp.trunc=function(){return ef(new this.constructor(this),this.e+1,1)},Jp.valueOf=Jp.toJSON=function(){var e=this,t=e.constructor,n=tf(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var $p=function(){function e(e,t,n){var r,i=0,s=e.length;for(e=e.slice();s--;)r=e[s]*t+i,e[s]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,s;if(n!=r)s=n>r?1:-1;else for(i=s=0;i<n;i++)if(e[i]!=t[i]){s=e[i]>t[i]?1:-1;break}return s}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,s,o,a,c){var l,u,d,h,p,f,g,m,y,v,w,b,A,_,x,E,k,S,I,T,C=r.constructor,P=r.s==i.s?1:-1,O=r.d,N=i.d;if(!O||!O[0]||!N||!N[0])return new C(r.s&&i.s&&(O?!N||O[0]!=N[0]:N)?O&&0==O[0]||!N?0*P:P/0:NaN);for(c?(p=1,u=r.e-i.e):(c=Vp,p=7,u=jp(r.e/p)-jp(i.e/p)),I=N.length,k=O.length,v=(y=new C(P)).d=[],d=0;N[d]==(O[d]||0);d++);if(N[d]>(O[d]||0)&&u--,null==s?(_=s=C.precision,o=C.rounding):_=a?s+(r.e-i.e)+1:s,_<0)v.push(1),f=!0;else{if(_=_/p+2|0,d=0,1==I){for(h=0,N=N[0],_++;(d<k||h)&&_--;d++)x=h*c+(O[d]||0),v[d]=x/N|0,h=x%N|0;f=h||d<k}else{for((h=c/(N[0]+1)|0)>1&&(N=e(N,h,c),O=e(O,h,c),I=N.length,k=O.length),E=I,b=(w=O.slice(0,I)).length;b<I;)w[b++]=0;(T=N.slice()).unshift(0),S=N[0],N[1]>=c/2&&++S;do{h=0,(l=t(N,w,I,b))<0?(A=w[0],I!=b&&(A=A*c+(w[1]||0)),(h=A/S|0)>1?(h>=c&&(h=c-1),1==(l=t(g=e(N,h,c),w,m=g.length,b=w.length))&&(h--,n(g,I<m?T:N,m,c))):(0==h&&(l=h=1),g=N.slice()),(m=g.length)<b&&g.unshift(0),n(w,g,b,c),-1==l&&(l=t(N,w,I,b=w.length))<1&&(h++,n(w,I<b?T:N,b,c)),b=w.length):0===l&&(h++,w=[0]),v[d++]=h,l&&w[0]?w[b++]=O[E]||0:(w=[O[E]],b=1)}while((E++<k||void 0!==w[0])&&_--);f=void 0!==w[0]}v[0]||v.shift()}if(1==p)y.e=u,kp=f;else{for(d=1,h=v[0];h>=10;h/=10)d++;y.e=d+u*p-1,ef(y,a?s+y.e+1:s,o,f)}return y}}();function ef(e,t,n,r){var i,s,o,a,c,l,u,d,h,p=e.constructor;e:if(null!=t){if(!(d=e.d))return e;for(i=1,a=d[0];a>=10;a/=10)i++;if((s=t-i)<0)s+=7,o=t,c=(u=d[h=0])/Fp(10,i-o-1)%10|0;else if((h=Math.ceil((s+1)/7))>=(a=d.length)){if(!r)break e;for(;a++<=h;)d.push(0);u=c=0,i=1,o=(s%=7)-7+1}else{for(u=a=d[h],i=1;a>=10;a/=10)i++;c=(o=(s%=7)-7+i)<0?0:u/Fp(10,i-o-1)%10|0}if(r=r||t<0||void 0!==d[h+1]||(o<0?u:u%Fp(10,i-o-1)),l=n<4?(c||r)&&(0==n||n==(e.s<0?3:2)):c>5||5==c&&(4==n||r||6==n&&(s>0?o>0?u/Fp(10,i-o):0:d[h-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=Fp(10,(7-t%7)%7),e.e=-t||0):d[0]=e.e=0,e;if(0==s?(d.length=h,a=1,h--):(d.length=h+1,a=Fp(10,7-s),d[h]=o>0?(u/Fp(10,i-o)%Fp(10,o)|0)*a:0),l)for(;;){if(0==h){for(s=1,o=d[0];o>=10;o/=10)s++;for(o=d[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,d[0]==Vp&&(d[0]=1));break}if(d[h]+=a,d[h]!=Vp)break;d[h--]=0,a=1}for(s=d.length;0===d[--s];)d.pop()}return Rp&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function tf(e,t,n){if(!e.isFinite())return pf(e);var r,i=e.e,s=Zp(e.d),o=s.length;return t?(n&&(r=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+af(r):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):i<0?(s="0."+af(-i-1)+s,n&&(r=n-o)>0&&(s+=af(r))):i>=o?(s+=af(i+1-o),n&&(r=n-i-1)>0&&(s=s+"."+af(r))):((r=i+1)<o&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(s+="."),s+=af(r))),s}function nf(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function rf(e,t,n){if(t>Gp)throw Rp=!0,n&&(e.precision=n),Error(Lp);return ef(new e(Pp),t,1,!0)}function sf(e,t,n){if(t>Kp)throw Error(Lp);return ef(new e(Op),t,n,!0)}function of(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function af(e){for(var t="";e--;)t+="0";return t}function cf(e,t,n,r){var i,s=new e(1),o=Math.ceil(r/7+4);for(Rp=!1;;){if(n%2&&bf((s=s.times(t)).d,o)&&(i=!0),0===(n=jp(n/2))){n=s.d.length-1,i&&0===s.d[n]&&++s.d[n];break}bf((t=t.times(t)).d,o)}return Rp=!0,s}function lf(e){return 1&e.d[e.d.length-1]}function uf(e,t,n){for(var r,i,s=new e(t[0]),o=0;++o<t.length;){if(!(i=new e(t[o])).s){s=i;break}((r=s.cmp(i))===n||0===r&&s.s===n)&&(s=i)}return s}function df(e,t){var n,r,i,s,o,a,c,l=0,u=0,d=0,h=e.constructor,p=h.rounding,f=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(Rp=!1,c=f):c=t,a=new h(.03125);e.e>-2;)e=e.times(a),d+=5;for(c+=r=Math.log(Fp(2,d))/Math.LN10*2+5|0,n=s=o=new h(1),h.precision=c;;){if(s=ef(s.times(e),c,1),n=n.times(++u),Zp((a=o.plus($p(s,n,c,1))).d).slice(0,c)===Zp(o.d).slice(0,c)){for(i=d;i--;)o=ef(o.times(o),c,1);if(null!=t)return h.precision=f,o;if(!(l<3&&Yp(o.d,c-r,p,l)))return ef(o,h.precision=f,p,Rp=!0);h.precision=c+=10,n=s=a=new h(1),u=0,l++}o=a}}function hf(e,t){var n,r,i,s,o,a,c,l,u,d,h,p=1,f=e,g=f.d,m=f.constructor,y=m.rounding,v=m.precision;if(f.s<0||!g||!g[0]||!f.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=f.s?NaN:g?0:f);if(null==t?(Rp=!1,u=v):u=t,m.precision=u+=10,r=(n=Zp(g)).charAt(0),!(Math.abs(s=f.e)<15e14))return l=rf(m,u+2,v).times(s+""),f=hf(new m(r+"."+n.slice(1)),u-10).plus(l),m.precision=v,null==t?ef(f,v,y,Rp=!0):f;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=Zp((f=f.times(e)).d)).charAt(0),p++;for(s=f.e,r>1?(f=new m("0."+n),s++):f=new m(r+"."+n.slice(1)),d=f,c=o=f=$p(f.minus(1),f.plus(1),u,1),h=ef(f.times(f),u,1),i=3;;){if(o=ef(o.times(h),u,1),Zp((l=c.plus($p(o,new m(i),u,1))).d).slice(0,u)===Zp(c.d).slice(0,u)){if(c=c.times(2),0!==s&&(c=c.plus(rf(m,u+2,v).times(s+""))),c=$p(c,new m(p),u,1),null!=t)return m.precision=v,c;if(!Yp(c.d,u-10,y,a))return ef(c,m.precision=v,y,Rp=!0);m.precision=u+=10,l=o=f=$p(d.minus(1),d.plus(1),u,1),h=ef(f.times(f),u,1),i=a=1}c=l,i+=2}}function pf(e){return String(e.s*e.s/0)}function ff(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";e.d.push(+t),Rp&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function gf(e,t){var n,r,i,s,o,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Hp.test(t))return ff(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Wp.test(t))n=16,t=t.toLowerCase();else if(zp.test(t))n=2;else{if(!qp.test(t))throw Error(Up+t);n=8}for((s=t.search(/p/i))>0?(c=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),o=(s=t.indexOf("."))>=0,r=e.constructor,o&&(s=(a=(t=t.replace(".","")).length)-s,i=cf(r,new r(n),s,2*s)),s=u=(l=Xp(t,n,Vp)).length-1;0===l[s];--s)l.pop();return s<0?new r(0*e.s):(e.e=nf(l,u),e.d=l,Rp=!1,o&&(e=$p(e,i,4*a)),c&&(e=e.times(Math.abs(c)<54?Fp(2,c):ag.pow(2,c))),Rp=!0,e)}function mf(e,t,n,r,i){var s,o,a,c,l=e.precision,u=Math.ceil(l/7);for(Rp=!1,c=n.times(n),a=new e(r);;){if(o=$p(a.times(c),new e(t++*t++),l,1),a=i?r.plus(o):r.minus(o),r=$p(o.times(c),new e(t++*t++),l,1),void 0!==(o=a.plus(r)).d[u]){for(s=u;o.d[s]===a.d[s]&&s--;);if(-1==s)break}s=a,a=r,r=o,o=s}return Rp=!0,o.d.length=u+1,o}function yf(e,t){for(var n=e;--t;)n*=e;return n}function vf(e,t){var n,r=t.s<0,i=sf(e,e.precision,1),s=i.times(.5);if((t=t.abs()).lte(s))return Sp=r?4:1,t;if((n=t.divToInt(i)).isZero())Sp=r?3:2;else{if((t=t.minus(n.times(i))).lte(s))return Sp=lf(n)?r?2:3:r?4:1,t;Sp=lf(n)?r?1:4:r?3:2}return t.minus(i).abs()}function wf(e,t,n,r){var i,s,o,a,c,l,u,d,h,p=e.constructor,f=void 0!==n;if(f?(Qp(n,1,Tp),void 0===r?r=p.rounding:Qp(r,0,8)):(n=p.precision,r=p.rounding),e.isFinite()){for(f?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(o=(u=tf(e)).indexOf("."))>=0&&(u=u.replace(".",""),(h=new p(1)).e=u.length-o,h.d=Xp(tf(h),10,i),h.e=h.d.length),s=c=(d=Xp(u,10,i)).length;0==d[--c];)d.pop();if(d[0]){if(o<0?s--:((e=new p(e)).d=d,e.e=s,d=(e=$p(e,h,n,r,0,i)).d,s=e.e,l=kp),o=d[n],a=i/2,l=l||void 0!==d[n+1],l=r<4?(void 0!==o||l)&&(0===r||r===(e.s<0?3:2)):o>a||o===a&&(4===r||l||6===r&&1&d[n-1]||r===(e.s<0?8:7)),d.length=n,l)for(;++d[--n]>i-1;)d[n]=0,n||(++s,d.unshift(1));for(c=d.length;!d[c-1];--c);for(o=0,u="";o<c;o++)u+=Cp.charAt(d[o]);if(f){if(c>1)if(16==t||8==t){for(o=16==t?4:3,--c;c%o;c++)u+="0";for(c=(d=Xp(u,i,t)).length;!d[c-1];--c);for(o=1,u="1.";o<c;o++)u+=Cp.charAt(d[o])}else u=u.charAt(0)+"."+u.slice(1);u=u+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)u="0"+u;u="0."+u}else if(++s>c)for(s-=c;s--;)u+="0";else s<c&&(u=u.slice(0,s)+"."+u.slice(s))}else u=f?"0p+0":"0";u=(16==t?"0x":2==t?"0b":8==t?"0o":"")+u}else u=pf(e);return e.s<0?"-"+u:u}function bf(e,t){if(e.length>t)return e.length=t,!0}function Af(e){return new this(e).abs()}function _f(e){return new this(e).acos()}function xf(e){return new this(e).acosh()}function Ef(e,t){return new this(e).plus(t)}function kf(e){return new this(e).asin()}function Sf(e){return new this(e).asinh()}function If(e){return new this(e).atan()}function Tf(e){return new this(e).atanh()}function Cf(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,s=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?sf(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=sf(this,s,1).times(.5)).s=e.s:t.s<0?(this.precision=s,this.rounding=1,n=this.atan($p(e,t,s,1)),t=sf(this,s,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan($p(e,t,s,1)):(n=sf(this,s,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function Pf(e){return new this(e).cbrt()}function Of(e){return ef(e=new this(e),e.e+1,2)}function Nf(e,t,n){return new this(e).clamp(t,n)}function Rf(e){if(!e||"object"!==typeof e)throw Error(Mp+"Object expected");var t,n,r,i=!0===e.defaults,s=["precision",1,Tp,"rounding",0,8,"toExpNeg",-Ip,0,"toExpPos",0,Ip,"maxE",0,Ip,"minE",-Ip,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(n=s[t],i&&(this[n]=Np[n]),void 0!==(r=e[n])){if(!(jp(r)===r&&r>=s[t+1]&&r<=s[t+2]))throw Error(Up+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=Np[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(Up+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(Bp);this[n]=!0}else this[n]=!1}return this}function Mf(e){return new this(e).cos()}function Uf(e){return new this(e).cosh()}function Lf(e,t){return new this(e).div(t)}function Bf(e){return new this(e).exp()}function Df(e){return ef(e=new this(e),e.e+1,3)}function jf(){var e,t,n=new this(0);for(Rp=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Rp=!0,new this(1/0);n=t}return Rp=!0,n.sqrt()}function Ff(e){return e instanceof ag||e&&e.toStringTag===Dp||!1}function zf(e){return new this(e).ln()}function Wf(e,t){return new this(e).log(t)}function qf(e){return new this(e).log(2)}function Hf(e){return new this(e).log(10)}function Vf(){return uf(this,arguments,-1)}
2function Gf(){return uf(this,arguments,1)}function Kf(e,t){return new this(e).mod(t)}function Jf(e,t){return new this(e).mul(t)}function Zf(e,t){return new this(e).pow(t)}function Qf(e){var t,n,r,i,s=0,o=new this(1),a=[];if(void 0===e?e=this.precision:Qp(e,1,Tp),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));s<r;)(i=t[s])>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=i%1e7;else{if(!crypto.randomBytes)throw Error(Bp);for(t=crypto.randomBytes(r*=4);s<r;)(i=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((127&t[s+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(i%1e7),s+=4);s=r/4}else for(;s<r;)a[s++]=1e7*Math.random()|0;for(e%=7,(r=a[--s])&&e&&(i=Fp(10,7-e),a[s]=(r/i|0)*i);0===a[s];s--)a.pop();if(s<0)n=0,a=[0];else{for(n=-1;0===a[0];n-=7)a.shift();for(r=1,i=a[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return o.e=n,o.d=a,o}function Yf(e){return ef(e=new this(e),e.e+1,this.rounding)}function Xf(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function $f(e){return new this(e).sin()}function eg(e){return new this(e).sinh()}function tg(e){return new this(e).sqrt()}function ng(e,t){return new this(e).sub(t)}function rg(){var e=0,t=arguments,n=new this(t[e]);for(Rp=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Rp=!0,ef(n,this.precision,this.rounding)}function ig(e){return new this(e).tan()}function sg(e){return new this(e).tanh()}function og(e){return ef(e=new this(e),e.e+1,1)}Jp[Symbol.for("nodejs.util.inspect.custom")]=Jp.toString,Jp[Symbol.toStringTag]="Decimal";var ag=Jp.constructor=function e(t){var n,r,i;function s(e){var t,n,r,i=this;if(!(i instanceof s))return new s(e);if(i.constructor=s,Ff(e))return i.s=e.s,void(Rp?!e.d||e.e>s.maxE?(i.e=NaN,i.d=null):e.e<s.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"===(r=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;return void(Rp?t>s.maxE?(i.e=NaN,i.d=null):t<s.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!==0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):ff(i,e.toString())}if("string"===r)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===n&&(e=e.slice(1)),i.s=1),Hp.test(e)?ff(i,e):gf(i,e);if("bigint"===r)return e<0?(e=-e,i.s=-1):i.s=1,ff(i,e.toString());throw Error(Up+e)}if(s.prototype=Jp,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=Rf,s.clone=e,s.isDecimal=Ff,s.abs=Af,s.acos=_f,s.acosh=xf,s.add=Ef,s.asin=kf,s.asinh=Sf,s.atan=If,s.atanh=Tf,s.atan2=Cf,s.cbrt=Pf,s.ceil=Of,s.clamp=Nf,s.cos=Mf,s.cosh=Uf,s.div=Lf,s.exp=Bf,s.floor=Df,s.hypot=jf,s.ln=zf,s.log=Wf,s.log10=Hf,s.log2=qf,s.max=Vf,s.min=Gf,s.mod=Kf,s.mul=Jf,s.pow=Zf,s.random=Qf,s.round=Yf,s.sign=Xf,s.sin=$f,s.sinh=eg,s.sqrt=tg,s.sub=ng,s.sum=rg,s.tan=ig,s.tanh=sg,s.trunc=og,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return s.config(t),s}(Np);Pp=new ag(Pp),Op=new ag(Op);const cg=ag,lg=e=>{try{return new cg(e)}catch(t){return null}},ug=e=>{try{return new cg(e.toString())}catch(t){return null}},dg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return new cg(e).toDecimalPlaces(t).toNumber().toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:t})},hg=0,pg=1,fg=3,gg=4;function mg(e){if(navigator.clipboard)navigator.clipboard.writeText(e).then(()=>console.log("Text copied to clipboard!")).catch(e=>console.error("Failed to copy text to clipboard",e));else{const n=document.createElement("textarea");n.value=e,n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy",!1,""),console.log("Fallback: Copying text was successful!")}catch(t){console.error("Fallback: Unable to copy text",t)}document.body.removeChild(n)}}n(26043);Object.create(null);const yg={},vg=(e,t,n,r)=>{_g(n)&&yg[n]||(_g(n)&&(yg[n]=new Date),((e,t,n,r)=>{var s,o,a;const c=[n,(0,i.A)({code:t},r||{})];if(null!==e&&void 0!==e&&null!==(s=e.services)&&void 0!==s&&null!==(s=s.logger)&&void 0!==s&&s.forward)return e.services.logger.forward(c,"warn","react-i18next::",!0);_g(c[0])&&(c[0]="react-i18next:: ".concat(c[0])),null!==e&&void 0!==e&&null!==(o=e.services)&&void 0!==o&&null!==(o=o.logger)&&void 0!==o&&o.warn?e.services.logger.warn(...c):null!==(a=console)&&void 0!==a&&a.warn&&console.warn(...c)})(e,t,n,r))},wg=(e,t)=>
2()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},bg=(e,t,n)=>{e.loadNamespaces(t,wg(e,n))},Ag=(e,t,n,r)=>{if(_g(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return bg(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,wg(e,r))},_g=e=>"string"===typeof e,xg=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Eg={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xa9","©":"\xa9","®":"\xae","®":"\xae","…":"\u2026","…":"\u2026","/":"/","/":"/"},kg=e=>Eg[e];let Sg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(xg,kg)};let Ig;const Tg={type:"3rdParty",init(e){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Sg=(0,i.A)((0,i.A)({},Sg),e)}(e.options.react),(e=>{Ig=e})(e)}},Cg=(0,t.createContext)();class Pg{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Og=(e,t,n,r)=>e.getFixedT(t,n,r),Ng=function(e){var n,r,s,o;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{i18n:c}=a,{i18n:l,defaultNS:u}=(0,t.useContext)(Cg)||{},d=c||l||Ig;if(d&&!d.reportNamespaces&&(d.reportNamespaces=new Pg),!d){vg(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return _g(t)?t:"object"===typeof(n=t)&&null!==n&&_g(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var n},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}null!==(n=d.options.react)&&void 0!==n&&n.wait&&vg(d,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const h=(0,i.A)((0,i.A)((0,i.A)({},Sg),d.options.react),a),{useSuspense:p,keyPrefix:f}=h;let g=e||u||(null===(r=d.options)||void 0===r?void 0:r.defaultNS);g=_g(g)?[g]:g||["translation"],null===(s=(o=d.reportNamespaces).addUsedNamespaces)||void 0===s||s.call(o,g);const m=(d.isInitialized||d.initializedStoreOnce)&&g.every(e=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):(vg(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0)}(e,d,h)),y=((e,n,r,i)=>(0,t.useCallback)(Og(e,n,r,i),[e,n,r,i]))(d,a.lng||null,"fallback"===h.nsMode?g:g[0],f),v=()=>y,w=()=>Og(d,a.lng||null,"fallback"===h.nsMode?g:g[0],f),[b,A]=(0,t.useState)(v);let _=g.join();a.lng&&(_="".concat(a.lng).concat(_));const x=((e,n)=>{const r=(0,t.useRef)();return(0,t.useEffect)(()=>{r.current=n?r.current:e},[e,n]),r.current})(_),E=(0,t.useRef)(!0);(0,t.useEffect)(()=>{const{bindI18n:e,bindI18nStore:t}=h;E.current=!0,m||p||(a.lng?Ag(d,a.lng,g,()=>{E.current&&A(w)}):bg(d,g,()=>{E.current&&A(w)})),m&&x&&x!==_&&E.current&&A(w);const n=()=>{E.current&&A(w)};return e&&(null===d||void 0===d||d.on(e,n)),t&&(null===d||void 0===d||d.store.on(t,n)),()=>{E.current=!1,d&&e&&(null===e||void 0===e||e.split(" ").forEach(e=>d.off(e,n))),t&&d&&t.split(" ").forEach(e=>d.store.off(e,n))}},[d,_]),(0,t.useEffect)(()=>{E.current&&m&&A(v)},[d,f,m]);const k=[b,d,m];if(k.t=b,k.i18n=d,k.ready=m,m)return k;if(!m&&!p)return k;throw new Promise(e=>{a.lng?Ag(d,a.lng,g,()=>e()):bg(d,g,()=>e())})};function Rg(e){let{i18n:n,defaultNS:r,children:i}=e;const s=(0,t.useMemo)(()=>({i18n:n,defaultNS:r}),[n,r]);return(0,t.createElement)(Cg.Provider,{value:s},i)}var Mg=n(90034);const Ug=function(){const{t:e}=Ng(),{login:n,logout:r,authenticated:s,ready:l}=(0,a.u)(),{wallets:u}=(0,c.u)(),h=u[0],p=null===h||void 0===h?void 0:h.address,f=null!==h&&void 0!==h&&h.chainId?parseInt(h.chainId.split(":")[1]):null,g=s&&!!h,[m,y]=(0,t.useState)(null);(0,t.useEffect)(()=>{(async()=>
2{if(h)try{const e=await h.getEthereumProvider();y(e)}catch(e){console.log("Error getting provider:",e)}else y(null)})()},[h]);const v=async()=>{if(!h)return!1;try{return await h.switchChain(56),!0}catch(e){console.log("Error switching chain:",e);try{return await(null===m||void 0===m?void 0:m.request({method:"wallet_addEthereumChain",params:[{chainId:"0x".concat(56..toString(16)),chainName:gp,nativeCurrency:{name:mp,symbol:mp,decimals:18},rpcUrls:[pp],blockExplorerUrls:[yp]}]})),!0}catch(t){return console.log("Error adding chain:",t),!1}}},[w,b]=(0,t.useState)(null),[A,_]=(0,t.useState)(null),[x,E]=(0,t.useState)(null),[k,S]=(0,t.useState)(0),[I,T]=(0,t.useState)(new Date),[C,P]=(0,t.useState)(new Date),[O,N]=(0,t.useState)(0),[R,M]=(0,t.useState)(0),[U,L]=(0,t.useState)(0),[B,D]=(0,t.useState)(0),[j,z]=(0,t.useState)(0),[W,q]=(0,t.useState)(0),[H,V]=(0,t.useState)(0),[G,K]=(0,t.useState)(0),[J,Z]=(0,t.useState)({tokenForSale:lg(0)}),[Q,Y]=(0,t.useState)(0),[X,$]=(0,t.useState)(0),[ee,te]=(0,t.useState)(0),[ne,re]=(0,t.useState)(!0),[ie,se]=(0,t.useState)(""),[oe,ae]=(0,t.useState)(hg),[ce,le]=(0,t.useState)(""),[ue,de]=(0,t.useState)(1),[he,pe]=(0,t.useState)(1),[fe,ge]=(0,t.useState)(0),[me,ye]=(0,t.useState)(0),ve=(0,t.useRef)(),[we,be]=(0,t.useState)({days:0,hours:0,minutes:0,seconds:0}),[Ae,_e]=(0,t.useState)(!1),[xe,Ee]=(0,t.useState)(0),ke=async e=>{try{let t=Number(await e.getCurrentRoundIndex());D(t);let n=Number(await e.totalRounds());z(n),console.log("total",n);let r=await e.rounds(t);console.log("current price",r[0].toString()),M(r[0].toString());let i=(parseFloat(1e5)/parseFloat(r[0])).toFixed(8);console.log("token price",i),L(i);let s=await e.rounds(Math.min(t+1,n-1)),o=parseFloat((parseFloat(1e5)/parseFloat(s[0])).toFixed(4));q(o);let a=await e.startTime();T(new Date(1e3*Number(a)));let c=r[1];P(new Date(1e3*Number(c))),S(parseInt(c));let l=await e.totalTokensSold();Y(parseInt(l));let u=await e.totalTokenInPresale();$(parseInt(u));let d=await e.getTokenBalance();te(parseInt(d));let h=0===parseFloat(u)?0:100*(parseFloat(l)/parseFloat(u)).toFixed(4);console.log("data here",l,u,h,"here"),Ee(h)}catch(t){console.log(t)}},Se=async()=>{console.log("Entered init");try{if(!g)return;const e=new Wh(m);let t=await e.getBalance(p);V(parseInt(t)),console.log("bnb balance",t);const n=await e.getSigner(),r=new Fo(dp,_p,n);b(r);const i=new Fo("0x55d398326f99059fF775485246999027B3197955",Ep,n);_(i);const s=new Fo(hp,xp,e);E(s),console.log("Contracts initialized"),console.log("Fetching initial values"),(async()=>{try{const e=new Jt(mp,fp);let t=new Lh(pp,e,{staticNetwork:!0,batchMaxCount:1}),n=new Fo(dp,_p,t);ke(n)}catch(e){console.log(e)}})(),console.log("Fetching sale token balance"),Oe(s)}catch(t){console.log(t),F.info(e("something_went_wrong"))}},Ie=(e,t)=>ug(e).div(ug(t)),Te=e=>lg(e).div(10**18).toString(),Ce=async()=>{try{if(!w)return;ke(w)}catch(e){console.log(e)}},Pe=async()=>{try{if(!A)return;let e=lg(Number(await A.balanceOf(p))).toString();console.log("usd balance",e),K(e)}catch(e){console.log(e)}},Oe=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{if(console.log("fetching sale token balance"),!g)return;const t=e||x;if(!t)return;let n=ug(await t.balanceOf(p));Z((0,i.A)((0,i.A)({},J),{},{tokenForSale:up(n.toString())}))}catch(t){console.log(t)}},Ne=async e=>{try{if(!A)return!1;let t=await A.approve(dp,e.toString());return await t.wait(),!0}catch(t){throw t}},Re=()=>{pe(0),de(0)},Me=()=>{const t=Math.floor((new Date).getTime()/1e3);let n=0,r=(()=>{let e=Date.now(),t=I.getTime(),n=C.getTime();return lg(Q).gte(X)?gg:e<t?hg:e>=t&&e<n?pg:(console.log(e,t,n),gg)})();if(r===hg?n=Math.floor(I.getTime()/1e3)-t:r===pg&&(n=Math.floor(C.getTime()/1e3)-t),ae(r),n<=0)0!==k&&se(e("time_expired"));else{const e=Math.floor(n/86400),t=Math.floor(n%86400/3600),r=Math.floor(n%3600/60),i=Math.floor(n%60);let s="".concat(e,"d : ").concat(t,"h : ").concat(r,"m : ").concat(i,"s");se(s),be({days:e,minutes:r,hours:t,seconds:i})}};function Ue(){ve.current=setInterval(()=>{Me()},1e3)}return(0,t.useEffect)(()=>{s&&g&&h&&m&&x&&(console.log("authenticated"),Oe())},[s,g,h,m,x]),(0,t.useEffect)(()=>(Ue(),()=>{clearInterval(ve.current)}),[k,I,C,Ue]),(0,t.useEffect)(()=>{(async()=>{try{let e=he.toString().trim();if(0===e.length)return void ge("0.00");let t=lg(e).mul(10**18);if(!w)return;let n=await w.bnbBuyHelper(t.toFixed(0)),r=Ie(n,10**18).toFixed(2).toString();ge(r),console.log(r),console.log("Changed 2")}catch(e){console.log(e)}})()},[he,ne,w]),(0,t.useEffect)(()=>{(async()=>{try{let e=ue.toString().trim();if(0===e.length)return void ye("0.00");if(e=lg(e).mul(10**9).mul(10**9).toFixed(0).toString(),!w)return;let t=await w.calculateToken(e);ye(Ie(t,10**18).toFixed(2).toString()),console.log("Changed 1")}
2catch(e){console.log(e)}})()},[ue,w]),(0,t.useEffect)(()=>{w&&Ce()},[w]),(0,t.useEffect)(()=>{Pe()},[A]),(0,t.useEffect)(()=>{},[x]),(0,t.useEffect)(()=>{m&&g&&(console.log("initializing"),Se())},[m,g]),(0,t.useEffect)(()=>{console.log("this",oe),le((t=>(console.log(t),t===gg?e("expired"):t===hg?e("before_sale_start"):t===pg?e("before_sale_end"):t===fg?e("sold_out"):void 0))(oe))},[oe]),(0,Mg.jsx)("main",{children:(0,Mg.jsx)("section",{className:"flex items-center justify-center w-full ",children:(0,Mg.jsx)("div",{className:"w-full max-w-[900px] mx-auto kakao-bg bg-cover bg-center bg-no-repeat",children:(0,Mg.jsxs)("div",{className:"w-full relative 3xl:pt-24 lg:pt-18 pt-20 3xl:pb-16 pb-12 md:bg-contain ",children:[(0,Mg.jsxs)("div",{className:"w-full flex items-center flex-col",children:[(0,Mg.jsx)("h2",{className:"text-black2 3xl:mb-3 lg:mb-2 lg:text-base text-sm italic inline-flex mx-auto leading-5 lg:pt-1 lg:pb-1 font-bold rounded-full px-6 items-center justify-center bg-white text-center",children:(0,Mg.jsxs)("span",{children:["Round ",B+1]})}),(0,Mg.jsxs)("div",{className:"w-full flex items-center lg:gap-2.5 gap-1.5 mx-auto justify-center max-w-[600px]",children:[(0,Mg.jsxs)("div",{className:"bg-black2 rounded-[10px] text-center 3xl:px-5 md:px-4 px-2",children:[(0,Mg.jsx)("h4",{className:"lg:text-sm text-xs text-white",children:e("Days")}),(0,Mg.jsx)("h3",{className:"text-lg xl:leading-none lg:leading-8 leading-6 text-white font-bold",children:we.days})]}),(0,Mg.jsx)("span",{className:" text-lg font-bold text-white leading-normal lg:-mt-3",children:":"}),(0,Mg.jsxs)("div",{className:"bg-black2 rounded-[10px] text-center 3xl:px-5 md:px-4 px-2",children:[(0,Mg.jsx)("h4",{className:"lg:text-sm text-xs text-white",children:e("Hours")}),(0,Mg.jsx)("h3",{className:"text-lg xl:leading-none lg:leading-8 leading-6 text-white font-bold",children:we.hours})]}),(0,Mg.jsx)("span",{className:"text-lg font-bold text-white leading-normal lg:-mt-3",children:":"}),(0,Mg.jsxs)("div",{className:"bg-black2 rounded-[10px] text-center 3xl:px-5 md:px-4 px-2",children:[(0,Mg.jsx)("h4",{className:"lg:text-sm text-xs text-white",children:e("Mins")}),(0,Mg.jsx)("h3",{className:"text-lg xl:leading-none lg:leading-8 leading-6 text-white font-bold text-center",children:we.minutes})]}),(0,Mg.jsx)("span",{className:"text-2xl font-bold text-white leading-normal lg:-mt-3",children:":"}),(0,Mg.jsxs)("div",{className:"bg-black2 rounded-[10px] text-center 3xl:px-5 md:px-4 px-2",children:[(0,Mg.jsx)("h4",{className:"lg:text-sm text-xs text-white",children:e("Sec")}),(0,Mg.jsx)("h3",{className:"text-lg xl:leading-none lg:leading-8 leading-6 text-white font-bold text-center",children:we.seconds})]})]}),(0,Mg.jsxs)("p",{className:"text-white 3xl:text-base md:text-sm text-xs text-center 3xl:py-3 py-1 md:py-2 m-0",children:["1 ",wp," = ",(0,Mg.jsxs)("span",{children:["$",U]})]}),(0,Mg.jsxs)("ul",{className:"p-0 m-0",children:[(0,Mg.jsxs)("li",{className:"flex items-center gap-20 justify-between mb-1 h-2",children:[(0,Mg.jsx)("span",{className:"text-[#68b8dc] font-medium text-[12px]",children:e("amount_raised")}),(0,Mg.jsxs)("span",{className:"text-white text-[12px]",children:["$ ",(Le=Q,(e=>Number(e).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2}))(Te(Le)))]})]}),(0,Mg.jsxs)("li",{className:"flex items-center gap-20 justify-between mb-3",children:[(0,Mg.jsxs)("span",{className:"text-[#68b8dc] font-medium text-[12px]",children:[" ",e("your_holding")]}),(0,Mg.jsxs)("span",{className:"text-white text-[12px]",children:[J.tokenForSale.toString()," ",wp]})]})]}),(0,Mg.jsxs)("div",{className:"lg:w-full flex lg:max-w-[580px] justify-center items-center gap-3.5 mb-2",children:[(0,Mg.jsxs)("button",{type:"button",onClick:()=>{re(!0)},className:"bg-black2 cursor-pointer transition-all duration-200 hover:bg-gray-800 hover:text-white flex items-center justify-center gap-3 rounded-full 3xl:text-lg lg:text-lg text-sm text-white 3xl:w-full px-6 md:px-8 max-w-[218px] py-1",children:[(0,Mg.jsx)("img",{src:"/images/BSC-logo.png",className:"w-4 lg:w-6",alt:""}),"BNB"]}),(0,Mg.jsxs)("button",{type:"button",onClick:()=>{re(!1)},className:"bg-black2 cursor-pointer transition-all duration-200 hover:bg-gray-800 hover:text-white flex items-center justify-center gap-3 rounded-full 3xl:text-lg lg:text-lg text-sm text-white 3xl:w-full px-6 md:px-8 max-w-[218px] py-1",children:[(0,Mg.jsx)("img",{src:"/images/ustd-logo.png",className:"w-4 lg:w-6",alt:""}),"USDT"]}
2)]}),(0,Mg.jsxs)("form",{className:"w-full ml-4 3xl:max-w-[480px] md:translate-x-3 lg:max-w-[420px] md:max-w-[50%] sm:max-w-[80%] max-w-[300px]",children:[(0,Mg.jsxs)("div",{className:"w-full 3xl:mb-3 mb-2",children:[(0,Mg.jsxs)("div",{className:"flex justify-between w-[95%]",children:[(0,Mg.jsxs)("label",{htmlFor:"amount",className:"3xl:text-base text-xs ml-2 text-white 3xl:mb-1 mb-0 block",children:["1 ",wp," = $",U]}),(0,Mg.jsx)("p",{className:"text-white 3xl:text-base md:text-sm text-xs text-center 3xl:py-3 py-1 md:py-2 m-0",children:"Buy Min $10"})]}),(0,Mg.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,Mg.jsx)("input",{type:"number",id:"input-pay",placeholder:0,required:"",value:ne?he:ue,onChange:e=>{ne?pe(e.target.value):de(e.target.value)},name:"payAmount",className:"w-[95%] md:text-sm pr-[158px] font-medium text-black1 bg-white px-3 py-1 outline-0 rounded-[5px]"}),(0,Mg.jsx)("button",{type:"button",className:"bg-black2 text-xs cursor-pointer transition-all duration-200 hover:bg-gray-800 hover:text-white text-white md:text-sm absolute rounded px-2 py-0.5 right-[50px]",onClick:()=>{ne?pe(H):de(G)},children:"Max"}),(0,Mg.jsx)("img",{src:ne?"/images/bsc-logo-yellow.png":"/images/ustd-logo.png",className:d("absolute right-4 w-6",!ne&&"invert"),alt:""})]})]}),(0,Mg.jsxs)("div",{className:"w-full",children:[(0,Mg.jsxs)("label",{htmlFor:"amount-receive",className:"text-xs ml-2 text-white mb-1 block",children:["Amount in ",wp," receive"]}),(0,Mg.jsxs)("div",{className:"relative flex items-center justify-center",children:[(0,Mg.jsx)("input",{type:"text",value:dg(ne?fe:me),onChange:e=>{},readOnly:!0,id:"input-receive",placeholder:"",name:"receiveAmount",className:"w-[95%] pr-12 md:text-lg font-medium text-black1 bg-white px-3 py-1 outline-0 rounded-[5px]"}),(0,Mg.jsx)("img",{src:"/images/wawe-logo.png",className:"absolute right-4 w-7",alt:""})]})]}),(0,Mg.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,Mg.jsx)("button",{type:"button",id:"buy-button",onClick:oe===pg?()=>{ne?(async()=>{try{if(56!==f){if(!(await o().fire({title:e("warning"),text:e("switch_chain_to_bsc"),icon:"warning",showCancelButton:!0,confirmButtonText:"Switch to BSC",cancelButtonText:"Cancel"})).isConfirmed)return;if(!await v())return void o().fire(e("warning"),"Failed to switch network","error")}if(!g)return void o().fire(e("warning"),e("connect_wallet_first"),"warning");let t=lg(ee).div(10**18);if(lg(fe).greaterThan(t))return void o().fire(e("warning"),e("purchase_exceeds_available_tokens"),"warning");let n=lg(he).mul(10**18);if(n.lessThan(0))return void o().fire(e("warning"),e("amount_greater_than_zero"),"warning");if(lg(H).lessThan(n))return void o().fire(e("warning"),e("insufficient_balance"),"warning");_e(!0);let r=await w.buyWithBNB({value:n.toFixed(0)});await r.wait(),o().fire(e("transaction_completed"),e("token_bought_successfully"),"success"),Re(),Ce(),Pe(),Oe()}catch(t){console.log(t),o().fire(e("warning"),e("something_went_wrong"),"warning")}finally{_e(!1)}})():(async()=>{try{if(56!==f){if(!(await o().fire({title:e("warning"),text:e("switch_chain_to_bsc"),icon:"warning",showCancelButton:!0,confirmButtonText:"Switch to BSC",cancelButtonText:"Cancel"})).isConfirmed)return;if(!await v())return void o().fire(e("warning"),"Failed to switch network","error")}if(!g)return void o().fire(e("warning"),e("connect_wallet_first"),"warning");let t=lg(ee).div(10**18);if(lg(me).greaterThan(t))return void o().fire(e("warning"),e("purchase_exceeds_available_tokens"),"warning");let n=lg(ue).mul(10**vp);if(n.lessThan(0))return void o().fire(e("warning"),e("amount_greater_than_zero"),"warning");if(lg(G).lessThan(n))return void o().fire(e("warning"),e("insufficient_balance"),"warning");_e(!0);let r=Number(await A.allowance(p,dp));lg(r).lessThan(n)&&(0===r||await Ne(0),await Ne(n.toFixed(0)));let i=await w.buyWithUSDT(n.toFixed(0));await i.wait(),o().fire(e("transaction_completed"),e("token_bought_successfully"),"success"),Re(),Ce(),Pe(),Oe()}catch(t){o().fire(e("warning"),e("something_went_wrong"),"warning")}finally{_e(!1)}})()}:null,className:"bg-black text-sm h-10 rounded-xl mt-3 w-[95%] not-disabled:hover:bg-gray-800 not-disabled:cursor-pointer disabled:bg-blue-600 disabled:cursor-not-allowed",style:{color:"white",fontWeight:"700"},disabled:!g,children:(0,Mg.jsxs)("div",{style:{alignItems:"center",justifyContent:"center",display:"flex"},children:[(0,Mg.jsx)("div",{style:{display:Ae?"inline-block":"none"},id:"loader",className:"w-full mt-4 py-4 text-base border-white bg-white"}),oe===pg?e("Buy Now"):ce]})}),(0,Mg.jsx)("div",{className:"btn btn-connect d-flex w-100 mt-1 mb-2",id:"privy-button",style:{display:"flex",justifyContent:"center"},children:g?(0,Mg.jsxs)("button",{type:"button",onClick:r,className:"bg-black2 text-white text-sm py-2 px-6 rounded-xl cursor-pointer hover:bg-gray-800 transition-all duration-200 flex items-center gap-2",children:[(0,Mg.jsxs)("span",{className:"text-xs",children:[null===p||void 0===p?void 0:p.slice(0,6),"...",null===p||void 0===p?void 0:p.slice(-4)]}),(0,Mg.jsx)("span",{className:"text-xs opacity-70",children:"|"}),(0,Mg.jsx)("span",{className:"text-xs",children:e("disconnect")||"Disconnect"})]}):(0,Mg.jsx)("button",{type:"button",onClick:n,className:"bg-black2 text-white text-sm py-2 px-8 rounded-xl cursor-pointer hover:bg-gray-800 transition-all duration-200",children:e("connect_wallet")})})]})]}),(0,Mg.jsxs)("div",{className:"w-full 3xl:max-w-[450px] md:translate-x-2 max-w-[400px] mt-1 lg:px-0 px-3",children:[(0,Mg.jsxs)("div",{className:"flex flex-col",children:[(0,Mg.jsxs)("div",{className:"flex items-center justify-between h-2",children:[(0,Mg.jsx)("p",{className:"text-white 3xl:text-lg text-xs ",children:"Contract Address:"}),(0,Mg.jsxs)("div",{className:"flex items-center gap-2 ",children:[(0,Mg.jsxs)("p",{className:"text-white 3xl:text-lg text-xs",children:[hp.slice(0,6),"...",hp.slice(-7)]}),(0,Mg.jsx)("button",{type:"button",onClick:()=>{mg(hp),F.success(e("copied"))},className:"text-white cursor-pointer hover:text-gray-300 transition-colors bottom-2 relative",title:"Copy Contract Address",children:(0,Mg.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Mg.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]}),(0,Mg.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Mg.jsx)("p",{className:"text-white 3xl:text-lg text-xs ",children:"Presale Address:"}),(0,Mg.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Mg.jsxs)("p",{className:"text-white 3xl:text-lg text-xs ",children:[dp.slice(0,6),"...",dp.slice(-7)]}),(0,Mg.jsx)("button",{type:"button",onClick:()=>{mg(dp),F.success(e("copied"))},className:"text-white cursor-pointer bottom-2 relative hover:text-gray-300 transition-colors",title:"Copy Presale Address",children:(0,Mg.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Mg.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]})]}),(0,Mg.jsx)("div",{className:"3xl:mt-3 3xl:px-6",children:(0,Mg.jsx)("p",{className:"text-[10px] text-center text-white bg-black2 rounded-md py-2 px-3 ",children:"Never deposit money to the above two address ! Tokens and only be purchaseed through a wallet connection. If it dosen\u2019t work well on mobile, please try using PC."})})]})]}),(0,Mg.jsx)("img",{src:"/images/KakaoTalk_left.png",className:"absolute md:block hidden w-[150px] 3xl:left-0 left-10 3xl:w-[170px]",alt:""}),(0,Mg.jsx)("button",{type:"button",onClick:async()=>
2{if(m&&g)try{await m.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:hp,symbol:wp,decimals:Ap,image:bp}}})?o().fire(e("token_imported"),"","success"):o().fire(e("token_already_in_wallet")||"Token already in wallet","","info")}catch(n){var t;console.log(n);const r=(null===n||void 0===n||null===(t=n.message)||void 0===t?void 0:t.toLowerCase())||"";r.includes("already")||r.includes("exist")||r.includes("added")?o().fire(e("token_already_in_wallet")||"Token already in wallet","","info"):o().fire(e("wallet_not_supported"),e("import_token_manually"),"warning")}else o().fire(e("connect_wallet_first"),"","warning")},className:"bottom-10 3xl:w-[142px] w-[100px] absolute cursor-pointer 3xl:right-20 lg:right-40 right-28 md:left-auto md:translate-x-0 left-1/2 -translate-x-1/2 3xl:text-base text-xs font-bold md:py-1.5 py-1 3xl:h-[34px] bg-white rounded-lg text-black hover:bg-gray-200 transition-all duration-200",children:"+ Add Token"})]})})})});var Le};const Lg=function(){const{ready:e}=(0,a.u)();return e?(0,Mg.jsx)("div",{className:"App",children:(0,Mg.jsx)(Ug,{})}):(0,Mg.jsx)("div",{className:"App flex items-center justify-center min-h-screen bg-black text-white",children:"Loading..."})},Bg=e=>{e&&e instanceof Function&&n.e(5051).then(n.bind(n,25051)).then(t=>{let{getCLS:n,getFID:r,getFCP:i,getLCP:s,getTTFB:o}=t;n(e),r(e),i(e),s(e),o(e)})},Dg=e=>"string"===typeof e,jg=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Fg=e=>null==e?"":""+e,zg=/###/g,Wg=e=>e&&e.indexOf("###")>-1?e.replace(zg,"."):e,qg=e=>!e||Dg(e),Hg=(e,t,n)=>{const r=Dg(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(qg(e))return{};const t=Wg(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return qg(e)?{}:{obj:e,k:Wg(r[i])}},Vg=(e,t,n)=>{const{obj:r,k:i}=Hg(e,t,Object);if(void 0!==r||1===t.length)return void(r[i]=n);let s=t[t.length-1],o=t.slice(0,t.length-1),a=Hg(e,o,Object);for(;void 0===a.obj&&o.length;)s="".concat(o[o.length-1],".").concat(s),o=o.slice(0,o.length-1),a=Hg(e,o,Object),a&&a.obj&&"undefined"!==typeof a.obj["".concat(a.k,".").concat(s)]&&(a.obj=void 0);a.obj["".concat(a.k,".").concat(s)]=n},Gg=(e,t)=>{const{obj:n,k:r}=Hg(e,t);if(n)return n[r]},Kg=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Dg(e[r])||e[r]instanceof String||Dg(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Kg(e[r],t[r],n):e[r]=t[r]);return e},Jg=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Zg={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Qg=e=>Dg(e)?e.replace(/[&<>"'\/]/g,e=>Zg[e]):e;const Yg=[" ",",","?","!",";"],Xg=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),$g=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let s=0;s<r.length;){if(!i||"object"!==typeof i)return;let e,t="";for(let o=s;o<r.length;++o)if(o!==s&&(t+=n),t+=r[o],e=i[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&o<r.length-1)continue;s+=o-s+1;break}i=e}return i},em=e=>e&&e.replace("_","-"),tm={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class nm{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||tm,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(Dg(e[0])&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}create(e){return new nm(this.logger,(0,i.A)((0,i.A)({},{prefix:"".concat(this.prefix,":").concat(e,":")}),this.options))}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new nm(this.logger,e)}}var rm=new nm;class im{constructor(){this.observers={}}
vendor: 3,503 bytes, line 2
2on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(e=>{let[t,r]=e;for(let i=0;i<r;i++)t(...n)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(t=>{let[r,i]=t;for(let s=0;s<i;s++)r.apply(r,[e,...n])})}}}class sm extends im{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Dg(n)&&i?o.push(...n.split(i)):o.push(n)));const a=Gg(this.data,o);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),!a&&s&&Dg(n)?$g(this.data&&this.data[e]&&this.data[e][t],n,i):a}addResource(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(o=e.split("."),r=t,t=o[1]),this.addNamespaces(t),Vg(this.data,o,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const i in n)(Dg(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,s){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let c=Gg(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Kg(c,n,s):c=(0,i.A)((0,i.A)({},c),n),Vg(this.data,a,c),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?(0,i.A)((0,i.A)({},{}),this.getResource(e,t)):this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var om={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,i))}),t}};const am={};class cm extends im{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
2i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=rm.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(void 0===e||null===e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const s=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";const r=Yg.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const i=Xg.getRegExp("(".concat(r.map(e=>"?"===e?"\\?":e).join("|"),")"));let s=!i.test(e);if(!s){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(s=!0)}return s})(e,n,r);if(s&&!o){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Dg(i)?[i]:i};const s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),e=s.join(r)}return{key:e,namespaces:Dg(i)?[i]:i}}translate(e,t,n){if("object"!==typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"===typeof t&&(t=(0,i.A)({},t)),t||(t={}),void 0===e||null===e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:o,namespaces:a}=this.extractFromKey(e[e.length-1],t),c=a[a.length-1],l=t.lng||this.language,u=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(u){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:"".concat(c).concat(e).concat(o),usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(t)}:"".concat(c).concat(e).concat(o)}return r?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(t)}:o}const d=this.resolve(e,t);let h=d&&d.res;const p=d&&d.usedKey||o,f=d&&d.exactUsedKey||o,g=Object.prototype.toString.apply(h),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=!Dg(h)&&"boolean"!==typeof h&&"number"!==typeof h;if(!(y&&h&&v&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0)||Dg(m)&&Array.isArray(h))if(y&&Dg(m)&&Array.isArray(h))h=h.join(m),h&&(h=this.extendTranslation(h,e,t,n));else{let r=!1,a=!1;const u=void 0!==t.count&&!Dg(t.count),p=cm.hasDefaultValue(t),f=u?this.pluralResolver.getSuffix(l,t.count,t):"",g=t.ordinal&&u?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",m=u&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),y=m&&t["defaultValue".concat(this.options.pluralSeparator,"zero")]||t["defaultValue".concat(f)]||t["defaultValue".concat(g)]||t.defaultValue;!this.isValidLookup(h)&&p&&(r=!0,h=y),this.isValidLookup(h)||(a=!0,h=o);const v=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:h,w=p&&y!==h&&this.options.updateMissing;if(a||r||w){if(this.logger.log(w?"updateKey":"missingKey",l,c,o,w?y:h),s){const e=this.resolve(o,(0,i.A)((0,i.A)({},t),{},{keySeparator:!1}));e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const i=p&&r!==h?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,n,i,w,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,c,n,i,w,t),this.emit
2("missingKey",e,c,n,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach(e=>{const n=this.pluralResolver.getSuffixes(e,t);m&&t["defaultValue".concat(this.options.pluralSeparator,"zero")]&&n.indexOf("".concat(this.options.pluralSeparator,"zero"))<0&&n.push("".concat(this.options.pluralSeparator,"zero")),n.forEach(n=>{r([e],o+n,t["defaultValue".concat(n)]||y)})}):r(e,o,y))}h=this.extendTranslation(h,e,t,d,n),a&&h===o&&this.options.appendNamespaceToMissingKey&&(h="".concat(c,":").concat(o)),(a||r)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(c,":").concat(o):o,r?h:void 0):this.options.parseMissingKeyHandler(h))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,(0,i.A)((0,i.A)({},t),{},{ns:a})):"key '".concat(o," (").concat(this.language,")' returned an object instead of string.");return r?(d.res=e,d.usedParams=this.getUsedParamsDetails(t),d):e}if(s){const e=Array.isArray(h),n=e?[]:{},r=e?f:p;for(const o in h)if(Object.prototype.hasOwnProperty.call(h,o)){const e="".concat(r).concat(s).concat(o);n[o]=this.translate(e,(0,i.A)((0,i.A)({},t),{joinArrays:!1,ns:a})),n[o]===e&&(n[o]=h[o])}h=n}}return r?(d.res=h,d.usedParams=this.getUsedParamsDetails(t),d):h}extendTranslation(e,t,n,r,s){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,(0,i.A)((0,i.A)({},this.options.interpolation.defaultVariables),n),n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init((0,i.A)((0,i.A)({},n),{interpolation:(0,i.A)((0,i.A)({},this.options.interpolation),n.interpolation)}));const a=Dg(e)&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(a){const t=e.match(this.interpolator.nestingRegexp);c=t&&t.length}let l=n.replace&&!Dg(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l=(0,i.A)((0,i.A)({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,n.lng||this.language||r.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);c<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return s&&s[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate(...r,t)},n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,c=Dg(a)?[a]:a;return void 0!==e&&null!==e&&c&&c.length&&!1!==n.applyPostProcessor&&(e=om.handle(c,e,t,this.options&&this.options.postProcessPassResolved?(0,i.A)({i18nResolved:(0,i.A)((0,i.A)({},r),{},{usedParams:this.getUsedParamsDetails(n)})},n):n,this)),e}resolve(e){let t,n,r,i,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Dg(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,o),c=a.key;n=c;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const u=void 0!==o.count&&!Dg(o.count),d=u&&!o.ordinal&&0===o.count&&this.pluralResolver.shouldUseIntlApi(),h=void 0!==o.context&&(Dg(o.context)||"number"===typeof o.context)&&""!==o.context,p=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);l.forEach(e=>{this.isValidLookup(t)||(s=e,!am["".concat(p[0],"-").concat(e)]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(am["".concat(p[0],"-").concat(e)]=!0,this.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{if(this.isValidLookup(t))return;i=n;const s=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(s,c,n,e,o);else{let e;u&&(e=this.pluralResolver.getSuffix(n,o.count,o));const t="".concat(this.options.pluralSeparator,"zero"),r="".concat(this.options.pluralSeparator,"ordinal").concat(this.options.pluralSeparator);if(u&&(s.push(c+e),o.ordinal&&0===e.indexOf(r)&&s.push(c+e.replace(r,this.options.pluralSeparator)),d&&s.push(c+t)),h){const n="".concat(c).concat(this.options.contextSeparator).concat(o.context);s.push(n),u&&(s.push(n+e),o.ordinal&&0===e.indexOf(r)&&s.push(n+e.replace(r,this.options.pluralSeparator)),d&&s.push(n+t))}}let a;for(;a=s.pop();)this.isValidLookup(t)||(r=a,t=this.getResource(n,e,a,o))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Dg(e.replace);let r=n?e.replace:e;if(n&&"undefined"!==typeof e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r=(0,i.A)((0,i.A)({},this.options.interpolation.defaultVariables),r)),!n){r=(0,i.A)({},r);for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}const lm=e=>e.charAt(0).toUpperCase()+e.slice(1);class um{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rm.create("languageUtils")}getScriptPartFromCode(e){if(!(e=em(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=em(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Dg(e)&&e.indexOf("-")>-1){if("undefined"!==typeof Intl&&"undefined"!==typeof Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(t){}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(e=>e.toLowerCase()):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=lm(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=lm(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=lm(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;
vendor: 5,586 bytes, line 2
2return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"===typeof e&&(e=e(t)),Dg(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return Dg(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):Dg(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}}let dm=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],hm={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const pm=["v1","v2","v3"],fm=["v4"],gm={zero:0,one:1,two:2,few:3,many:4,other:5};class mm{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=rm.create("pluralResolver"),this.options.compatibilityJSON&&!fm.includes(this.options.compatibilityJSON)||"undefined"!==typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return dm.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:hm[t.fc]}})}),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const r=em("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(r,{type:i})}catch(n){if(!e.match(/-|_/))return;const r=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(r,t)}return this.pluralRulesCache[s]=o,o}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>"".concat(t).concat(e))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>
2gm[e]-gm[t]).map(e=>"".concat(this.options.prepend).concat(t.ordinal?"ordinal".concat(this.options.prepend):"").concat(e)):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(n.ordinal?"ordinal".concat(this.options.prepend):"").concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"===typeof r?"_plural_".concat(r.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}
2shouldUseIntlApi(){return!pm.includes(this.options.compatibilityJSON)}}const ym=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=((e,t,n)=>{const r=Gg(e,n);return void 0!==r?r:Gg(t,n)})(e,t,n);return!s&&i&&Dg(n)&&(s=$g(e,n,r),void 0===s&&(s=$g(t,n,r))),s},vm=e=>e.replace(/\$/g,"$$$$");class wm{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=rm.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:s,suffix:o,suffixEscaped:a,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:f,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:Qg,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?Jg(i):s||"{{",this.suffix=o?Jg(o):a||"}}",this.formatSeparator=c||",",this.unescapePrefix=l?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=d?Jg(d):h||Jg("$t("),this.nestingSuffix=p?Jg(p):f||Jg(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,"".concat(this.prefix,"(.+?)").concat(this.suffix)),this.regexpUnescape=e(this.regexpUnescape,"".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix)),this.nestingRegexp=e(this.nestingRegexp,"".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix))}interpolate(e,t,n,r){let s,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const s=ym(t,c,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,n,(0,i.A)((0,i.A)((0,i.A)({},r),t),{},{interpolationkey:e})):s}const s=e.split(this.formatSeparator),o=s.shift().trim(),a=s.join(this.formatSeparator).trim();return this.format(ym(t,c,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,(0,i.A)((0,i.A)((0,i.A)({},r),t),{},{interpolationkey:o}))};this.resetRegExp();const u=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>vm(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?vm(this.escape(e)):vm(e)}].forEach(t=>{for(a=0;s=t.regex.exec(e);){const n=s[1].trim();if(o=l(n),void 0===o)if("function"===typeof u){const t=u(e,s,r);o=Dg(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else{if(d){o=s[0];continue}this.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else Dg(o)||this.useRawValueToEscape||(o=Fg(o));const i=t.safeValue(o);if(e=e.replace(s[0],i),d?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=s[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,s,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp("".concat(n,"[ ]*{")));let o="{".concat(r[1]);e=r[0],o=this.interpolate(o,s);const a=o.match(/'/g),c=o.match(/"/g);(a&&a.length%2===0&&!c||c.length%2!==0)&&(o=o.replace(/'/g,'"'));try{s=JSON.parse(o),t&&(s=(0,i.A)((0,i.A)({},t),s))}catch(l){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),l),"".concat(e).concat(n).concat(o)}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let c=[];s=(0,i.A)({},o),s=s.replace&&!Dg(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),c=e,l=!0}if(r=t(a.call(this,n[1].trim(),s),s),r&&n[0]===e&&!Dg(r))return r;Dg(r)||(r=Fg(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),l&&(r=c.reduce((e,t)=>
vendor: 21,223 bytes, line 2
2this.format(e,t,o.lng,(0,i.A)((0,i.A)({},o),{},{interpolationkey:n[1].trim()})),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const bm=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o=(0,i.A)((0,i.A)({},o),{},{[s.interpolationkey]:void 0}));const a=r+JSON.stringify(o);let c=t[a];return c||(c=e(em(r),s),t[a]=c),c(n)}};class Am{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=rm.create("formatter"),this.options=e,this.formats={number:bm((e,t)=>{const n=new Intl.NumberFormat(e,(0,i.A)({},t));return e=>n.format(e)}),currency:bm((e,t)=>{const n=new Intl.NumberFormat(e,(0,i.A)((0,i.A)({},t),{},{style:"currency"}));return e=>n.format(e)}),datetime:bm((e,t)=>{const n=new Intl.DateTimeFormat(e,(0,i.A)({},t));return e=>n.format(e)}),relativetime:bm((e,t)=>{const n=new Intl.RelativeTimeFormat(e,(0,i.A)({},t));return e=>n.format(e,t.range||"day")}),list:bm((e,t)=>{const n=new Intl.ListFormat(e,(0,i.A)({},t));return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=bm(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s=t.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(e=>e.indexOf(")")>-1)){const e=s.findIndex(e=>e.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,e)].join(this.formatSeparator)}return s.reduce((e,t)=>{const{formatName:s,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),s=t.trim();n[s]||(n[s]=i),"false"===i&&(n[s]=!1),"true"===i&&(n[s]=!0),isNaN(i)||(n[s]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[s]){let t=e;try{const a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},c=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[s](e,c,(0,i.A)((0,i.A)((0,i.A)({},o),r),a))}catch(a){this.logger.warn(a)}return t}return this.logger.warn("there was no format function for ".concat(s)),e},e)}}class _m extends im{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=rm.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const i={},s={},o={},a={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const o="".concat(e,"|").concat(t);!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===s[o]&&(s[o]=!0):(this.state[o]=1,r=!1,void 0===s[o]&&(s[o]=!0),void 0===i[o]&&(i[o]=!0),void 0===a[t]&&(a[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const r=e.split("|"),i=r[0],s=r[1];t&&this.emit("failedLoading",i,s,t),!t&&n&&this.store.addResourceBundle(i,s,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:i}=Hg(e,t,Object);r[i]=r[i]||[],r[i].push(n)})(n.loaded,[i],s),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===o[e][t]&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:s});this.readingCalls++;const o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&a&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*i,s)},i):s(o,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,o);try{const n=a(e,t);n&&"function"===typeof n.then?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(c){o(c)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Dg(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Dg(t)&&(t=[t]);const i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,(n,s)=>{n&&this.logger.warn("".concat(t,"loading namespace ").concat(i," for language ").concat(r," failed"),n),!n&&s&&this.logger.log("".concat(t,"loaded namespace ").concat(i," for language ").concat(r),s),this.loaded(e,n,s)})}saveMissing(e,t,n,r,s){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(void 0!==n&&null!==n&&""!==n){if(this.backend&&this.backend.create){const l=(0,i.A)((0,i.A)({},o),{},{isUpdate:s}),u=this.backend.create.bind(this.backend);if(u.length<6)try{let i;i=5===u.length?u(e,t,n,r,l):u(e,t,n,r),i&&"function"===typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(c){a(c)}else u(e,t,n,r,a,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}const xm=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"===typeof e[1]&&(t=e[1]),Dg(e[1])&&(t.defaultValue=e[1]),Dg(e[2])&&(t.tDescription=e[2]),"object"===typeof e[2]||"object"===typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Em=e=>(Dg(e.ns)&&(e.ns=[e.ns]),Dg(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Dg(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),km=()=>{};class Sm extends im{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Em(e),this.services={},this.logger=rm,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"===typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"===typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(Dg(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=xm();this.options=(0,i.A)((0,i.A)((0,i.A)({},r),this.options),Em(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=(0,i.A)((0,i.A)({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const s=e=>e?"function"===typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?rm.init(s(this.modules.logger),this.options):rm.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!==typeof Intl&&(t=Am);const n=new um(this.options);this.store=new sm(this.options.resources,this.options);const i=this.services;i.logger=rm,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new mm(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=s(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new wm(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new _m(s(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit(t,...r)}),this.modules.languageDetector&&(i.languageDetector=s(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=s(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new cm(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit(t,...r)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=km),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});const o=jg(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),o}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:km;const n=Dg(e)?e:this.language;if("function"===typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e))}this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){const r=jg();return"function"===typeof e&&(n=e,e=void 0),"function"===typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=km),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&om.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=jg();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},s=(e,s)=>{s?(i(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Dg(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{s(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const s=function(e,t){let o;if("object"!==typeof t){for(var a=arguments.length,c=new Array(a>2?a-2:0),l=2;l<a;l++)c[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([e,t].concat(c))}else o=(0,i.A)({},t);o.lng=o.lng||s.lng,o.lngs=o.lngs||s.lngs,o.ns=o.ns||s.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||s.keyPrefix);const u=r.options.keySeparator||".";let d;return d=o.keyPrefix&&Array.isArray(e)?e.map(e=>"".concat(o.keyPrefix).concat(u).concat(e)):o.keyPrefix?"".concat(o.keyPrefix).concat(u).concat(e):e,r.t(d,o)};return Dg(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const s=(e,t)=>{const n=this.services.backendConnector.state["".concat(e,"|").concat(t)];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,s);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(n,e)||r&&!s(i,e)))}loadNamespaces(e,t){const n=jg();return this.options.ns?(Dg(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=jg();Dg(e)&&(e=[e]);const r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new um(xm());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Sm(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:km;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r=(0,i.A)((0,i.A)((0,i.A)({},this.options),e),{isClone:!0}),s=new Sm(r);void 0===e.debug&&void 0===e.prefix||(s.logger=s.logger.clone(e));return["store","services","language"].forEach(e=>{s[e]=this[e]}),s.services=(0,i.A)({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},n&&(s.store=new sm(this.store.data,r),s.services.resourceStore=s.store),s.translator=new cm(s.services,r),s.translator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s.emit(e,...n)}),s.init(r,t),s.translator.options=r,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Im=Sm.createInstance();Im.createInstance=Sm.createInstance;Im.createInstance,Im.dir,Im.init,Im.loadResources,Im.reloadResources,Im.use,Im.changeLanguage,Im.getFixedT,Im.t,Im.exists,Im.setDefaultNamespace,Im.hasLoadedNamespace,Im.loadNamespaces,Im.loadLanguages;const Tm=JSON.parse('{"Days":"D","Hours":"H","Mins":"M","Sec":"S","ico_title":"{{name}} Token ICO Presale","tokens_sold":"Tokens Sold","final_round":"Final Round","presale_stage":"Presale Stage","join_others":"Join Others Before the Price increases to","join_sale_end":"Join Others Before the Sale Ends","amount_you_pay":"Amount in {{symbol}} You Pay","amount_you_receive":"Amount in {{symbol}} You Receive","1 CCO = {{tokenPrice}} $":"1 CCO = {{tokenPrice}} $","amount_raised":"TOKEN RAISED:","your_holding":"YOUR HOLDING:","info":"Information about your holding","buy_select_label":"Buy with (one of the below)","BNB":"BNB","USDT":"USDT","you pay":"you pay","MAX":"MAX","Enter Amount":"Enter Amount","you receive":"you receive","Buy Now":"Buy Now","import_token":"Import {{symbol}} for your balance to be visible","+ ADD TOKEN":"+ ADD TOKEN","something_went_wrong":"Something went wrong","insufficient_balance":"Insufficient balance","time_expired":"Time expired","wallet_not_supported":"Wallet not supported","import_token_manually":"Please import token manually","token_imported":"Token imported","purchase_exceeds_available_tokens":"Purchase exceeds available tokens","transaction_completed":"Transaction Completed!","token_bought_successfully":"Congratulations, token bought successfully.","
2warning":"Warning!","switch_chain_to_bsc":"Switch chain to Binance Smart Chain","connect_wallet_first":"Connect wallet first","connect_wallet":"Connect Wallet","amount_greater_than_zero":"Your entered amount must be greater than 0.","expired":"Presale Ended","before_sale_start":"Before Presale Start","before_sale_end":"Presale ongoing.","sold_out":"Sold out","contract_address":"Contract Address","presale_address":"Presale Address","note_1":"Never deposit money to the above two address !","note_2":" Tokens and only be purchaseed through a walletconnection. If it dosen\u2019t work well on mobile, please try using PC.","copied":"Copied","buy_min":"Buy min","network":"Network"}'),Cm=JSON.parse('{"Days":"\uc77c","Hours":"\uc2dc\uac04","Mins":"\ubd84","Sec":"\ucd08","ico_title":"{{name}} \ud1a0\ud070 ICO \ud504\ub9ac\uc138\uc77c","tokens_sold":"\ud310\ub9e4\ub41c \ud1a0\ud070","presale_stage":"\uc0ac\uc804 \ud310\ub9e4 \ub2e8\uacc4","join_others":"\uac00\uaca9\uc774 \uc624\ub974\uae30 \uc804\uc5d0 \ucc38\uc5ec\ud558\uc138\uc694","amount_you_pay":"{{symbol}}\ub85c \uc9c0\ubd88\ud558\ub294 \uae08\uc561","amount_you_receive":"{{symbol}}\ub85c \ubc1b\ub294 \uae08\uc561","1 CCO = {{tokenPrice}} $":"1 CCO = {{tokenPrice}} $","amount_raised":"\ubaa8\uc778 \ud1a0\ud070:","your_holding":"\ubcf4\uc720\ub7c9:","info":"\ubcf4\uc720\ub7c9\uc5d0 \ub300\ud55c \uc815\ubcf4","buy_select_label":"\uad6c\ub9e4 \ubc29\ubc95 (\uc544\ub798 \uc911 \ud558\ub098 \uc120\ud0dd)","BNB":"BNB","USDT":"USDT","you pay":"\uc9c0\ubd88 \uae08\uc561","MAX":"\ucd5c\ub300","Enter Amount":"\uae08\uc561 \uc785\ub825","you receive":"\ubc1b\ub294 \uae08\uc561","Buy Now":"\uc9c0\uae08 \uad6c\ub9e4","import_token":"\uc794\uc561\uc744 \ud45c\uc2dc\ud558\ub824\uba74 {{symbol}}\uc744 \uac00\uc838\uc624\uc138\uc694","+ ADD TOKEN":"+ \ud1a0\ud070 \ucd94\uac00","something_went_wrong":"\ubb38\uc81c\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4","insufficient_balance":"\uc794\uc561 \ubd80\uc871","time_expired":"\uc2dc\uac04 \ucd08\uacfc","wallet_not_supported":"\uc9c0\uac11\uc774 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4","import_token_manually":"\ud1a0\ud070\uc744 \uc218\ub3d9\uc73c\ub85c \uac00\uc838\uc624\uc138\uc694","token_imported":"\ud1a0\ud070 \uac00\uc838\uc624\uae30 \uc644\ub8cc","purchase_exceeds_available_tokens":"\uad6c\ub9e4\uac00 \uac00\ub2a5\ud55c \ud1a0\ud070\uc744 \ucd08\uacfc\ud588\uc2b5\ub2c8\ub2e4","transaction_completed":"\uac70\ub798 \uc644\ub8cc!","token_bought_successfully":"\ucd95\ud558\ud569\ub2c8\ub2e4, \ud1a0\ud070 \uad6c\ub9e4\uc5d0 \uc131\uacf5\ud588\uc2b5\ub2c8\ub2e4.","warning":"\uacbd\uace0!","switch_chain_to_bsc":"Binance Smart Chain\uc73c\ub85c \uccb4\uc778\uc744 \uc804\ud658\ud558\uc138\uc694","connect_wallet_first":"\uba3c\uc800 \uc9c0\uac11\uc744 \uc5f0\uacb0\ud558\uc138\uc694","connect_wallet":"\uc9c0\uac11 \uc5f0\uacb0","amount_greater_than_zero":"\uc785\ub825\ud55c \uae08\uc561\uc740 0\ubcf4\ub2e4 \ucee4\uc57c \ud569\ub2c8\ub2e4.","expired":"\ud504\ub9ac\uc138\uc77c \uc885\ub8cc","before_sale_start":"\ud504\ub9ac\uc138\uc77c \uc2dc\uc791 \uc804","before_sale_end":"\ud504\ub9ac\uc138\uc77c \uc9c4\ud589 \uc911","sold_out":"\ud488\uc808","contract_address":"\uacc4\uc57d \uc8fc\uc18c","presale_address":"\uc0ac\uc804 \ud310\ub9e4 \uc8fc\uc18c","note_1":"\uc704\uc758 \ub450 \uc8fc\uc18c\ub85c \uc808\ub300 \ub3c8\uc744 \uc785\uae08\ud558\uc9c0 \ub9c8\uc138\uc694!","note_2":"\ud1a0\ud070\uc740 \uc9c0\uac11 \uc5f0\uacb0\uc744 \ud1b5\ud574\uc11c\ub9cc \uad6c\ub9e4\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubaa8\ubc14\uc77c\uc5d0\uc11c \uc81c\ub300\ub85c \uc791\ub3d9\ud558\uc9c0 \uc54a\uc73c\uba74 PC\ub97c \uc0ac\uc6a9\ud574 \ubcf4\uc138\uc694.","copied":"\ubcf5\uc0ac\ub428","buy_min":"\ucd5c\uc18c \uad6c\ub9e4","network":"\ub124\ud2b8\uc6cc\ud06c"}'),{slice:Pm,forEach:Om}=[];const Nm=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Rm={create(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+60*n*1e3)),r&&(i.domain=r),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"},r=encodeURIComponent(t);let i="".concat(e,"=").concat(r);if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(e))}if(n.domain){if(!Nm.test(n.domain))throw new TypeError("option domain is invali
2d");i+="; Domain=".concat(n.domain)}if(n.path){if(!Nm.test(n.path))throw new TypeError("option path is invalid");i+="; Path=".concat(n.path)}if(n.expires){if("function"!==typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(n.expires.toUTCString())}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.sameSite)switch("string"===typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(i+="; Partitioned"),i}(e,t,i)},read(e){const t="".concat(e,"="),n=document.cookie.split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(t))return e.substring(t.length,e.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var Mm={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!==typeof document)return Rm.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:s}=t;n&&"undefined"!==typeof document&&Rm.create(n,e,r,i,s)}},Um={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!==typeof window){var r;let{search:e}=window.location;!window.location.search&&(null===(r=window.location.hash)||void 0===r?void 0:r.indexOf("?"))>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const i=e.substring(1).split("&");for(let r=0;r<i.length;r++){const e=i[r].indexOf("=");if(e>0){i[r].substring(0,e)===n&&(t=i[r].substring(e+1))}}}return t}},Lm={name:"hash",lookup(e){let t,{lookupHash:n,lookupFromHashIndex:r}=e;if("undefined"!==typeof window){const{hash:e}=window.location;if(e&&e.length>2){const s=e.substring(1);if(n){const e=s.split("&");for(let r=0;r<e.length;r++){const i=e[r].indexOf("=");if(i>0){e[r].substring(0,i)===n&&(t=e[r].substring(i+1))}}}if(t)return t;if(!t&&r>-1){var i;const t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;return null===(i=t["number"===typeof r?r:0])||void 0===i?void 0:i.replace("/","")}}}return t}};let Bm=null;const Dm=()=>{if(null!==Bm)return Bm;try{if(Bm="undefined"!==typeof window&&null!==window.localStorage,!Bm)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){Bm=!1}return Bm};var jm={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Dm())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Dm()&&window.localStorage.setItem(n,e)}};let Fm=null;const zm=()=>{if(null!==Fm)return Fm;try{if(Fm="undefined"!==typeof window&&null!==window.sessionStorage,!Fm)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Fm=!1}return Fm};var Wm={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&zm())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&zm()&&window.sessionStorage.setItem(n,e)}},qm={name:"navigator",lookup(e){const t=[];if("undefined"!==typeof navigator){const{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let i=0;i<e.length;i++)t.push(e[i]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Hm={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const r=n||("undefined"!==typeof document?document.documentElement:null);return r&&"function"===typeof r.getAttribute&&(t=r.getAttribute("lang")),t}},Vm={name:"path",lookup(e){var t;let{lookupFromPathIndex:n}=e;if("undefined"===typeof window)return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(r))return;return null===(t=r["number"===typeof n?n:0])||void 0===t?void 0:t.replace("/","")}},Gm={name:"subdomain",lookup(e){var t;let{lookupFromSubdomainIndex:n}=e;const r="number"===typeof n?n+1:1,i="undefined"!==typeof window&&(null===(t=window.location)||void 0===t||null===(t=t.hostname)||void 0===t?void 0:t.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(i)return i[r]}};let Km=!1;try{document.cookie,Km=!0}catch(Ay){}const Jm=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Km||Jm.splice(1,1);class Zm{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return Om.call(Pm.call(arguments,1
2),t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])}),e}(t,this.options||{},{order:Jm,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"===typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Mm),this.addDetector(Um),this.addDetector(jm),this.addDetector(Wm),this.addDetector(qm),this.addDetector(Hm),this.addDetector(Vm),this.addDetector(Gm),this.addDetector(Lm)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"===typeof n&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>{return void 0!==e&&null!==e&&!("string"===typeof(t=e)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(e=>e.test(t)));var t}).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}}function Qm(e){return Qm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qm(e)}Zm.type="languageDetector";function Ym(){return"function"===typeof XMLHttpRequest||"object"===("undefined"===typeof XMLHttpRequest?"undefined":Qm(XMLHttpRequest))}const Xm=n.p+"static/media/getFetch.7a7a1c81840c96d5a3ea.cjs";var $m=n.t(Xm);function ey(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ty(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ey(Object(n),!0).forEach(function(t){ny(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ey(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ny(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=ry(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ry(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ry(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ry(e){return ry="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ry(e)}var iy,sy,oy="function"===typeof fetch?fetch:void 0;"undefined"!==typeof n.g&&n.g.fetch?oy=n.g.fetch:"undefined"!==typeof window&&window.fetch&&(oy=window.fetch),Ym()&&("undefined"!==typeof n.g&&n.g.XMLHttpRequest?iy=n.g.XMLHttpRequest:"undefined"!==typeof window&&window.XMLHttpRequest&&(iy=window.XMLHttpRequest)),"function"===typeof ActiveXObject&&("undefined"!==typeof n.g&&n.g.ActiveXObject?sy=n.g.ActiveXObject:"undefined"!==typeof window&&window.ActiveXObject&&(sy=window.ActiveXObject)),oy||!$m||iy||sy||(oy=Xm||$m),"function"!==typeof oy&&(oy=void 0);var ay=function(e,t){if(t&&"object"===ry(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},cy=function(e,t,n,r){var i=function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then(function(t){n(null,{status:e.status,data:t})}).catch(n)};if(r){var s=r(e,t);if(s instanceof Promise)return void s.then(i).catch(n)}"function"===typeof fetch?fetch(e,t).then(i).catch(n):oy(e,t).then(i).catch(n)},ly=!1;const uy=function(e,t,r,i){return"function"===typeof r&&(i=r,r=void 0),i=i||function(){},oy&&0!==t.indexOf("file:")?function(e,t,r,i){e.queryStringParams&&(t=ay(t,e.queryStringParams));var s=ty({},"function"===typeof e.customHeaders?e.customHeaders():e.customHeaders);"undefined"===typeof window&&"undefined"!==typeof n.g&&"undefined"!==typeof n.g.process&&n.g.process.versions&&n.g.process.versions.node&&(s["User-Agent"]="i18next-http-backend (node/".concat(n.g.process.version,";
2 ").concat(n.g.process.platform," ").concat(n.g.process.arch,")")),r&&(s["Content-Type"]="application/json");var o="function"===typeof e.requestOptions?e.requestOptions(r):e.requestOptions,a=ty({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:s},ly?{}:o),c="function"===typeof e.alternateFetch&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{cy(t,a,i,c)}catch(Ay){if(!o||0===Object.keys(o).length||!Ay.message||Ay.message.indexOf("not implemented")<0)return i(Ay);try{Object.keys(o).forEach(function(e){delete a[e]}),cy(t,a,i,c),ly=!0}catch(l){i(l)}}}(e,t,r,i):Ym()||"function"===typeof ActiveXObject?function(e,t,n,r){n&&"object"===ry(n)&&(n=ay("",n).slice(1)),e.queryStringParams&&(t=ay(t,e.queryStringParams));try{var i;(i=iy?new iy:new sy("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var s=e.customHeaders;if(s="function"===typeof s?s():s)for(var o in s)i.setRequestHeader(o,s[o]);i.onreadystatechange=function(){i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(Ay){console&&console.log(Ay)}}(e,t,r,i):void i(new Error("No fetch and no xhr implementation found!"))};function dy(e){return dy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dy(e)}function hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function py(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hy(Object(n),!0).forEach(function(t){gy(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,my(r.key),r)}}function gy(e,t,n){return(t=my(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function my(e){var t=function(e,t){if("object"!=dy(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=dy(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dy(t)?t:t+""}var yy=function(e,t,n){return t&&fy(e.prototype,t),n&&fy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)},[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.services=e,this.options=py(py(py({},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,n){return gy({},t,n||"")},parseLoadPayload:function(e,t){},request:uy,reloadInterval:"undefined"===typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.options||{}),n),this.allOptions=r,this.services&&this.options.reloadInterval){var i=setInterval(function(){return t.reload()},this.options.reloadInterval);"object"===dy(i)&&"function"===typeof i.unref&&i.unref()}}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,i){var s,o=this,a=this.options.loadPath;"function"===typeof this.options.loadPath&&(a=this.options.loadPath(e,n)),(a=function(e){return!!e&&"function"===typeof e.then}(s=a)?s:Promise.resolve(s)).then(function(s){if(!s)return i(null,{});var a=o.services.interpolator.interpolate(s,{lng:e.join("+"),ns:n.join("+")});o.loadUrl(a,i,t,r)})}},{key:"loadUrl",value:function(e,t,n,r){var i=this,s="string"===typeof n?[n]:n,o="string"===typeof r?[r]:r,a=this.options.parseLoadPayload(s,o);this.options.request(this.options,e,a,function(s,o){if(o&&(o.status>=500&&o.status<600||!o.status))return t("failed loading "+e+"; status code: "+o.status,!0);if(o&&o.status>=400&&o.status<500)return t("failed loading "+e+"; status code: "+o.status,!1);if(!o&&s&&s.message){var a=s.message.toLowerCase();if(["failed","fetch","network","load"].find(function(e){return a.indexOf(e)>-1}))return t("failed loading "+e+": "+s.message,!0)}if(s)return t(s,!1);var c,l;try{c="string"===typeof o.data?i.options.parse(o.data,n,r):o.data}catch(Ay){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,c)})}},{key:"create",value:function(e,t,n,r,i){var s=this;if(this.options.addPath){"string"===typeof e&&(e=[e]);
2var o=this.options.parsePayload(t,n,r),a=0,c=[],l=[];e.forEach(function(n){var r=s.options.addPath;"function"===typeof s.options.addPath&&(r=s.options.addPath(n,t));var u=s.services.interpolator.interpolate(r,{lng:n,ns:t});s.options.request(s.options,u,o,function(t,n){a+=1,c.push(t),l.push(n),a===e.length&&"function"===typeof i&&i(c,l)})})}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,i=t.logger,s=n.language;if(!s||"cimode"!==s.toLowerCase()){var o=[],a=function(e){r.toResolveHierarchy(e).forEach(function(e){o.indexOf(e)<0&&o.push(e)})};a(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(e){return a(e)}),o.forEach(function(t){e.allOptions.ns.forEach(function(e){n.read(t,e,"read",null,null,function(r,s){r&&i.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&s&&i.log("loaded namespace ".concat(e," for language ").concat(t),s),n.loaded("".concat(t,"|").concat(e),r,s)})})})}}}]);yy.type="backend";const vy=yy;Im.use(vy).use(Zm).use(Tg).init({resources:{en:{translation:Tm},ko:{translation:Cm}},fallbackLng:"en",interpolation:{escapeValue:!1},supportedLngs:["en","ko"],detection:{order:["querystring","cookie","localStorage","navigator","htmlTag","path","subdomain"],lookupQuerystring:"lang"},backend:{loadPath:"/locales/{{lng}}.json"},react:{useSuspense:!1}});const wy=Im;var by=n(78055);r.createRoot(document.getElementById("root")).render((0,Mg.jsx)(t.StrictMode,{children:(0,Mg.jsx)(by.H,{appId:"cmiucbnja0368l80cyits6xs2",config:{loginMethods:["wallet"],embeddedWallets:{ethereum:{createOnLogin:"false"}}},children:(0,Mg.jsxs)(Rg,{i18n:wy,children:[(0,Mg.jsx)(Lg,{}),(0,Mg.jsx)(Q,{})]})})})),Bg()})()})(); 3//# sourceMappingURL=main.4b6bfb1e.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.