From 13522f901fe9b47573369ccea5273f8053d43808 Mon Sep 17 00:00:00 2001 From: ziboilihua Date: Thu, 21 Dec 2023 06:56:21 +0000 Subject: [PATCH] deploy: f98a342ca9f9422bd2f0e1cc73a8cd55ae0f9b9c --- 404.html | 2 +- ...0d60db0ba85.js => 424.ada8ecdb82c083e9.js} | 2 +- ...07e05af5c5b.js => 730.8ce76f11348f70ce.js} | 2 +- .../chunks/pages/_app-a44fcef8ff4d79b1.js | 31 ------------------- .../chunks/pages/_app-d33a6e25cba9f24a.js | 31 +++++++++++++++++++ ...c42e69d.js => webpack-87aef16517057517.js} | 2 +- ...36208c2fcb1c3.css => c6cedafb02fc8476.css} | 2 +- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 index.html | 2 +- 10 files changed, 37 insertions(+), 37 deletions(-) rename _next/static/chunks/{424.e9f060d60db0ba85.js => 424.ada8ecdb82c083e9.js} (65%) rename _next/static/chunks/{730.24aab07e05af5c5b.js => 730.8ce76f11348f70ce.js} (97%) delete mode 100644 _next/static/chunks/pages/_app-a44fcef8ff4d79b1.js create mode 100644 _next/static/chunks/pages/_app-d33a6e25cba9f24a.js rename _next/static/chunks/{webpack-28cbdd38ac42e69d.js => webpack-87aef16517057517.js} (95%) rename _next/static/css/{f0f36208c2fcb1c3.css => c6cedafb02fc8476.css} (62%) rename _next/static/{2uYngEHuf-40uUFXbg-ls => op3guuVeVevE1TrRbbT9D}/_buildManifest.js (100%) rename _next/static/{2uYngEHuf-40uUFXbg-ls => op3guuVeVevE1TrRbbT9D}/_ssgManifest.js (100%) diff --git a/404.html b/404.html index c42e16d..79bea1d 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -Crust Cloud
\ No newline at end of file +Crust Cloud
\ No newline at end of file diff --git a/_next/static/chunks/424.e9f060d60db0ba85.js b/_next/static/chunks/424.ada8ecdb82c083e9.js similarity index 65% rename from _next/static/chunks/424.e9f060d60db0ba85.js rename to _next/static/chunks/424.ada8ecdb82c083e9.js index b4d0857..6654601 100644 --- a/_next/static/chunks/424.e9f060d60db0ba85.js +++ b/_next/static/chunks/424.ada8ecdb82c083e9.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[424],{39547:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return a5}});var a,i,l,r,s,c,o,d,u,m,p,y,h,f,g,b,v,x,A,w,Z,k,N,T,I,C,B,M,S,E,X,O,j,P,W,L,R,Y,D,z,G,H,F,U,J,Q,V,K,q,_,$,ee,et,en,ea,ei,el,er,es,ec=n(35944),eo=n(67294);let ed=()=>{let e=(0,eo.useRef)({safe:!0});return(0,eo.useEffect)(()=>(e.current.safe=!0,()=>{e.current.safe=!1}),[]),e.current};function eu(){for(var e=arguments.length,t=Array(e),n=0;nt.map(e=>t=>{a.safe&&e(t)}),[t])}function em(e){let[t,n]=(0,eo.useState)(e),[a]=eu(n);return[t,a]}function ep(e){let t=(0,eo.useRef)(null);return(0,eo.useLayoutEffect)(()=>(t.current=e,()=>{})),(0,eo.useCallback)(function(){for(var e=arguments.length,n=Array(e),a=0;a{e.current||(e.current=!0,t().then(()=>{e.current=!1}))},[]);return[e,t]}let eh={loading:!1},ef=eo.createContext({update(){},oUpdate(){},store:eh}),eg=ef.Provider,eb=(e,t,n)=>{},ev=()=>{let[e,t]=(0,eo.useState)(eh),n=(0,eo.useCallback)(e=>{"function"==typeof e?t(t=>{let n=e(t),a={...t,...n};return eb(n,t,a),a}):t(t=>{let n={...t,...e};return eb(e,t,n),n})},[]);return{store:e,update:n,oUpdate:n}},ex=()=>{let{store:e,update:t}=(0,eo.useContext)(ef),[n]=eu(t);return(0,eo.useMemo)(()=>({store:e,update:n,oUpdate:t}),[e,t,n])};var eA=n(94184),ew=n.n(eA),eZ=n(79352);let ek=eo.memo(e=>(0,ec.tZ)(eZ.uur,{...e,className:ew()(e.className,"animate-spin text-5xl")})),eN=eo.memo(e=>{let{text:t="",loading_attr:n={},text_attr:a={},...i}=e;return(0,ec.BX)("div",{...i,className:ew()(i.className," flex flex-col items-center"),children:[(0,ec.tZ)(ek,{...n}),!!t&&(0,ec.tZ)("div",{...a,className:ew()(" text-2xl text-center mt-9",a.className),children:t})]})}),eT=eo.memo(()=>{let e=(0,eo.useCallback)(e=>{e.stopPropagation()},[]),{loading:t}=function(e){let{oUpdate:t,store:{loading:n}}=ex(),a=(0,eo.useCallback)(()=>t({loading:!0}),[t]),i=(0,eo.useCallback)(()=>t({loading:!1}),[t]);return(0,eo.useEffect)(()=>{"boolean"==typeof e&&(e?a():i())},[e]),(0,eo.useMemo)(()=>({show:a,hiden:i,loading:n}),[a,i,n])}();return t?(0,ec.tZ)("div",{className:" fixed left-0 top-0 z-50 w-screen h-screen flex justify-center items-center bg-opacity-60 bg-black-1",onMouseMove:e,onMouseDown:e,onClick:e,children:(0,ec.tZ)(eN,{className:"py-10"})}):null});var eI=n(79655),eC=n(89250);function eB(){return(eB=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{text:t="",className:n}=e;return(0,ec.tZ)("div",{className:ew()("text-left text-black font-medium text-[2.5rem] leading-[2.9375rem]",n),children:t})});function eW(){return(eW=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:6,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;return e?e.length<=t+n?e:"".concat(e.toString().substring(0,t),"...").concat(e.toString().substring(e.length-n)):""};function e_(e){if(e){let t=document.getElementById(e);t&&t.scrollIntoView({block:"start",behavior:"smooth"})}}function e$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_blank";window.open(e,t)}let e0=new(ez())("800000000");function e1(e){let[t,n]=e.split("-"),a=new(ez())(t,36).sub(e0).toString(10);return[a,n]}function e2(e,t){let n=new(ez())(e).add(e0);return"".concat(n.toString(36),"-").concat(t)}function e5(e){return new Promise(t=>setTimeout(t,e))}function e3(e){switch(e){case eV.c.mainnet.id:break;case eV.c.goerli.id:return"https://goerli.etherscan.io";case eV.c.arbitrum.id:return"https://arbiscan.io";case eV.c.arbitrumGoerli.id:return"https://goerli.arbiscan.io";default:console.warn("chainId:".concat(e," not supported."))}return"https://etherscan.io"}function e4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e<9765625e-10?"".concat(eF().floor(1048576*e,t)," KB"):e<1?"".concat(eF().floor(1024*e,t)," MB"):e<1024?"".concat(eF().floor(e,t)," GB"):e<1048576?"".concat(eF().floor(e/1024,t)," TB"):"".concat(eF().floor(e/1048576,t)," PB")}function e6(e){return"".concat(eY.C5,"/ipfs/").concat(e)}function e8(e,t){return e+Math.floor(Math.random()*(t-e))}function e7(e){return eK("sha256").update(e,"binary").digest("base64")}eQ.Kc&&(window.parseBucketId=e1,window.genBucketId=e2);var e9=n(5121);let te="ZXRoLTB4MEVDNzJGNEQ5MWVhN2ZiRjAyZTY2NUQzZDU5QzQ3MmVjY2M0ZWZFZDoweDc3NDdmNDkxMWNhOWY2YWJjODE0MTgxZTkzZmM1YjdlNzQ4MGIwYzM0ZGRmOWFmNGQ4NjQ3OTRiZmYzY2EzMTg2MzQyNWEwZDRjZjAyOTA1Mjc5MTIwNDliYjJlYTRkMTM1OGZlZjQ3ZDU4YzBmMTQxNjI3ZmMzMTIwNzMwODdjMWI";async function tt(e){let{data:t,endpoint:n=eY.sl,authBasic:a="Basic ".concat(te),onProgress:i,cancelToken:l=e9.Z.CancelToken.source().token}=e,r=await e9.Z.request({data:t,cancelToken:l,headers:{Authorization:a},method:"POST",onUploadProgress(e){i&&i(e.progress)},params:{pin:!0},url:"".concat(n,"/api/v0/add")});return r.data}async function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:te;try{if(0===e.length)throw Error("CID len err");let a=await e9.Z.post("".concat("https://pin.crustcode.com/psa","/pins"),JSON.stringify({cid:e,name:t}),{headers:{authorization:"Bearer "+n,"Content-Type":"application/json"}});return a.data}catch(i){return null}}function ta(){let{update:e}=ex(),t=(t,n)=>{e(e=>{let{toasts:n}=e;return{toasts:[{type:"error",msg:t}].concat(n||[])}})},n=(t,n)=>{e(e=>{let{toasts:n}=e;return{toasts:[{type:"success",msg:t}].concat(n||[])}})};return{error:t,success:n}}function ti(e){let{className:t,onClose:n,uploadRender:a,uploadBorder:i=!0,onSuccess:l,id:r=""}=e,s=ta(),[c,o]=(0,eo.useState)({progress:0,status:"stop"}),d=(0,eo.useRef)(null),u=(0,eo.useRef)(null),[m,p]=(0,eo.useState)(null),[y,h]=(0,eo.useState)(null),f=async()=>{"stop"===c.status&&u.current.click()};(0,eo.useEffect)(()=>{if(d.current){let e=d.current;e.addEventListener("dragover",e=>{e.preventDefault()}),e.addEventListener("dragenter",async()=>{e.querySelector("#waitUpload")&&(e.style.borderColor="#FC7823")}),e.addEventListener("dragleave",async()=>{e.style.borderColor="#131521"}),e.addEventListener("drop",async t=>{if(t.stopPropagation(),t.preventDefault(),e.querySelector("#waitUpload")){if(e.style.borderColor="#131521",t.dataTransfer.files.length>1||!/\.[a-zA-Z]+$/.test(t.dataTransfer.files[0].name))return s.error("Folders are not supported!"),!1;let[n]=t.dataTransfer.files;if(!n)return s.error("Please select a file."),!1;let a=n.size/1048576;if(a>100){s.error("Please select a file less than 100MB.");return}await g(n)}})}},[]);let g=async e=>{try{let t=e9.Z.CancelToken.source();p(t),o({progress:0,status:"upload"}),u.current.value="";let n=new FormData;if(!e||!e.name)return!1;n.append("file",e,e.name);let a=await tt({data:n,authBasic:"Basic ".concat("ZXRoLTB4MEVDNzJGNEQ5MWVhN2ZiRjAyZTY2NUQzZDU5QzQ3MmVjY2M0ZWZFZDoweDc3NDdmNDkxMWNhOWY2YWJjODE0MTgxZTkzZmM1YjdlNzQ4MGIwYzM0ZGRmOWFmNGQ4NjQ3OTRiZmYzY2EzMTg2MzQyNWEwZDRjZjAyOTA1Mjc5MTIwNDliYjJlYTRkMTM1OGZlZjQ3ZDU4YzBmMTQxNjI3ZmMzMTIwNzMwODdjMWI="),cancelToken:t.token,onProgress(e){o({progress:Math.round(99*e),status:"upload"})}});p(null),o({progress:100,status:"success"}),h(a),l&&l(a)}catch(i){console.error(i)}},b=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),m&&(m.cancel("CanceledError"),p(null)),o({progress:0,status:"stop"}),n&&n(),h(null)},v=async e=>{let t=e.target.files[0];if(!t)return s.error("Please select a file."),!1;let n=t.size/1048576;if(n>100){s.error("Please select a file less than 100MB.");return}await g(t)};return(0,ec.BX)("div",{id:r,className:ew()("w-full flex justify-center",t),children:[(0,ec.BX)("div",{ref:d,onClick:f,className:ew()("w-full h-full cursor-pointer relative max-w-[70rem] flex justify-center items-center border-black-1 border-4 border-dashed"),style:i||"upload"!==c.status?{}:{border:"none"},children:[n&&(0,ec.tZ)(eL,{className:"absolute z-10 right-2 top-2 cursor-pointer",onClick:b}),"stop"!==c.status?"upload"===c.status?(0,ec.tZ)("div",{className:ew()("w-full",{"px-5":!!a,"px-20":!a}),children:a?a(c.progress):(0,ec.tZ)(eR,{value:c.progress})}):(0,ec.BX)("div",{className:"text-black-3 text-lg flex flex-col px-20",children:[(0,ec.tZ)("label",{className:"text-xl font-medium text-black",children:"IPFS CID:"}),(0,ec.tZ)("span",{className:"mt-5",children:y.Hash}),(0,ec.BX)("div",{className:"mt-20",children:[(0,ec.tZ)("label",{className:"text-xl font-medium text-black",children:"You may want to:"}),(0,ec.BX)("div",{className:"flex flex-wrap mt-5",children:[(0,ec.tZ)("div",{className:"mr-5 w-1/2 mb-2 underline",onClick:()=>e$("".concat(eY.C5,"/ipfs/").concat(y.Hash)),children:"Get download link for this file"}),(0,ec.tZ)("div",{className:"underline",onClick:()=>e$("https://ipfs-scan.io/?cid=".concat(y.Hash)),children:"Verify on IPFS"}),(0,ec.tZ)("div",{className:"mr-5 w-1/2 underline",onClick:()=>e$("https://docs.crustcloud.io"),children:"Learn more about Crust Cloud's storage solution"}),(0,ec.tZ)("div",{onClick:()=>e$("http://test.crustcloud.io/#/buckets"),className:"underline",children:"Claim your W3Bucket NFT on testnet"})]})]})]}):(0,ec.tZ)("span",{style:{pointerEvents:"none"},id:"waitUpload",className:"text-black-1 font-medium text-[2rem] leading-normal",children:"Drag and drop your file here"})]}),(0,ec.tZ)("input",{ref:u,hidden:!0,onChange:v,type:"file"})]})}let tl=eo.memo(()=>{let[e,t]=(0,eo.useState)(!1),n=()=>{t(!0),setTimeout(()=>{e_("nftupload")},0)},a=()=>{t(!1),setTimeout(()=>{e_("nft")},0)};return(0,ec.tZ)("div",{className:"w-full py-6 px-12 flex justify-center pb-20 mt-3 text-slate-700 text-lg",id:"nft",children:(0,ec.BX)("div",{className:"w-full max-w-[1112px] flex flex-col text-black",children:[(0,ec.tZ)(eP,{className:"mt-6 mb-8 font-medium",text:"Web3 Storage Buckets & Web3 IPFS Gateways"}),(0,ec.tZ)("p",{className:"pb-20 text-2xl text-black-3",children:"Crust Cloud defines what cloud storage middlewares should look like in Web3 - every storage bucket is a NFT, and every IPFS gateway is a NFT."}),(0,ec.BX)("div",{className:"flex justify-center",children:[(0,ec.BX)("div",{className:"flex flex-col justify-between",children:[(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)(eM,{}),(0,ec.tZ)("span",{className:"text-6xl px-6",children:"="}),(0,ec.tZ)(eE,{})]}),(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)(eO,{}),(0,ec.tZ)("span",{className:"text-6xl px-6",children:"="}),(0,ec.tZ)(eE,{})]})]}),(0,ec.BX)("div",{className:"ml-16",children:[(0,ec.tZ)("h4",{className:"text-[1.375rem] font-semibold text-black mb-4",children:"Store files in W3Buckets: Decentralized, Guaranteed & Alive."}),(0,ec.tZ)("p",{className:"text-black-3",children:"All contents in the W3Buckets are immutable, decentralized stored, guaranteed with up to permanent persistence in the open internet, and most importantly, owned & controlled by the NFT owner."}),(0,ec.tZ)("h4",{className:"text-[1.375rem] font-semibold text-black mb-4 mt-20",children:"IPFS Remote Pin"}),(0,ec.tZ)("p",{className:"text-black-3",children:"Storage service are called by Standard IPFS Remote Pinning Service APIs that make your files always available (alive!) on IPFS with multiple replicas and accessible from everywhere."}),(0,ec.BX)("div",{className:"flex mt-8 text-black-1",children:[(0,ec.tZ)(ej,{onClick:n,className:"btn-173",text:"Play Quick Demo"}),(0,ec.tZ)(ej,{onClick:()=>eQ.Kc?e$("/#/buckets","_self"):e$("/#/buckets"),className:"btn-173 ml-5",text:"Launch App"})]})]})]}),e&&(0,ec.tZ)(ti,{id:"nftupload",className:"h-[32.937rem] mt-12",onClose:a})]})})}),tr=[[[42,49]],[[41,50]],[[38,53]],[[37,53]],[[20,26],[35,52]],[[18,28],[34,51],[82,85],[96,100],[110,111]],[[17,24],[27,27],[29,32],[36,36],[38,51],[81,84],[92,101],[109,111]],[[3,6],[11,12],[16,27],[29,34],[40,51],[80,81],[86,86],[89,89],[91,106],[110,115]],[[2,8],[10,24],[26,27],[30,36],[40,50],[67,74],[83,83],[85,86],[88,123]],[[2,24],[26,26],[28,31],[34,37],[40,49],[66,75],[77,86],[88,124]],[[1,31],[34,38],[40,46],[51,54],[66,73],[76,124]],[[1,28],[31,31],[33,37],[41,44],[52,53],[64,123]],[[2,27],[33,37],[42,43],[63,115],[118,122]],[[4,8],[11,27],[33,38],[60,60],[64,114],[116,119]],[[3,7],[13,30],[33,39],[59,61],[64,109],[116,118]],[[2,3],[13,31],[33,40],[58,62],[64,110],[116,118]],[[0,1],[14,40],[58,111],[116,117]],[[16,36],[40,40],[60,111],[115,116]],[[16,38],[40,41],[61,78],[81,109],[111,111]],[[16,39],[60,71],[73,73],[75,77],[80,108]],[[16,37],[58,62],[66,66],[68,71],[76,78],[80,108],[110,111]],[[16,35],[58,61],[65,65],[67,67],[69,78],[81,102],[104,107],[110,110]],[[17,35],[59,60],[63,65],[67,67],[69,69],[71,78],[80,103],[105,106],[109,110]],[[18,34],[61,65],[74,103],[105,105],[108,110]],[[19,32],[59,66],[69,70],[74,103],[107,108]],[[20,32],[58,104],[106,107]],[[20,27],[31,32],[58,78],[80,104]],[[21,26],[31,31],[57,73],[75,78],[82,103]],[[21,21],[23,25],[56,73],[75,82],[85,103]],[[23,26],[28,29],[31,33],[56,74],[76,82],[86,101]],[[23,29],[34,36],[56,74],[76,81],[87,91],[94,98],[100,100],[104,104]],[[25,30],[56,75],[77,80],[87,90],[94,99],[103,104]],[[28,31],[56,75],[77,78],[87,89],[95,99],[103,104]],[[30,31],[34,37],[55,76],[88,89],[96,99],[104,104]],[[30,39],[56,79],[88,89],[96,96],[98,98],[102,102],[104,105]],[[31,40],[57,79],[88,89],[96,96],[101,102],[104,105]],[[33,42],[58,61],[64,79],[95,97],[101,102]],[[32,42],[65,78],[95,97],[100,102],[106,106]],[[32,43],[65,76],[96,97],[100,104],[106,108]],[[31,45],[65,76],[96,98],[100,102],[104,104],[107,111]],[[31,47],[65,75],[97,99],[107,112]],[[31,47],[66,75],[98,100],[110,113]],[[32,47],[66,75],[100,101],[104,105],[110,113]],[[33,47],[66,76],[78,79],[107,108],[113,113]],[[33,46],[65,76],[78,79],[105,108],[111,111]],[[34,46],[65,75],[77,79],[104,112]],[[35,46],[66,75],[77,79],[104,113]],[[35,45],[66,74],[77,78],[102,113]],[[35,44],[67,74],[77,78],[101,114]],[[35,43],[67,73],[77,77],[101,114]],[[35,43],[67,72],[101,114]],[[35,42],[68,72],[102,114]],[[35,41],[68,71],[102,114]],[[34,41],[68,69],[101,103],[108,108],[110,114],[123,123]],[[34,39],[110,113],[123,124]],[[34,38],[111,112],[122,124]],[[34,37],[112,113],[122,124]],[[34,36],[112,112],[121,122]],[[33,37],[120,121]],[[33,36]],[[33,35]],[[34,37]],[[35,36]]],ts=(0,eo.memo)(function(e){let{className:t,activePos:n,onChange:a}=e,[i,l]=(0,eo.useState)([]);(0,eo.useMemo)(()=>{if(n.length>0){let e=[];n.map(t=>{for(let n=0;n=r[0]&&t.x<=r[1]&&t.y===n){e.push(r),i=!0;break}}if(i)break}}),l(e)}},[n]),(0,eo.useMemo)(()=>{i.length>0&&a&&a(i)},[i]);let r=e=>{let t=e[0],n=e[1],a=[];for(let i=t;i<=n;i++)a.push(i);return a},s=(e,t)=>{let a=eF().find(n,n=>n.x===e&&n.y===t);return a?"red":"#666"};return(0,ec.tZ)("svg",{viewBox:"0 0 880 450",className:ew()("",t),children:tr.map((e,t)=>e.map(e=>r(e).map((e,n)=>(0,ec.tZ)("circle",{fill:s(e,t),cx:(e+1)*7,cy:(t+1)*7,r:"2.6"},"circle".concat(n)))))})});function tc(){return(tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=ty();return{logo:(0,ec.tZ)(tp,{className:""}),name:"AAVE",activePos:e.activePos,total:e.total}})()],tf=eo.memo(()=>{let[e,t]=(0,eo.useState)(0),n=()=>{t(e-1>=0?e-1:th.length-1)},a=()=>{t(e+1>th.length-1?0:e+1)};return(0,ec.tZ)("div",{className:"w-full pt-6 pb-[min(12vmin,18.75rem)] px-12 flex flex-col items-center",children:(0,ec.BX)("div",{className:"my-10 text-black w-full max-w-[1310px]",children:[(0,ec.tZ)(eP,{className:"mx-auto max-w-[1120px] ",text:"Discover some real use cases"}),th.map((t,i)=>i===e&&(0,ec.BX)("div",{className:ew()("flex justify-center pt-5"),children:[(0,ec.tZ)(ts,{activePos:t.activePos,className:"flex-1 pt-16"}),(0,ec.BX)("div",{className:"flex flex-shrink-0 flex-col items-center w-[22.625rem] ml-10 ",children:[(0,ec.BX)("div",{className:"h-[4.625rem] w-full flex justify-between items-center",children:[(0,ec.tZ)(tu,{className:"cursor-pointer",onClick:n}),t.logo,(0,ec.tZ)(tu,{className:"rotate-180 cursor-pointer",onClick:a})]}),(0,ec.BX)("span",{className:"text-black text-lg mt-12 font-medium",children:["Check this real-time monitor to see how we help ",t.name," decentralized host their Dapp frontend:"]}),(0,ec.BX)("div",{className:"text-black-3 text-lg mt-3",children:[(0,ec.BX)("p",{className:"mt-5",children:[(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:t.total})," IPFS Replicas all around the globe"]}),(0,ec.BX)("p",{className:"mt-5",children:[(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:"99+"})," Years guaranteed with ",(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:"1.5ETH"})," in payment contract"]}),(0,ec.BX)("p",{className:"mt-5",children:["Guranteed by ",(0,ec.tZ)("a",{className:"text-black-3 underline",href:"https://crust.network/",target:"_blank",children:"decentralized incentive protocol"})," on IPFS"]}),(0,ec.BX)("p",{className:"mt-5",children:["Verifiable on ",(0,ec.tZ)("a",{className:"text-black-3 underline",href:"https://ipfs-scan.io/",target:"_blank",children:"IPFS Scan"})]})]})]})]},"monitorProject".concat(i)))]})})});var tg=n(85769),tb=n(85118),tv=n(53459),tx=n(15029),tA=n(99477);function tw(){let e="#787980",t=(0,eo.useMemo)(()=>{let e=[],t=new tA.Vector3;for(let n=0;n<2e3;n++){t.x=2*Math.random()-1,t.y=2*Math.random()-1,t.z=2*Math.random()-1,t.normalize(),t.multiplyScalar(26);let a=[t.x,t.y,t.z];t.multiplyScalar(.2*Math.random()+1);let i=[t.x,t.y,t.z];e.push([a,i])}return e},[]),n=(0,eo.useMemo)(()=>{let e=[],t=new tA.Vector3;for(let n=0;n<300;n++){t.x=n%2==0?-1:1,t.y=(2*Math.random()-1)*.5,t.z=(2*Math.random()-1)*.3,t.normalize(),t.multiplyScalar(26+4*Math.random()-2);let a=[t.x,t.y,t.z];t.multiplyScalar(2*Math.random()+1.3);let i=[t.x,t.y,t.z],l=Math.abs(a[0]-i[0]),r=Math.round(1+5*l/27),s=[i[0]-a[0],i[1]-a[1],i[2]-a[2]],[c,o,d]=[s[0]/(r+1),s[1]/(r+1),s[2]/(r+1)],u=[];if(Math.random()>.5)for(let m=1;m<=r;m++){let p=Math.ceil(Math.random()-.5),y=(3*Math.random()+2)*p;u.push([a[0]+m*c,a[1]+m*o+y,a[2]+m*d+0])}e.push([a,i,u])}return e},[]),a=(0,eo.useRef)(),i=(0,eo.useRef)(),l=(0,eo.useRef)({count:0}),r=(0,eo.useRef)({});(0,tv.C)((e,t,n)=>{if(a.current){let s=2*Math.PI,c=a.current.rotation.x+s*t*.01;a.current.rotation.x=c>s?c-s:c}if(i.current){let o=l.current.count%6==0;for(let d of i.current.children)if("Points"===d.type){let m=d,p=m.geometry.getAttribute("position");for(let y=0;y2*f.max?1:g,v=b<=f.max?b-1:2*f.max-b-1;p.setXYZ(y,h.getX(v),h.getY(v),h.getZ(v))}else p.setXYZ(y,h.getX(0),h.getY(0),h.getZ(0))}p.needsUpdate=!0}else if("Line"===d.type){let x=d,A=r[x.name];if(A){let w=A.count+(o?1:0),Z=w>2*A.max?1:w,k=Z<=A.max?Z:2*A.max-Z;x.geometry.setDrawRange(0,k),A.count=Z}else if(x.geometry.setDrawRange(0,0),.001>Math.random()){let N=Math.round(x.geometry.getAttribute("position").array.length/3);r[x.name]={count:1,max:N}}}l.current.count++,l.current.count>600&&(l.current.count=0)}},-2);let s=(0,tg.m)("disc.png"),c=(0,eo.useMemo)(()=>new tA.Float32BufferAttribute(t.flatMap(e=>e[1]),3),[t]),o=(0,eo.useMemo)(()=>new tA.Float32BufferAttribute(t.flatMap(e=>e[0].concat(e[1])),3),[t]),d=(0,eo.useMemo)(()=>new tA.Float32BufferAttribute(n.flatMap(e=>e[1]),3),[n]),u=(0,eo.useMemo)(()=>{let e=[];for(let[t,a,i]of n){let l=[t,...i,a],r=new tA.CatmullRomCurve3(l.map(e=>new tA.Vector3(...e)),!1,"chordal",.5),s=Math.abs(t[0]-a[0]),c=Math.round(20+160*s/27),o=r.getPoints(c).flatMap(e=>[e.x,e.y,e.z]);e.push(new tA.Float32BufferAttribute(o,3))}return e},[n]);return(0,ec.BX)("group",{position:[40,0,0],children:[(0,ec.BX)("group",{ref:a,children:[(0,ec.BX)("points",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:c}}),(0,ec.tZ)("pointsMaterial",{color:e,opacity:.7,map:s,size:4,blending:tA.AdditiveBlending,depthTest:!1,transparent:!0})]}),(0,ec.BX)("lineSegments",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:o}}),(0,ec.tZ)("lineBasicMaterial",{color:e,linewidth:1})]})]}),(0,ec.BX)("group",{ref:i,children:[(0,ec.BX)("points",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:d}}),(0,ec.tZ)("pointsMaterial",{color:"#cdcccc",opacity:.7,map:s,size:4,blending:tA.AdditiveBlending,depthTest:!1,transparent:!0})]}),u.map((t,n)=>(0,ec.BX)("line_",{name:n,children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:t}}),(0,ec.tZ)("lineBasicMaterial",{color:e,linewidth:1})]},"line_".concat(n)))]})]})}(0,tv.e)({Line_:tA.Line});let tZ=eo.memo(function(){return(0,ec.BX)(tx.Xz,{gl:{antialias:!0},children:[(0,ec.tZ)(tb.i,{makeDefault:!0,zoom:9,args:[-150,50,30,-30,50,-100]}),(0,ec.tZ)("ambientLight",{color:"#eaeaea",intensity:1}),(0,ec.BX)("mesh",{position:[0,0,-100],children:[(0,ec.tZ)("planeGeometry",{args:[1e3,1e3]}),(0,ec.tZ)("meshStandardMaterial",{color:"black"})]}),(0,ec.tZ)(tw,{})]})});var tk=n(21132);function tN(){return(tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t((0,tk.tf)(()=>{setTimeout(()=>{window.scroll(0,0)},50)}),(0,ec.BX)("div",{className:"w-full min-h-min relative",children:[(0,ec.tZ)("div",{className:"w-full bg-black h-screen absolute left-0 top-0 z-0",children:(0,ec.tZ)(tZ,{})}),(0,ec.BX)("div",{className:"z-1 h-[100vh] relative w-full py-6 px-12 flex flex-col items-center",children:[(0,ec.tZ)("div",{className:"h-14 w-full max-w-[1112px] flex justify-between items-center font-WorkSans",children:(0,ec.tZ)("div",{className:"text-[88px] ml-3 mt-5",children:(0,ec.tZ)(tE,{})})}),(0,ec.BX)("div",{className:"h-full my-10 w-full max-w-[1112px] flex flex-col justify-center mt-[-1rem]",children:[(0,ec.BX)("div",{className:"font-RobotoMono font-bold text-[2.5rem] leading-tight",children:[(0,ec.tZ)("p",{children:"Crust Cloud"}),(0,ec.tZ)("p",{children:"Redefining Web3 Storage"})]}),(0,ec.BX)("div",{className:"flex flex-col mt-12 pl-1 mb-20",children:[(0,ec.BX)("div",{className:"flex mb-3",children:[(0,ec.tZ)(ej,{text:"Documentations",className:"btn-173 border-white text-white",onClick:()=>e$("https://docs.crustcloud.io/")}),(0,ec.tZ)(ej,{text:"Launch App",className:"btn-173 ml-3 border-white text-white",onClick:()=>eQ.Kc?e$("/#/buckets","_self"):e$("/#/buckets")})]}),(0,ec.tZ)("div",{className:"flex",children:(0,ec.tZ)(ej,{text:"Contact the team",className:"btn-173 border-white text-white",onClick:()=>e$("https://forms.gle/NUSvEDDR4AmP8wbV6")})})]})]})]})]})));function tO(){return(tO=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,ec.tZ)("div",{className:"w-full py-20 px-12 flex flex-col items-center justify-center text-black-1",children:(0,ec.BX)("div",{className:"w-full max-w-[1112px]",children:[(0,ec.tZ)(eP,{className:"w-full pb-14",text:"Crust Cloud is a Web3 storage cloud"}),(0,ec.BX)("div",{className:"w-full flex justify-between items-end text-lg",children:[(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-black-1 mt-12",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-black-1 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"IaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Infrastructure-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.BX)("div",{className:"flex items-center mt-6",children:[(0,ec.tZ)(tj,{}),(0,ec.tZ)(tW,{className:"ml-11"})]}),(0,ec.tZ)("a",{href:"https://ipfs.io",target:"_blank",className:"text-2xl text-black-1 font-medium leading-7 mt-5 mb-3 underline no-skip-ink",children:"IPFS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"the distrbuted file system"}),(0,ec.tZ)("a",{href:"https://crust.network",target:"_blank",className:"text-2xl text-black-1 font-medium leading-7 mt-5 mb-3 underline no-skip-ink",children:"Crust Network"}),(0,ec.tZ)("p",{className:"w-[294px] leading-[1.3125rem] text-center",children:"the decentralized storage protocol & incentive layer of IPFS"})]}),(0,ec.tZ)("div",{})]}),(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.tZ)("h4",{className:"text-orange-15 font-medium text-[2rem] leading-[2.375rem] mb-4",children:"Crust Cloud Products"}),(0,ec.BX)("div",{className:"flex",children:[(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-orange-15",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-orange-15 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"PaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Platform-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center pt-7 pb-14",children:[(0,ec.BX)("div",{className:"flex items-center text-[2.5rem]",children:[(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tR,{}),(0,ec.tZ)("span",{className:"px-3",children:"+"}),(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tD,{})]}),(0,ec.tZ)("h6",{onClick:()=>e_("nft"),className:"text-2xl font-medium leading-7 mt-[1.7rem] mb-3 underline no-skip-ink cursor-pointer",children:"W3Buckets"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"NFT-nized IPFS storage buckets"}),(0,ec.tZ)("h6",{onClick:()=>e_("nft"),className:"text-2xl font-medium leading-7 mt-5 mb-3 underline no-skip-ink cursor-pointer",children:"W3Gateways"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"NFT-nized IPFS Gateways"})]})]}),(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-orange-15",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-orange-15 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"SaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Software-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center pt-7",children:[(0,ec.BX)("div",{className:"flex items-center text-[2.5rem]",children:[(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tG,{})]}),(0,ec.tZ)("h6",{onClick:()=>e_("widget"),className:"text-2xl font-medium leading-7 mt-[2rem] mb-3 underline no-skip-ink cursor-pointer",children:"Web3 Storage Widgets"}),(0,ec.tZ)("p",{className:"w-[298px] leading-[1.3125rem] text-center",children:"Rich-text Editor/Publisher Widget IPFS File Storage Widget"}),(0,ec.tZ)("p",{className:"w-[298px] leading-[1.3125rem] text-center",children:"IPFS Storage Retrieval Widget and more..."})]})]})]})]})]})]})}));function tF(){return(tF=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{icon:t,...n}=e;return"string"==typeof t?(0,ec.tZ)("span",{...n,className:ew()(n.className,t)}):(0,ec.tZ)(t,{...n})}),t$=eo.memo(e=>{let{onClose:t,title:n,className:a,...i}=e;return(0,ec.BX)("div",{...i,className:ew()(" flex pb-5 justify-between border-b border-solid border-b-gray-16",a),children:[(0,ec.tZ)("div",{className:"text-black-3 text-lg",children:n}),(0,ec.tZ)("div",{className:"text-gray-12",children:(0,ec.tZ)(t_,{icon:"cru-fo-x",className:" text-xl cursor-pointer",onClick:t})})]})}),t0=eo.memo(e=>{let{outClick:t,outClassname:n,className:a,children:i,...l}=e,r=null==document?void 0:document.getElementById("app-root");return r?(0,tq.createPortal)((0,ec.tZ)("div",{onClick:t,className:ew()(n,"fixed left-0 top-0 w-screen h-screen z-40 bg-opacity-50 bg-black flex justify-center items-center"),children:(0,ec.tZ)("div",{...l,className:ew()(a," min-w-[27.5rem] p-5 bg-white text-black-1"),children:i})}),r):null});var t1=n(8193);let t2=eo.memo(e=>{let{onClose:t,className:n}=e;return(0,ec.tZ)(t_,{className:ew()("absolute right-6 top-6 text-3xl font-bold cursor-pointer",n),onClick:t,icon:t1.SV5})});function t5(e){let{onClose:t}=e,[n,a]=(0,eo.useState)(0),[i,l]=(0,eo.useState)({Hash:""}),r=e=>{a(3),l(e)},s=e=>(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.tZ)("p",{className:"w-[24rem] text-black-3 text-2xl text-center mb-10",children:"Publishing & Uploading to IPFS Please wait..."}),(0,ec.tZ)(eR,{value:e})]});return(0,ec.tZ)(t0,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white flex min-h-[40.75rem] relative",children:[(0,ec.tZ)(t2,{onClose:()=>t&&t()}),(0,ec.BX)("div",{className:"bg-black w-80 text-white px-8 py-16 text-lg",children:[(0,ec.tZ)("div",{className:"mb-12 text-2xl font-medium",children:"IPFS File Storage Widget"}),3===n?(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 2:"}),(0,ec.tZ)("p",{className:"font-light",children:"When Upload process is completed, you will get an IPFS CID (unique identifier to your stored content) and a Storage Manager Tx No. (Tx No. for the IPFS storage action of your content)."})]}):(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 1:"}),(0,ec.tZ)("p",{className:"mb-5 font-light",children:"Drag and drop a file into the box."}),(0,ec.BX)("p",{className:"font-light",children:["When you finish, click on the ",(0,ec.tZ)("span",{className:"font-semibold",children:"'Upload'"})," button to continue."]})]})]}),(0,ec.tZ)("div",{className:"min-w-[50rem] flex justify-center items-center",children:3===n?(0,ec.BX)("div",{className:"text-center text-black-3 flex flex-col items-center",children:[(0,ec.tZ)(t_,{className:"text-[3.125rem] text-black mb-4",icon:t1.KP3}),(0,ec.tZ)("div",{className:"text-[1.375rem] text-black font-semibold mb-4",children:"Publish successfully!"}),(0,ec.tZ)("p",{className:"mb-14 text-lg",children:"This content has been published and decentralized stored on IPFS."}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Your content's IPFS CID:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7 mb-8",children:i.Hash}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Storage Manager Tx No:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7",children:eq("0x69b9f8cf491b55c485dbb43a86a7e48f7649aa45c958cd245461d04c3146bd91",23,23)})]}):(0,ec.tZ)(ti,{uploadRender:s,onSuccess:r,uploadBorder:!1,className:"h-[29.937rem] w-[42.5rem]"})})]})})}var t3=n(7297),t4=n(18872),t6=n(81482),t8=n(93282);n(37640);var t7=n(96412),t9=n.n(t7),ne=n(4979),nt=n.n(ne),nn=n(31026),na=n(378),ni=n(611),nl=n(49891),nr=n(84672),ns=n(56073),nc=n(54340),no=n(82874),nd=n(5705),nu=n(71265),nm=n(11033),np=n(31871),ny=n(78469),nh=n(55658),nf=n(78822),ng=n(98584),nb=n(81373),nv=n(13848),nx=n(32085),nA=n(92003),nw=n.n(nA),nZ=n(8605),nk=n(57375),nN=n(27353),nT=n(48764).Buffer;function nI(){let e=(0,t3.Z)(['\n width: 100%;\n height: 100%;\n padding: 80px 24px 24px 24px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ol,\n ul {\n list-style: revert !important;\n margin: revert !important;\n padding: revert !important;\n }\n .remirror-editor-wrapper {\n padding-top: unset;\n border-radius: 0;\n border: 1px solid #dfe3e7 !important;\n outline: unset !important;\n overflow: auto;\n height: 447px;\n max-width: 872px;\n max-height: 447px;\n .ProseMirror {\n overflow: hidden;\n min-height: 100%;\n padding: "1rem";\n box-shadow: unset !important;\n pre {\n padding: ',";\n margin: 0;\n }\n .remirror-is-empty:first-of-type::before{\n font-style: normal !important;\n }\n }\n }\n"]);return nI=function(){return e},e}function nC(){let e=(0,t3.Z)(["\n height: 72px !important;\n background-color: #f4f5f7 !important;\n padding: 24px !important;\n border: 1px solid #dfe3e7 !important;\n overflow: hidden !important;\n button {\n padding: unset !important;\n width: 24px !important;\n height: 24px !important;\n /* font-size: 22px; */\n margin-right: 18px !important;\n outline: unset !important;\n border: unset !important;\n background-color: transparent !important;\n }\n "]);return nC=function(){return e},e}async function nB(e){let t=await nN.J.digest(e);return nk.k0.createV0(t).toString()}let nM=eY.C5,nS=new Map,nE=(0,t4.iv)(nI(),(0,nn.y2)("space",3)),nX=e=>{let{style:t,className:n,children:a}=e;return(0,ec.tZ)("div",{style:t,className:"".concat(nE," ").concat(n," w-full"),children:a})},nO={color:{primary:"#FC7823",primaryText:"#FC7823",outline:"transparent",background:"transparent",hover:{primary:"#FC7823",primaryText:"#FC7823"}},fontFamily:{default:"var(--work-sans)"}},nj=()=>(0,ec.BX)(t6.o8,{className:(0,t4.iv)(nC()),children:[(0,ec.tZ)(t6.pQ,{attrs:{level:1}}),(0,ec.tZ)(t6.pQ,{attrs:{level:2}}),(0,ec.tZ)(t6.pQ,{attrs:{level:3}}),(0,ec.tZ)(t6.Vu,{}),(0,ec.tZ)(t6.NV,{}),(0,ec.tZ)(t6.kj,{}),(0,ec.tZ)(t6.QD,{}),(0,ec.tZ)(t6.Om,{}),(0,ec.tZ)(t6.XR,{}),(0,ec.tZ)(t6.gf,{})]}),nP=e=>{let{placeholder:t="Please input text...",initialContent:n="",editorUpdate:a,onUpFinish:i}=e,l=(0,eo.useMemo)(()=>{let e=new ni.y5({autoLink:!0});return e.addHandler("onClick",(e,t)=>(console.log("You clicked link: ".concat(JSON.stringify(t))),!0)),e},[]);(0,eo.useRef)("");let[r,s]=(0,eo.useState)(""),[c,o]=(0,eo.useState)(""),[d,u]=(0,eo.useState)(!1),[m,p]=(0,eo.useState)(""),[y,h]=(0,eo.useState)(-1),f=(0,eo.useMemo)(()=>-1!==y?"uping":r?"finish":"edit",[y,r]),g=async()=>{let e=await nw()();if(e&&e.isMetaMask){await e.request({method:"eth_requestAccounts"});let t=new nZ.Web3Provider(e),n=t.getSigner(),a=await n.getAddress(),i=await n.signMessage("You are signing this message for DEMO purpose only. Sign this message to prove you own this account and you will be able to publish your Web3 content.");return nT.from("eth-".concat(a,":").concat(i)).toString("base64")}return""},b=async(e,t)=>{try{let n=e9.Z.CancelToken.source();t&&t(0);let a=await tt({data:e,cancelToken:n.token,onProgress:t});return console.log(a),a}catch(i){console.error(i.message)}return null},v=async()=>{try{let e=await g();if(!e)return;let t=new FormData;t.append("file",c);let n=await b(t,e=>h(Math.round(99*e)));if(null===n){p("Cannot save markdown file."),u(!0),s("Save markdown failed.");return}let a=n.Hash;await tn(a,"text.md"),s(a),h(-1),i&&i(n)}catch(l){console.error(l)}},x=e=>{let t=0,n=[];for(let{file:a,progress:i}of(console.info("files:",e),e))n.push(()=>new Promise((e,n)=>{let i=new FileReader;i.addEventListener("load",async l=>{console.log(a),t+=1,console.info("readed:",i.result);let r=await nB(new Uint8Array(i.result));console.info("imgKey:",r);let s=nS.get(r);if(!s){let c=new FormData;c.append("file",a,a.name);let o=await b(c);if(null!==o)try{await tn(o.Hash,a.name);let d=await function(e){return new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e,n.loading="eager"})}("".concat(nM,"/ipfs/").concat(o.Hash));if(!d)throw"pre load error";s=o.Hash,nS.set(r,o.Hash)}catch(u){console.error(u)}}s?e({src:"".concat(nM,"/ipfs/").concat(s),fileName:a.name}):n()},{once:!0}),i.readAsArrayBuffer(a)}));return n},A=(0,eo.useCallback)(()=>{let e=document.createElement("div");return e.className="w-[100px] h-[100px] p-[30px]",tq.render((0,ec.tZ)(ek,{}),e),e},[]),w=(0,eo.useCallback)(()=>[new nl.X({placeholder:t}),new nr.x({data:nx,plainText:!0}),l,new ns.H({}),new nc.V,new no.Gc({uploadHandler:x,createPlaceholder:A,enableResizing:!0}),new nd.f,new nu.e({}),new nm.V,new np.z,new ny.UQ({enableSpine:!0}),new ny._3,new ny.Jb({priority:na.xV.High,enableCollapsible:!0}),new nh.l,new nf.W({supportedLanguages:[t9(),nt()]}),new ng.F,new nb.g({copyAsMarkdown:!1}),new nv.h],[t]),{manager:Z}=(0,t8.iF)({extensions:w,stringHandler:"markdown",content:n}),k=e=>{var t;(null===(t=e.tr)||void 0===t?void 0:t.docChanged)&&(null==a||a(e)),console.info("p:",e.helpers.getMarkdown())};return(0,eo.useEffect)(()=>{let e=setInterval(()=>{o(Z.extensionStore.helpers.getMarkdown())},500);return()=>clearInterval(e)},[Z]),(0,ec.BX)(t6.f6,{as:nX,theme:nO,children:["edit"==f&&(0,ec.BX)(t8.O1,{manager:Z,autoFocus:!0,onBlur:k,onChange:k,children:[(0,ec.tZ)(nj,{}),(0,ec.tZ)(t8.PG,{}),(0,ec.tZ)("div",{className:"flex justify-center",children:(0,ec.tZ)(ej,{disabled:!c,className:"btn-173 mt-4",text:"Publish",onClick:v})})]}),"uping"==f&&(0,ec.BX)("div",{className:"mb-[3.5rem] font-WorkSans px-14 flex flex-col items-center",children:[(0,ec.tZ)("p",{className:"w-[24rem] text-black-3 text-2xl text-center mb-10",children:"Publishing & Uploading to IPFS Please wait..."}),(0,ec.tZ)(eR,{value:y})]}),"finish"==f&&(0,ec.tZ)(ec.HY,{children:(0,ec.BX)("div",{className:"mb-[3.5rem] text-center font-WorkSans text-black-3 flex flex-col items-center",children:[(0,ec.tZ)(t_,{className:"text-[3.125rem] text-black mb-4",icon:t1.KP3}),(0,ec.tZ)("div",{className:"text-[1.375rem] text-black font-semibold mb-4",children:"Publish successfully!"}),(0,ec.tZ)("p",{className:"mb-14 text-lg",children:"This content has been published and decentralized stored on IPFS."}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Your content's IPFS CID:"}),(0,ec.tZ)("div",{className:"text-sm text-gray-7 mb-8",children:r}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Storage Manager Tx No:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7",children:eq("0x69b9f8cf491b55c485dbb43a86a7e48f7649aa45c958cd245461d04c3146bd91",23,23)})]})})]})};function nW(e){let{onClose:t}=e,[n,a]=(0,eo.useState)(0);return(0,ec.tZ)(t0,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white flex h-[40.75rem] relative",children:[(0,ec.tZ)(t2,{onClose:()=>t&&t()}),(0,ec.BX)("div",{className:"bg-black w-80 text-white px-8 py-16 text-lg",children:[(0,ec.tZ)("div",{className:"mb-12 text-2xl font-medium",children:"Rich-text Content Publisher Widget"}),0===n&&(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 1:"}),(0,ec.tZ)("p",{className:"mb-5 font-light",children:"Type in any text and try to do some simple edit work."}),(0,ec.BX)("p",{className:"font-light",children:["When you finish, click on the ",(0,ec.tZ)("span",{className:"font-semibold",children:"'Publish'"})," button to continue."]})]}),1===n&&(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 2:"}),(0,ec.tZ)("p",{className:"font-light",children:"When Publish and Upload processes are completed, you will get an IPFS CID (unique identifier to your stored content) and a Storage Manager Tx No. (Tx No. for the IPFS storage action of your content)."})]})]}),(0,ec.tZ)("div",{className:"min-w-[50rem] flex items-center justify-center",children:(0,ec.tZ)(nP,{onUpFinish:e=>e&&a(1)})})]})})}var nL=n(48570),nR=n(76199),nY=n(34209),nD=n(79166);let nz=eo.memo(e=>(0,ec.tZ)(nL.D,{children:e.code,linkTarget:"_blank",components:{h5(e){let{node:t,...n}=e;return(0,ec.tZ)("h5",{style:{fontSize:"18px",fontStyle:"normal"},...n})},code(e){let{node:t,inline:n,className:a,children:i,...l}=e,r=/language-(\w+)/.exec(a||"");return!n&&r?(0,ec.tZ)(nY.Z,{children:String(i).replace(/\n$/,""),style:nD.Z,language:r[1],PreTag:"div",...l}):(0,ec.tZ)("code",{className:a,...l,children:i})}},remarkPlugins:[nR.Z]}));function nG(e){let{onClose:t}=e;return(0,ec.tZ)(t0,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white min-w-[56rem] flex flex-col relative p-6",children:[(0,ec.BX)("div",{className:"flex justify-between items-center mb-6",children:[(0,ec.tZ)("a",{className:"text-2xl underline text-black-1",href:"https://docs.crustcloud.io",target:"_blank",children:"Dev Guidance"}),(0,ec.tZ)(t2,{className:"mt-[-0.3rem]",onClose:()=>t&&t()})]}),(0,ec.tZ)("div",{children:(0,ec.tZ)(nz,{code:"\n##### React:\n\n~~~jsx\nimport { MDEditor } from '@cloud3/react-widgets'\nexport default function App(){\n return(\n \n )\n}\n~~~\n \n \n\n##### Vue:\n\n~~~jsx\n\n\n~~~\n"})})]})})}function nH(e){let{onClose:t}=e;return(0,ec.tZ)(t0,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white min-w-[56rem] flex flex-col relative p-6",children:[(0,ec.BX)("div",{className:"flex justify-between items-center mb-6",children:[(0,ec.tZ)("a",{className:"text-2xl underline text-black-1",href:"https://docs.crustcloud.io",target:"_blank",children:"Dev Guidance"}),(0,ec.tZ)(t2,{className:"mt-[-0.3rem]",onClose:()=>t&&t()})]}),(0,ec.tZ)("div",{children:(0,ec.tZ)(nz,{code:"\n##### React:\n\n~~~jsx\nimport { DragStorage } from '@cloud3/react-widgets'\nexport function(){\n return(\n \n )\n}\n~~~\n \n \n\n##### Vue:\n~~~jsx\n\n\n~~~\n"})})]})})}let nF=eo.memo(()=>{let[e,t]=(0,eo.useState)(!1),[n,a]=(0,eo.useState)(!1),[i,l]=(0,eo.useState)(!1),[r,s]=(0,eo.useState)(!1);return(0,ec.BX)("div",{id:"widget",className:"w-full pb-20 pt-16 px-12 flex flex-col items-center justify-center text-black bg-[#F5F5F5]",children:[(0,ec.BX)("div",{className:"w-full max-w-[1112px] text-lg",children:[(0,ec.tZ)(eP,{className:"w-full mb-8",text:"Web3 Storage Widgets"}),(0,ec.tZ)("p",{className:"w-full text-left text-2xl text-black-3 mb-20",children:"Users should own their contents and take full control of them just like what they do to their assets, but they do not."}),(0,ec.BX)("div",{className:"flex justify-between",children:[(0,ec.BX)("div",{className:"w-[405px] flex flex-col items-center",children:[(0,ec.tZ)(tU,{}),(0,ec.tZ)("p",{className:"mt-14 text-black-3",children:"Web3 Content Widgets contains several easy-integrating, non-intrusive widges that helps Dapps to manage decentralized IPFS storage and give back content ownership to users."})]}),(0,ec.BX)("div",{className:"flex flex-col",children:[(0,ec.BX)("div",{className:"flex",children:[(0,ec.tZ)(tQ,{}),(0,ec.BX)("div",{className:"ml-9",children:[(0,ec.tZ)("h5",{className:"font-semibold text-[1.375rem] mb-4",children:"Rich-text Content Publisher Widget"}),(0,ec.tZ)("p",{className:"w-[490px] text-black-3",children:"This widget contains a rich-text editor that can auto upload contents to IPFS alongside the publish process. "}),(0,ec.BX)("div",{className:"flex mt-5 text-black-1",children:[(0,ec.tZ)(ej,{onClick:()=>t(!0),className:"btn-173",text:"Play Demo"}),(0,ec.tZ)(ej,{onClick:()=>a(!0),className:"btn-173 ml-5",text:"Show Code"})]})]})]}),(0,ec.BX)("div",{className:"flex mt-20",children:[(0,ec.tZ)(tK,{className:"mt-2"}),(0,ec.BX)("div",{className:"ml-9",children:[(0,ec.tZ)("h5",{className:"font-semibold text-[1.375rem] mb-4",children:"IPFS File Storage Widget"}),(0,ec.tZ)("p",{className:"w-[490px] text-black-3",children:"This widget helps applications/dapps to upload files of general types to IPFS and manage file storage for their users. "}),(0,ec.BX)("div",{className:"flex mt-5 text-black-1",children:[(0,ec.tZ)(ej,{onClick:()=>l(!0),className:"btn-173",text:"Play Demo"}),(0,ec.tZ)(ej,{onClick:()=>s(!0),className:"btn-173 ml-5",text:"Show Code"})]})]})]})]})]})]}),e&&(0,ec.tZ)(nW,{onClose:()=>t(!1)}),n&&(0,ec.tZ)(nG,{onClose:()=>a(!1)}),i&&(0,ec.tZ)(t5,{onClose:()=>l(!1)}),r&&(0,ec.tZ)(nH,{onClose:()=>s(!1)})]})}),nU=()=>(0,ec.BX)("div",{className:"w-full",children:[(0,ec.tZ)(tX,{}),(0,ec.tZ)(tH,{}),(0,ec.tZ)(nF,{}),(0,ec.tZ)(tl,{}),(0,ec.tZ)(tf,{})]});var nJ=n(38109),nQ=n(92339),nV=new class{async connect(){try{var e;let t=await this.wallet.reconnectSession();this.wallet.isConnected&&t.length||(t=await this.wallet.connect()),null===(e=this.wallet.connector)||void 0===e||e.on("disconnect",()=>{this.wallet.disconnect(),this.account=null}),this.account=t[0]}catch(n){console.error(n)}}isConnected(){return this.wallet.isConnected&&!!this.account}disconnect(){this.wallet.disconnect(),this.account=null}constructor(){this.account=null,this.wallet=new nQ.DQ({chainId:eY.pg}),this.wallet.reconnectSession().then(e=>{var t;null===(t=this.wallet.connector)||void 0===t||t.on("disconnect",()=>{this.wallet.disconnect(),this.account=null}),e.length>0&&(this.account=e[0])})}},nK=n(48764).Buffer;function nq(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auth",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,[a,i]=(0,eo.useState)(localStorage.getItem(e)||""),{signTypedDataAsync:l}=(0,nJ.yw)(),{chain:r}=(0,nJ.LN)(),s=r&&r.id;r&&r.unsupported;let{address:c}=(0,nJ.mA)(),o=nV.isConnected(),d=ep(async a=>{let r=localStorage.getItem(e)||"";if((!l||!c||!s)&&!o)throw"not connect wallet";o&&(s=eY.pg,c="0x".concat(nV.account));let d=eJ()().unix();if(t&&r){let u=JSON.parse(window.atob(r)).data;if(u.domain.chainId==="".concat(s)&&u.message.signingAddress===c&&u.message.tokenId===a&&(0===u.message.expirationTimestamp||u.message.expirationTimestamp-d>300))return i(r),r}let m=n<=0?0:eJ()().add(n,"hours").unix(),p={domain:{chainId:"".concat(s),name:"Cloud3.cc",verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",version:"1"},message:{description:"Sign for W3 Bucket Access Authentication",signingAddress:c,tokenAddress:o?eY.fL:eY.Jh,effectiveTimestamp:d,expirationTimestamp:m},primaryType:"W3Bucket",types:{W3Bucket:[{name:"description",type:"string"},{name:"signingAddress",type:"address"},{name:"tokenAddress",type:"address"},{name:"effectiveTimestamp",type:"uint256"},{name:"expirationTimestamp",type:"uint256"}]}};a&&(p.message.tokenId=a,p.types.W3Bucket.push({name:"tokenId",type:"string"})),await e5(800);let y="";if(o){let h=nK.from(JSON.stringify({domain:p.domain,types:p.types,value:p.message})),f=await nV.wallet.signData([{data:h,message:"For authentication"}],nV.account);y=window.btoa(String.fromCharCode.apply(null,f[0]))}else y=await l({domain:p.domain,types:p.types,value:p.message});let g=window.btoa(JSON.stringify({data:p,signature:y}));return localStorage.setItem(e,g),i(g),g});return[d,a]}function n_(){return nq("for_mint",!0,3)}function n$(){return nq("auth",!0,12)}var n0=n(63750),n1=n(86893);let n2=eo.memo(e=>{let{className:t,...n}=e;return(0,ec.tZ)("span",{...n,className:ew()(t," font-SquadaOne text-[2.5rem]"),children:"Crust Cloud"})});var n5=n(82775);let n3=eo.memo(e=>{let{onClose:t}=e,{connectAsync:n,connectors:a,data:i}=(0,nJ.$4)(),{switchNetworkAsync:l}=(0,nJ.g0)(),r=(0,eC.s0)(),s=ep(async()=>{try{let e=await (async()=>{let e=await nw()();if(e&&e.isMetaMask){await e.request({method:"eth_requestAccounts"});let t=new nZ.Web3Provider(e),n=t.getSigner(),a=await n.getChainId();if(eY.k0.has(a))return a}return console.warn("Cannot get chainId from provider or unsupported chain, use ".concat(eY.XL[0].id)),eY.XL[0].id})(),t=new n5.i({chains:[eY.k0.get(e)]});console.info("data:",i),console.info("cts:",a),(!i||i.chain.unsupported)&&l?await l(e):await n({chainId:e,connector:t}),r("/buckets")}catch(s){console.error(s)}}),c=ep(async()=>{try{await nV.connect(),r("/buckets")}catch(e){console.error(e)}});return(0,ec.BX)(t0,{outClick:t,children:[(0,ec.tZ)(t$,{title:"Connect Wallet",onClose:t}),(0,ec.BX)("div",{onClick:s,className:"bg-[#ececec] hover:bg-[#dfdfdf] h-14 mt-5 flex px-6 py-3 cursor-pointer justify-between items-center",children:[(0,ec.tZ)(tM,{className:" text-[1.75rem]"}),(0,ec.tZ)("div",{className:" text-black-1 text-sm",children:"MetaMask"}),(0,ec.tZ)("div",{className:" w-[1.75rem]"})]}),(0,ec.BX)("div",{onClick:c,className:"bg-[#ececec] hover:bg-[#dfdfdf] h-14 mt-5 flex px-6 py-3 cursor-pointer justify-between items-center",children:[(0,ec.tZ)(tS,{className:" text-[1.75rem]"}),(0,ec.tZ)("div",{className:" text-black-1 text-sm",children:"PeraWallet"}),(0,ec.tZ)("div",{className:" w-[1.75rem]"})]})]})});var n4=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BucketMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"EditionPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"EditionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITIONS_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_TOKEN_ID_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"}],"name":"getBucketEditionPrices","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"activeOnly","type":"bool"}],"name":"getBucketEditions","outputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"},{"internalType":"uint256","name":"currentSupplyMinted","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEdition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","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":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"prices","type":"tuple[]"}],"name":"setBucketEditionPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEditionParams[]","name":"editions","type":"tuple[]"}],"name":"setBucketEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","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":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]'),n6=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BucketMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"EditionPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"EditionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITIONS_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_TOKEN_ID_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"}],"name":"getBucketEditionPrices","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"activeOnly","type":"bool"}],"name":"getBucketEditions","outputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"},{"internalType":"uint256","name":"currentSupplyMinted","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEdition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","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":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"prices","type":"tuple[]"}],"name":"setBucketEditionPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEditionParams[]","name":"editions","type":"tuple[]"}],"name":"setBucketEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","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":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]');let n8=[];function n7(){let{chain:e}=(0,nJ.LN)(),t=e&&e.id,{address:n}=(0,nJ.mA)(),a=nV.isConnected();return t&&((0,eY._D)(t),n8=t===eV.c.arbitrumGoerli.id||t===eV.c.arbitrum.id?n4:n6),(0,eo.useMemo)(()=>n&&eY.k0.has(t)||a,[n,t,a])}var n9=n(60155),ae=n(62313);let at=eQ.TQ||eQ.Cg?"Claim your test version W3Bucket NFT and start your decentralized cloud storage experience on Crust Cloud testnet. To continue, please connect your Ethereum wallet and switch to Goerli testnet.":"W3Bucket runs on Ethereum mainnet. To start your decentralized cloud storage experience, please connect your Ethereum wallet.",an=eo.memo(e=>{let{menuId:t,children:n,...a}=e,{address:i}=(0,nJ.mA)(),{chain:l}=(0,nJ.LN)(),r=n7(),s=nV.isConnected();s&&(i="0x".concat(nV.account));let c=(0,eo.useMemo)(()=>[{id:1,icon:n0.QdO,text:"W3Buckets",path:"/buckets"},{id:2,icon:tB,text:"Settings",path:"/settings"},{id:3,icon:"cru-fo-homework",text:"Docs",url:"https://docs.crustcloud.io"}],[]),o=(0,eC.s0)(),[d,u]=(0,eo.useState)(!1);(0,eo.useEffect)(()=>{r&&u(!1)},[r]);let{disconnect:m}=(0,nJ.qL)(),p=ep(()=>{m(),localStorage.removeItem("for_mint"),localStorage.removeItem("auth"),localStorage.removeItem("for_upload"),nV.disconnect(),o("/buckets")}),y=(0,eo.useRef)(null),h=(0,ae.Z)(y);return(0,ec.tZ)("div",{...a,className:ew()(a.className," w-full h-screen min-h-max text-black-1"),children:(0,ec.BX)("div",{className:" w-full flex h-full",children:[(0,ec.BX)("div",{className:"h-full w-64 flex flex-col border-r-8 border-solid border-[#EEEEEE]",children:[(0,ec.BX)("div",{className:"my-8 flex items-center mx-auto",children:[(0,ec.tZ)(n2,{className:"text-black-1"}),r&&(0,ec.tZ)("div",{className:ew()(" ml-4 text-xs px-[0.39rem] py-[0.13rem] mb-[-0.42rem] text-white",eQ.TQ||eQ.Cg?"bg-gray-11":"bg-blue-2"),children:s?"Algorand":l.name.replace(" ","")})]}),(0,ec.tZ)("div",{className:"flex-1",children:c.map((e,n)=>(0,ec.BX)("div",{className:ew()(" pl-10 py-4 text-lg cursor-pointer ",{"bg-black-1":e.id===t,"text-white":e.id===t,"!text-gray-7 !bg-transparent":!r}),onClick(){r&&(e.path?o(e.path):e.url&&e$(e.url))},children:[(0,ec.tZ)(t_,{icon:r?e.icon:n9.gMo,className:" text-2xl inline-block align-middle"}),(0,ec.tZ)("span",{className:"ml-3 align-middle",children:e.text})]},"menu_".concat(n)))}),(0,ec.tZ)(ej,{ref:y,className:ew()("w-[12.8125rem] h-[3.375rem] text-lg self-end mx-auto mb-10",{" hidden":!r}),onClick:p,text:h?"Disconnect":eq(s?i.slice(2):i,6,6)})]}),r?n:(0,ec.BX)("div",{className:"flex-1 flex px-[15%] pt-[30vh] h-full flex-col items-center",children:[(0,ec.tZ)("div",{className:" text-xl text-black text-center",children:at}),(0,ec.tZ)(ej,{text:"Connect Wallet",className:"mt-8",onClick:()=>u(!0)})]}),d&&(0,ec.tZ)(n3,{onClose:()=>u(!1)})]})})});var aa=n(89211),ai=n(69293);let al=eo.memo(function(e){let{text:t,dropData:n,onChange:a,className:i}=e,[l,r]=(0,aa.Z)(!1),s=(0,eo.useRef)();(0,ai.Z)(s,()=>l&&r(!1));let c=e=>{r(!1),a&&a(e)};return(0,ec.BX)("div",{className:"text-black relative",ref:s,children:[(0,ec.tZ)(ej,{className:"btn-173",text:t,onClick:()=>r(!l)}),l&&(0,ec.tZ)("ul",{className:"text-black absolute w-full bg-white mt-3 border-1 border-gray-300 top-10 left-0 p-2 text-sm",children:n&&n.length>0&&n.map((e,t)=>(0,ec.BX)("li",{onClick:()=>c(e.value),className:"h-10 cursor-pointer leading-10 hover:bg-zinc-200 px-2 flex items-center",children:[e.icon&&(0,ec.tZ)(t_,{icon:e.icon,className:"text-sm mr-3"}),e.text]},"dropdown".concat(t)))})]})}),ar=eo.memo(function(e){let{text:t,status:n,className:a}=e;return(0,ec.BX)("div",{className:ew()("flex items-center text-sm text-black border-1 h-14 w-full px-5","success"===n?"border-[#32CB9D] bg-green-50":"border-[#EF4C56] bg-rose-50"),children:[(0,ec.tZ)(t_,{icon:"success"===n?t1.mny:t1.LHV,className:ew()("text-xl mr-3","success"===n?"text-[#32CB9D]":"text-[#EF4C56]")}),(0,ec.tZ)("span",{children:t})]})});function as(){let{store:{currentGateway:e},oUpdate:t}=ex(),n=(0,eo.useMemo)(()=>e||function(){let e=localStorage.getItem("last_gateway"),t=eY.gi.find(t=>t.value===e);return(console.info("last-:",t),t)?t:eY.gi[0]}(),[e]),a=ep(e=>{t({currentGateway:e}),localStorage.setItem("last_gateway",e.value)});return{list:eY.gi,setCurrent:a,current:n}}function ac(e){let{total:t,pgSize:n,pgNum:a,onChange:i,className:l}=e,r=Math.ceil(t/n),s=(0,eo.useMemo)(()=>r<=1?[]:r<=6?eF().range(r).map(e=>({name:"".concat(e+1)})):a<=3?eF().range(a+1).map(e=>({name:"".concat(e+1)})).concat([{name:"..."},{name:""+r}]):a>=r-2?[{name:"1"},{name:"..."}].concat(eF().range(a-2,r).map(e=>({name:"".concat(e+1)}))):(console.log([{name:"1"},{name:"..."},{name:a-1+""},{name:a+""},{name:a+1+""},{name:"..."},{name:r+""}]),[{name:"1"},{name:"..."},{name:a-1+""},{name:a+""},{name:a+1+""},{name:"..."},{name:r+""}]),[r,a]),c=()=>{i&&a{i&&a>1&&i(eF().toNumber(a-1))};return(0,ec.tZ)("div",{className:ew()("flex justify-center text-gray-400 text-sm mt-5",l),children:(0,ec.BX)("div",{className:"flex",children:[r>1&&(0,ec.tZ)("span",{onClick:o,className:"mr-8 cursor-pointer",children:"<"}),s.map((e,t)=>(0,ec.tZ)("div",{className:ew()({"text-black":e.name===""+a,omit:"..."===e.name},"mr-8 cursor-pointer"),onClick(){i&&"..."!==e.name&&i(eF().toNumber(e.name))},children:e.name},"key_page_".concat(t))),r>1&&(0,ec.tZ)("span",{onClick:c,className:"cursor-pointer",children:">"})]})})}var ao=n(40344),ad=n(24762),au=n(20640),am=n.n(au);function ap(e){let t="https://api.crustcloud.io";return eQ.TQ&&(t="https://beta-api.crustcloud.io"),eQ.Cg&&(t="https://test-api.crustcloud.io"),"".concat(t).concat(e)}function ay(e){let t="https://pin.crustcloud.io";return eQ.TQ&&(t="https://beta-pin.crustcloud.io"),eQ.Cg&&(t="https://test-pin.crustcloud.io"),"".concat(t).concat(e)}function ah(e){if(200===e.data.code)return e.data.data;throw{_type:"ResError",...e.data}}var af=n(81338),ag=new af.default.Algodv2(eY.GG,eY.EH);let ab=()=>{let{bucketId:e}=(0,eC.UO)(),t=(0,eC.s0)(),n="\n**Upload**\xa0file with the standard\xa0[IPFS API](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-add)\xa0and get the CID:\n\n~~~bash\ncurl -X POST 'https:///api/v0/add?pin=true' --header 'Authorization: Bearer ' --form 'path=@\"\"'\n~~~\n\n**Pin**\xa0the CID with the standard\xa0[IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec/#operation/addPin):\n\n~~~bash\ncurl -X POST '".concat(ay("/psa/pins"),'\' --header \'Authorization: Bearer \' --data-raw \'{\n "cid": "",\n "name": ""\n}\'\n~~~\n');return(0,ec.BX)(ec.HY,{children:[(0,ec.BX)("div",{className:"sticky top-0 bg-white px-8 pt-16 flex items-center pb-5 mb-2 min-w-[62rem]",children:[(0,ec.tZ)(t_,{icon:n0.QdO,className:"text-xl mr-2"}),(0,ec.tZ)("span",{className:"mr-2 cursor-pointer",onClick(){t("/buckets")},children:"W3Buckets"}),(0,ec.tZ)(t_,{icon:n1.Tfp,className:"mr-2"}),(0,ec.tZ)("span",{children:"W3BUCKET(".concat(e,")")})]}),(0,ec.tZ)("div",{className:"px-8 pb-8 text-lg border-b-8 border-solid border-[#eeeeee] min-w-[62rem]",children:(0,ec.BX)("div",{className:" border border-black-1 border-solid px-8 pt-6 pb-5",children:[(0,ec.tZ)("div",{className:" text-xl font-medium",children:"Guidance on Storage"}),(0,ec.tZ)("div",{className:" my-4",children:"Files can be uploaded and decentralized pinned to IPFS by using this web interface, or by CLI as shown in the curl sample below."}),(0,ec.tZ)(nz,{code:n}),(0,ec.tZ)("div",{className:" mt-8 text-xl font-medium",children:"Get more references"}),(0,ec.BX)("div",{className:" mt-4 flex flex-wrap",children:[(0,ec.tZ)("a",{className:" underline text-black-1 mr-5",target:"_blank",href:"https://docs.crustcloud.io/w3bucket/aboutnft",children:"General Guidance on W3Bucket"}),(0,ec.tZ)("a",{className:" underline text-black-1 mr-5",target:"_blank",href:"https://docs.crustcloud.io/w3bucket/uploadfile",children:"Using APIs and W3Auth"})]})]})})]})},av=e=>new Promise((t,n)=>{let a=localStorage.getItem(e+"_files");a?t(JSON.parse(a)):n()}),ax=(e,t)=>new Promise(n=>{t&&localStorage.setItem(e+"_files",JSON.stringify(t)),n(!0)}),aA=eo.memo(()=>{let{bucketId:e,ipnsId:t}=(0,eC.UO)(),[,n]=(0,eo.useMemo)(()=>e1(e),[e]),a=(0,eo.useRef)(null),i=(0,eo.useRef)(null),[l,r]=(0,eo.useState)({progress:0,status:"stop",errorMsg:""}),[s,c]=(0,eo.useState)(1),[o,d]=(0,eo.useState)(""),[u,m]=(0,eo.useState)(""),[p,y]=(0,eo.useState)([]),h=ta(),[f,g]=(0,eo.useState)(null),[b]=nq("for_upload",!1,1),[v]=n$(),x=(0,eC.s0)(),{address:A}=(0,nJ.mA)(),w=nV.isConnected();(0,eo.useMemo)(()=>{x("/buckets")},[A]),(0,tk.tf)(()=>{av(e).then(e=>{y(e)}).catch(()=>{y([])})}),(0,ao.Z)(async()=>{if(w)try{let e=await ag.accountAssetInformation(nV.account,parseInt(n)).do();e&&e["asset-holding"]&&0!==e["asset-holding"].amount||x("/buckets")}catch(t){console.error(t)}},[n,w]);let{current:Z}=as(),{value:k}=(0,ao.Z)(async()=>{let e=await e9.Z.request({method:"POST",params:{arg:t},url:"".concat(Z.value,"/api/v0/name/resolve")}),n=await e9.Z.request({url:"".concat(Z.value).concat(e.data.Path)});return n.data},[t]),{value:N}=(0,ao.Z)(async()=>{let e=await v(),n=await e9.Z.request({headers:{Authorization:"Bearer ".concat(e)},method:"GET",url:ap("/auth/bucket/".concat(t))});return n.data.data},[t]),{fFiles:T,total:I}=(0,eo.useMemo)(()=>{let e=[];p&&(e=p);let t=eF().filter(e,e=>e.name.indexOf(u.trim())>-1);t=t.sort(function(e,t){return t.createTime-e.createTime});let n=eF().chunk(t,10),a=t.length;return{fFiles:n,total:a}},[u,p]);(0,eo.useEffect)(()=>{ad.Z.rebuild()},[p,T]),(0,eo.useMemo)(()=>{p&&p.length>0&&ax(e,p)},[p]),(0,eo.useMemo)(()=>{if(k&&k.length){if(p){p.map(e=>{for(let t=0;t!t.has(e.cid)&&t.set(e.cid,1)))}else y(k)}},[k]);let C=()=>{a.current.value="",i.current.value=""},B=e=>{let t=e.target.files,a=0;if(!t.length)return!1;let i=!0;for(let l=0;l64){h.error("The file name cannot exceed 64 characters."),C(),i=!1;break}if(N){let{maxStorageSize:s,usedStorageSize:c}=N;if(a>s-c)return h.error("No enough space for this file/folder!"),C(),!1}if(!i)return!1;b(n).then(async e=>{try{let n=0,i=e9.Z.CancelToken.source();g(i),r({progress:0,status:"upload",errorMsg:""});let l=new FormData;if(1===t.length)l.append("file",t[0],t[0].name);else if(t.length>1){for(let s of t)l.append("file",s,s._webkitRelativePath||s.webkitRelativePath);n=1}C();let c=await tt({cancelToken:i.token,data:l,endpoint:Z.value,authBasic:"Bearer ".concat(e),onProgress(e){r({progress:Math.round(99*e),status:"upload",errorMsg:""})}});g(null);let o="",d="";if("string"==typeof c){let u=c.replaceAll("}\n{","},{"),m=JSON.parse("[".concat(u,"]")),h=m.length-1;o=m[h].Hash,d=m[h].Name}else o=c.Hash,d=c.Name;if(!o||!d)return r({progress:0,status:"fail",errorMsg:""}),!1;let f=await e9.Z.request({data:{cid:o,name:d,meta:{gatewayId:1}},cancelToken:i.token,headers:{Authorization:"Bearer ".concat(e)},method:"POST",url:ay("/psa/pins")}),{error:b}=f.data;if(b)return r({progress:0,status:"fail",errorMsg:b.details?b.details:""}),!1;r({progress:100,status:"success",errorMsg:""}),y(p.concat([{name:d,cid:o,fileSize:a,fileType:n,createTime:eJ()().format("X").valueOf(),isNew:!0}]))}catch(v){throw console.error(v),v}}).catch(e=>{console.log(e.toString()),C()})},M=e=>{"file"===e?a.current.click():"folder"===e&&i.current.click()},S=()=>{m(o)},E=e=>{let t=window.event||e;13==t.keyCode&&S()},X=()=>{"upload"===l.status&&f&&(f.cancel("stop"),g(null)),r({progress:0,status:"stop",errorMsg:""})};return(0,ec.BX)(an,{menuId:1,children:[(0,ec.tZ)("div",{className:"flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:"relative",children:[(0,ec.tZ)(ab,{}),(0,ec.BX)("div",{className:"p-8 flex-1 text-lg v-full flex flex-col min-w-[62rem]",children:[(0,ec.BX)("div",{className:"sticky top-[6.5rem] bg-white w-full flex items-center z-10",children:[(0,ec.tZ)(al,{dropData:[{text:"File",icon:n1.tHe,value:"file"},{text:"Folder",icon:n1.QoU,value:"folder"}],text:"Upload",onChange:M}),(0,ec.tZ)("input",{ref:a,type:"file",hidden:!0,onChange:B}),(0,ec.tZ)("input",{ref:i,type:"file",hidden:!0,webkitdirectory:"",directory:!0,onChange:B}),(0,ec.tZ)("span",{className:"ml-5",children:"Thunder Gateway Seattle, US"}),(0,ec.tZ)("div",{className:"flex-1"}),(0,ec.BX)("div",{className:"relative w-1/2 h-12 max-w-sm border-solid border-black-1 border rounded overflow-hidden",children:[(0,ec.tZ)("input",{className:"w-full h-full pl-5 pr-10 active:border-0",onKeyDown:E,onChange:e=>d(e.target.value)}),(0,ec.tZ)(t_,{icon:n1.jRj,className:"text-2xl absolute top-[0.7rem] right-2 cursor-pointer",onClick:S})]})]}),(0,ec.BX)("div",{className:"sticky top-36 bg-white py-4 flex items-center font-medium border-b-1 border-solid border-b-black-1 pt-5",children:[(0,ec.tZ)("div",{className:"flex-initial w-[25%] md:w-[20%] pl-3",children:"File Name"}),(0,ec.tZ)("div",{className:"flex-initial w-[20%] md:w-[25%]",children:"CID"}),(0,ec.tZ)("div",{className:"flex-initial w-[30%]",children:"Link"}),(0,ec.tZ)("div",{className:"flex-initial w-[10%]",children:"File Size"}),(0,ec.tZ)("div",{className:"flex-initial w-[15%]",children:"TimeStamp"})]}),(0,ec.tZ)("div",{className:" text-sm text-gray-6",children:T&&T[s-1]&&T[s-1].map((e,t)=>(0,ec.BX)("div",{className:ew()("flex items-center pt-4 pb-8",e.isNew?"text-gray-300":""),children:[(0,ec.tZ)("div",{className:"flex-initial w-[25%] md:w-[20%] pl-3",children:(0,ec.BX)("div",{className:"flex items-center pr-8",children:[(0,ec.tZ)("span",{className:"truncate","data-tip":e.name.length>20?e.name:"",children:e.name}),1===e.fileType&&(0,ec.tZ)(t_,{className:"ml-2 min-w-[14px]",icon:n1.QoU})]})}),(0,ec.tZ)("div",{className:"flex-initial w-[20%] md:w-[25%]",children:(0,ec.tZ)("span",{"data-tip":e.cid,"data-for":"cidColumn",children:eq(e.cid,10,10)})}),(0,ec.tZ)("div",{className:"flex-initial w-[30%] truncate pr-8","data-for":"linkColumn","data-tip":"".concat(eY.HE,"/ipfs/").concat(e.cid),children:"".concat(eY.HE,"/ipfs/").concat(e.cid)}),(0,ec.tZ)("div",{className:"flex-initial w-[10%]",children:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+e)return"0 B";let n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(t<0?0:t))," ").concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}(e.fileSize)}),(0,ec.tZ)("div",{className:"flex-initial w-[15%] text-gray-6",children:e.isNew?(0,ec.tZ)("span",{"data-tip":"The ".concat(0===e.fileType?"file":"folder"," has been successfully uploaded to your bucket. It takes several minutes to finalize the decentralized storage and IPNS update processes."),children:(0,ec.tZ)(t_,{icon:n0.kjE})}):eJ()(1e3*e.createTime).format("YYYY-MM-DD HH:mm:ss")})]},"files_".concat(t)))}),(0,ec.tZ)(ac,{total:I,pgSize:10,pgNum:s,onChange(e){c(e)}})]})]})}),"stop"!==l.status&&(0,ec.BX)(t0,{children:[(0,ec.tZ)(t$,{title:"Upload File",onClose:X}),(0,ec.BX)("div",{className:"bg-white mt-5 flex py-3 cursor-pointer justify-between items-center h-20",children:["upload"===l.status&&(0,ec.tZ)(eR,{value:l.progress}),"success"===l.status&&(0,ec.tZ)(ar,{text:"Upload successful",status:l.status}),"fail"===l.status&&(0,ec.tZ)(ar,{text:l.errorMsg?l.errorMsg:"Upload fail",status:l.status}),"cancel"===l.status&&(0,ec.tZ)(ar,{text:"Upload cancel",status:"fail"})]})]}),(0,ec.tZ)(ad.Z,{id:"cidColumn",effect:"solid",isCapture:!0,delayHide:250,clickable:!0,getContent:e=>(0,ec.tZ)("div",{className:"flex items-center",children:(0,ec.BX)("div",{className:"inline-block w-[13rem] break-words",children:[e,(0,ec.tZ)(t_,{className:"ml-2 cursor-pointer inline-block",onClick(){am()(e),h.success("copy success")},icon:n1.C3L})]})})}),(0,ec.tZ)(ad.Z,{id:"linkColumn",effect:"solid",isCapture:!0,delayHide:250,clickable:!0,getContent:e=>(0,ec.tZ)("div",{className:"flex items-center",children:(0,ec.BX)("div",{className:"inline-block w-[15rem] break-words",children:[e,(0,ec.tZ)(t_,{className:"ml-2 cursor-pointer inline-block",onClick(){am()(e),h.success("copy success")},icon:n1.C3L})]})})})]})}),aw=eo.memo(e=>{let{text:t="Empty",empty_attr:n={},text_attr:a={},...i}=e;return(0,ec.BX)("div",{...i,className:ew()(i.className,"text-gray-7 flex flex-col items-center"),children:[(0,ec.tZ)(tE,{...n,className:ew()(" text-8xl",null==n?void 0:n.className)}),!!t&&(0,ec.tZ)("div",{...a,className:ew()(" text-2xl",a.className),children:t})]})}),aZ=eo.memo(e=>{var t,n,a,i;let{data:l,className:r}=e,{chain:s}=(0,nJ.LN)(),c=(0,eC.s0)(),o=nV.isConnected(),d=(0,eo.useMemo)(()=>l.maxStorageSize/1024/1024/1024,[l]),u=(0,eo.useMemo)(()=>e4(d),[d]),m=(0,eo.useMemo)(()=>e4(l.usedStorageSize/1024/1024/1024,2),[l]),p=(0,eo.useMemo)(()=>e2(d,l.tokenId),[l,d]),y=()=>{c("/bucket/".concat(p,"/").concat(l.ipnsId))};return(0,ec.BX)("div",{className:ew()("h-min p-5 md:p-2 border border-solid border-black-1",r),children:[(0,ec.tZ)("img",{className:"w-full aspect-[360/531] object-contain",src:e6(l.metadata.image.replace("ipfs://",""))}),(0,ec.tZ)("div",{className:" text-lg font-semibold mt-[0.625rem] truncate",children:"W3BUCKET(".concat(p,")")}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Current Usage"}),(0,ec.BX)("div",{children:[(0,ec.tZ)("span",{className:"text-orange-15",children:m}),"/",u]})]}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Files"}),(0,ec.tZ)("div",{children:"".concat(l.fileCount," Files")})]}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Created"}),(0,ec.tZ)("div",{children:eJ()(1e3*l.mintTimestamp).format("YYYY-MM-DD")})]}),(0,ec.BX)("div",{className:"flex text-xs my-2 justify-between",children:[(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:(t=l.ipnsId,"".concat(eY.gi[0].value,"/ipns/").concat(t)),children:"IPNS Link"}),(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:o?(n=eY.fL,"".concat(eY.sr,"/address/").concat(n)):(a=s.id,i=eY.Jh,"".concat(e3(a),"/address/").concat(i)),children:"View NFT Contract"}),(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:e6(l.metadataCid),children:"View Metadata"})]}),(0,ec.tZ)(ej,{onClick:y,className:"!w-full mt-[2px] text-lg !py-1",text:"Enter W3Bucket"})]})}),ak=eo.memo(()=>{let e=n7(),t=nV.isConnected(),{address:n}=(0,nJ.mA)(),[a]=n$(),{value:i,loading:l}=(0,ao.Z)(async()=>{if((!e||!n)&&!t)return[];let i=await a(),l=await e9.Z.get(ap("/auth/bucket/list"),{headers:{Authorization:"Bearer ".concat(i)}});return ah(l).sort(function(e,t){return t.mintTimestamp-e.mintTimestamp})},[e,t,n]),r=(0,eC.s0)(),s=(0,eo.useCallback)(()=>r("/mint"),[r]);return(0,ec.tZ)(an,{menuId:1,children:(0,ec.BX)("div",{className:"flex-1 h-full overflow-y-auto",children:[(0,ec.BX)("div",{className:"px-8 relative pb-8",children:[(0,ec.BX)("div",{className:"sticky top-0 pt-10 bg-white ",children:[(0,ec.BX)("div",{className:" w-full flex justify-between pb-5 whitespace-nowrap ",children:[(0,ec.BX)("div",{className:" inline-block text-2xl self-center font-medium h-min",children:["Your W3Buckets(",(null==i?void 0:i.length)||0,")"]}),(0,ec.tZ)(ej,{className:"whitespace-nowrap w-max",text:"Mint a New W3Bucket",onClick:s})]}),(0,ec.tZ)("div",{className:"h-5 border-t-1 border-solid border-black-1"})]}),i&&!l&&(0,ec.tZ)("div",{className:ew()("w-full overflow-y-auto gap-5 grid grid-cols-[repeat(auto-fill,_minmax(305px,_1fr))]",i.length<3?"grid-cols-[repeat(auto-fill,_minmax(310px,310px))]":""),children:i.map((e,t)=>(0,ec.tZ)(aZ,{data:e},"bucket_".concat(t)))})]}),!l&&1>(0,eH.size)(i)&&(0,ec.tZ)(aw,{text:"No Buckets",className:" h-[calc(100%_-_11rem)] justify-center"}),l&&(0,ec.tZ)(eN,{className:" h-[calc(100%_-_11rem)] justify-center"})]})})});function aN(e){return(0,ec.tZ)("svg",{width:"1em",height:"1em",viewBox:"0 0 11 9",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,ec.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4496 2.29301C10.8401 1.90248 10.8401 1.26932 10.4496 0.878796C10.0591 0.488271 9.42591 0.488271 9.03538 0.878796L4.08564 5.82854L1.96432 3.70722C1.57379 3.3167 0.940626 3.3167 0.550102 3.70722C0.159577 4.09775 0.159577 4.73091 0.550102 5.12144L3.37853 7.94986C3.76905 8.34039 4.40222 8.34039 4.79274 7.94986L10.4496 2.29301Z"})})}let aT=eo.memo(e=>{let{finish:t,active:n,text:a,type:i}=e;return(0,ec.BX)("div",{className:" flex-1",children:[(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)("div",{className:ew()(" flex-1 h-[2px] ",{"bg-orange-15":(n||t)&&"left"!==i,"bg-gray-16":!(n||t)&&"left"!==i})}),(0,ec.tZ)("div",{className:ew()(" w-4 h-4 rounded-lg bg-white flex items-center justify-center",{" !bg-orange-15":n||t}),children:t?(0,ec.tZ)(aN,{className:"text-xs relative text-white"}):(0,ec.tZ)("div",{className:ew()(" w-2 h-2 rounded bg-gray-16",{" !bg-white":n})})}),(0,ec.tZ)("div",{className:ew()(" flex-1 h-[2px] ",{"bg-orange-15":t&&"right"!==i,"bg-gray-16":!t&&"right"!==i})})]}),(0,ec.tZ)("div",{className:ew()("text-center text-gray-8 mt-2",{" !text-orange-15":n}),children:a})]})}),aI=eo.memo(e=>{let{data:t,current:n}=e;return(0,ec.tZ)("div",{className:" flex",children:t.map((e,a)=>(0,ec.tZ)(aT,{text:e,type:0===a?"left":a===t.length-1?"right":"mid",finish:a{n?t({mintData:aC}):t(t=>{let{mintData:n}=t;return{mintData:{...n||aC,..."function"==typeof e?e(n):e}}})},[t]);return(0,eo.useMemo)(()=>[e,n],[e,n])}function aM(e){return e.map(e=>e.fmtPrice+" "+e.symbol).join(" or ")}let aS=eo.memo(e=>{let{editions:t,onNext:n}=e,{chain:a}=(0,nJ.LN)(),i=a&&a.id;nV.isConnected()&&(i=eY.pg);let[l,r]=aB();(0,eo.useEffect)(()=>{void 0===l.editionId&&t.length&&r({chainId:i,editionId:t[0].id,price:t[0].prices[0]})},[l,r,t]);let s=l.editionId,c=(0,eo.useMemo)(()=>t.find(e=>e.id===s),[t,s]);return(0,ec.BX)("div",{className:" px-10 pt-9",children:[(0,ec.BX)("div",{className:" text-2xl",children:["Now you are starting to mint a new W3Bucket!",(0,ec.tZ)("br",{}),"First, choose your preferred bucket type:"]}),(0,ec.tZ)(ej,{text:"W3Bucket",disHover:!0,className:" !border-2 !border-orange-15 !text-orange-15 text-2xl py-[9px] !w-[11.25rem] mt-5"}),(0,ec.tZ)("div",{className:" text-2xl mt-12",children:"Select your preferred bucket size:"}),(0,ec.tZ)("div",{className:"flex items-center mt-5",children:t.map((e,t)=>(0,ec.BX)("div",{className:ew()("mr-4 text-center"),children:[(0,ec.tZ)(ej,{text:e4(e.capacityInGb),disHover:e.id===s,className:ew()(" font-medium !border-2 text-2xl mt-5 !w-[11.25rem] py-[9px] cursor-pointer",{"!border-orange-15 !text-orange-15":e.id===s}),onClick(){r({chainId:i,editionId:e.id,price:e.prices[0]})}}),(0,ec.tZ)("span",{className:" whitespace-nowrap text-sm mt-2 font-light",children:"".concat(aM(e.prices))})]},"editions_".concat(t)))}),c&&(0,ec.BX)("div",{className:" text-2xl mt-12",children:["Your W3Bucket NFT to be minted:"," ",(0,ec.tZ)("span",{className:" text-orange-15",children:"W3Bucket"}),","," ",(0,ec.tZ)("span",{className:" text-orange-15",children:e4(c.capacityInGb)}),(0,ec.tZ)("br",{}),"Payable: ",aM(c.prices)]}),(0,ec.tZ)(ej,{text:"Next Step",className:"mt-12 text-lg !w-[11.25rem] !h-[3.375rem]",onClick(){console.info("click:"),n()},disabled:!c})]})});var aE=n(61501);let aX=["A-b1","A1","A2"],aO=eo.memo(e=>{let{type:t,value:n,...a}=e;return n?(0,ec.BX)("div",{...a,children:["A1"===t&&(0,ec.tZ)(aE.QRNormal,{value:n}),"A2"===t&&(0,ec.tZ)(aE.QRNormal,{value:n,type:"round",posType:"round"}),"A3"===t&&(0,ec.tZ)(aE.QRNormal,{value:n,type:"rand",posType:"planet"}),"A-a1"===t&&(0,ec.tZ)(aE.QRLine,{value:n,direction:"h-v",posType:"roundRect"}),"A-a2"===t&&(0,ec.tZ)(aE.QRLine,{value:n,direction:"cross",posType:"rect"}),"A-b1"===t&&(0,ec.tZ)(aE.QRFunc,{value:n,type:"round",posType:"round"}),"A-b2"===t&&(0,ec.tZ)(aE.QRFunc,{value:n,type:"round",posType:"round",funcType:"B"}),"C1"===t&&(0,ec.tZ)(aE.QRImage,{value:n,size:150}),"C2"===t&&(0,ec.tZ)(aE.QRResImage,{value:n,alignType:"bw",timingType:"bw"}),"SP-1"===t&&(0,ec.tZ)(aE.QRDsj,{value:n}),"SP-2"===t&&(0,ec.tZ)(aE.QRRandRect,{value:n}),"SP-3"===t&&(0,ec.tZ)(aE.QRBubble,{value:n})]}):null}),aj={gray:["#EEEEEE","#FFFFFF","#131521"],yellow:["#FFDC5E","#E9C132","#131521"],red:["#FF6B81","#F4526A","#131521"],purple:["#B073EF","#925DC8","#FFFFFF"],green:["#27C282","#1EA966","#FFFFFF"],blue:["#58AEFF","#3895EB","#FFFFFF"]},aP=eo.memo(eo.forwardRef((e,t)=>{let{size:n}=e,[{color:a,qrcode:i,ipns:l}]=aB(),[r,s,c]=aj[a];return(0,ec.BX)("div",{ref:t,id:"generate_bucket_image",className:" w-[22.5rem] h-[33.1875rem] relative p-6 flex flex-col justify-between",style:{backgroundColor:r},children:[(0,ec.BX)("div",{className:"flex items-center",style:{color:c},children:[(0,ec.tZ)("div",{className:"p-[3px] overflow-hidden rounded-xl",style:{backgroundColor:s},children:(0,ec.tZ)(tE,{style:{fontSize:"2.1875rem"}})}),(0,ec.tZ)("span",{className:" font-Roboto text-3xl font-medium ml-[0.625rem]",children:"W3BUCKET"})]}),l?(0,ec.tZ)(n0.gHS,{className:" text-[18.75rem]",style:{color:s}}):(0,ec.tZ)(n0.QdO,{className:" text-[18.75rem]",style:{color:s}}),(0,ec.tZ)("div",{className:" font-bold text-end",style:{color:c},children:e4(n)}),(0,ec.tZ)(aO,{value:l,type:i,className:" w-[11.5rem] h-[11.5rem] absolute left-[5rem] bottom-[7.4rem]"})]})}));var aW=n(46293),aL=n(48764).Buffer;function aR(e){let{ipns:t,onContinue:n}=e,[a,i]=(0,eo.useState)(!1);return(0,ec.BX)("div",{className:"pl-12 flex-1 break-words",children:[(0,ec.BX)("div",{className:"p-8 border-solid border-black-1 border flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-xl mb-4",children:"Tip:"}),(0,ec.BX)("div",{className:"text-lg",children:["This is the QR Code of the"," ",(0,ec.tZ)("span",{className:"font-semibold",children:"IPNS name"})," for this W3Bucket. This IPNS name is a ",(0,ec.tZ)("span",{className:"font-semibold",children:"unique"})," and"," ",(0,ec.tZ)("span",{className:"font-semibold",children:"immutable"})," identifier on IPFS that ",(0,ec.tZ)("span",{className:"font-semibold",children:"permanently"})," points to the storage history (a .json file, also acts as the list of the bucket storage) of this W3Bucket."]}),(0,ec.tZ)("div",{className:"text-lg mt-7",children:"You can always fetch the storage history via any IPFS gateway or IPFS node."}),(0,ec.tZ)(ej,{text:"Got it",className:" mt-8 !w-[8.25rem] h-11 self-center",onClick:()=>i(!0)})]}),a&&(0,ec.BX)("div",{className:" mt-10 text-lg flex flex-col",children:[(0,ec.tZ)("div",{className:" break-all text-center",children:t}),(0,ec.tZ)("div",{className:" font-medium text-center",children:"The IPNS name for this W3Bucket has successfully generated and published to IPFS."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-6 !w-[8.25rem] h-11 self-center",onClick:n})]})]})}function aY(e){let t=eF().keys(aj),{onContinue:n}=e,[a,i]=aB();return(0,ec.BX)("div",{className:"px-20 flex-1 flex flex-col justify-center",children:[(0,ec.BX)("div",{className:"flex",children:[(0,ec.tZ)("div",{className:" whitespace-nowrap mr-10 mt-3",children:"Background Color"}),(0,ec.tZ)("div",{className:" flex flex-wrap items-center",children:t.map(e=>(0,ec.tZ)("div",{style:{backgroundColor:aj[e][0]},onClick:()=>i({color:e}),className:ew()("rounded-xl w-5 h-5 overflow-hidden cursor-pointer mr-[1.875rem] my-4",{"border-solid border-orange-15 border":a.color===e})},"mint_colors_".concat(e)))})]}),(0,ec.BX)("div",{className:"flex mt-8",children:[(0,ec.tZ)("div",{className:" mr-16 whitespace-nowrap",children:"QR Code Style"}),(0,ec.tZ)("div",{className:"flex items-center flex-wrap",children:aX.map(e=>(0,ec.tZ)("span",{onClick:()=>i({qrcode:e}),className:ew()(" whitespace-nowrap rounded-md px-2 py-1 overflow-hidden cursor-pointer mr-[1rem] bg-slate-50",{"border-solid border-orange-15 border":a.qrcode===e}),children:e},"mint_colors_".concat(e)))})]}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-16 !w-[11.25rem] !py-3 self-center",onClick:n})]})}function aD(e){let{data:[t,n]}=e;return(0,ec.BX)(ec.HY,{children:[(0,ec.BX)("div",{className:" text-sm mt-4",children:[t,":"]}),(0,ec.tZ)("div",{className:" text-sm text-gray-7",children:n})]})}function az(e){let{onContinue:t}=e,[n,a]=aB(),[i,l]=em(!1),[r]=n_(),[,s]=ey(),c=ed(),o=ep(async()=>{i||s(async()=>{try{l(!0),await e5(100);let e=document.getElementById("generate_bucket_image");if(!e)return l(!1);let t=await r(),i=await (0,aW.SE)(e),s=new FormData;s.append("file",i,"bucket_image.png");let o=await tt({data:s}),d=await i.arrayBuffer(),u=aL.from(d),m=e7(u);await tn(o.Hash,"bucket_image.png");let p=await e9.Z.post(ap("/auth/bucket/metadata/generate"),{uuid:n.uuid,cid:o.Hash,imageIntegrity:m},{headers:{Authorization:"Bearer ".concat(t)}}),y="success"===p.data.message;if(!y)throw p.data.message;let h=null;for(;c.safe&&(await e5(1e4),!(h=await e9.Z.get(ap("/auth/bucket/uuid/".concat(n.uuid)),{headers:{Authorization:"Bearer ".concat(t)}}).then(ah).catch(()=>null))||!h.metadataTxHash););if(!c.safe)return;a({metadata:h.metadata,metadataCID:h.metadataCid,metadataTX:h.metadataTxHash})}catch(f){console.error(f)}l(!1)})}),[d,u]=em(!1);return(0,ec.BX)(ec.HY,{children:[!n.metadata&&!i&&(0,ec.BX)("div",{className:"px-12 flex-1 flex flex-col items-center justify-center",children:[(0,ec.tZ)("div",{className:" text-2xl text-center",children:"The metadata file (including this profile image) for your W3Bucket NFT has been fully generated. Click the Continue button to process decentralized storage for the metadata."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-8 !w-[11.25rem] !py-3 self-center",onClick:o})]}),i&&(0,ec.tZ)(eN,{className:"px-12 flex-1 justify-center",text:"The NFT metadata is being decentralized stored and it will be the very first file stored in this W3Bucket! Please wait..."}),n.metadata&&!i&&(0,ec.BX)("div",{className:"px-12 flex-1 flex flex-col items-center",children:[(0,ec.BX)("div",{className:"p-8 w-full border-solid border-black-1 border flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-xl mb-4",children:"Tip:"}),(0,ec.BX)("div",{className:"flex",children:[(0,ec.BX)("div",{className:"flex-1 mr-8",children:[(0,ec.tZ)("div",{className:"font-semibold text-lg",children:"NFT Metadata.json file"}),(0,ec.tZ)(aD,{data:["IPFS CID",eq(n.metadataCID,10,10)]}),(0,ec.tZ)(aD,{data:["Crust Network Storage Order TXID",eq(n.metadataTX,10,10)]}),(0,ec.tZ)(aD,{data:["IPNS",eq(n.ipns,10,10)]}),(0,ec.tZ)(aD,{data:["Storage Protocol","Crust"]})]}),(0,ec.BX)("div",{className:"flex-1",children:[(0,ec.tZ)("div",{className:"font-semibold text-lg",children:"NFT profile image"}),(0,ec.tZ)(aD,{data:["IPFS CID",eq(n.metadata.image.replace("ipfs://",""),10,10)]}),(0,ec.tZ)(aD,{data:["Crust Network Storage Order TXID",eq(n.metadata.dStorage.dstorage_note,10,10)]}),(0,ec.tZ)("div",{className:" text-sm font-medium mt-6",children:"You can check them later in the W3Bucket description information."}),(0,ec.tZ)(ej,{text:"Got it",className:" mt-3 !w-[8.25rem] h-11 self-center",onClick:()=>u(!0)})]})]})]}),d&&(0,ec.BX)("div",{className:" mt-10 text-lg flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-center",children:"Congrats! The metadata of this W3Bucket is fully processed. You will soon get this truly Web3 storage bucket NFT! Click the Continue button to the last step."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-6 !w-[8.25rem] h-11 self-center",onClick:()=>t()})]})]})]})}let aG=eo.memo(e=>{let{editions:t,onNext:n}=e,[a,i]=aB(),l=a.editionId,r=(0,eo.useMemo)(()=>t.find(e=>e.id===l)||t[0],[t,l]),[s,c]=em(0),o=(0,eo.useCallback)(()=>c(e=>e+1),[c]),d=a.ipns,[u]=n_(),[,m]=ey();return(0,eo.useEffect)(()=>{d?a.metadataTX?c(3):d&&c(e=>0===e?1:e):m(()=>u().then(e=>e9.Z.post(ap("/auth/ipns/gen"),{bucketInfo:JSON.stringify({chainId:a.chainId,editionId:a.editionId})},{headers:{Authorization:"Bearer ".concat(e)}}).then(ah)).then(e=>{i({ipns:e.ipnsId,uuid:e.uuid}),c(1)}).catch(e=>{console.info("error:",e),n(-1)}))},[d,a]),(0,ec.BX)("div",{className:" px-10 pt-9 flex",children:[(0,ec.tZ)(aP,{size:r.capacityInGb}),0===s&&(0,ec.tZ)(eN,{className:" self-center text-center p-9",text:"Generating a unique IPNS name for this W3Bucket... Please wait."}),1===s&&(0,ec.tZ)(aR,{ipns:d,onContinue:o}),2===s&&(0,ec.tZ)(aY,{onContinue:o}),3===s&&(0,ec.tZ)(az,{onContinue:n})]})});function aH(){let e=(0,nJ.yL)(),{data:t}=(0,nJ.mx)();return(0,nJ.cq)({address:eY.Jh,abi:n8,signerOrProvider:t||e})}var aF=n(61744),aU=n(2984),aJ=JSON.parse('{"name":"W3Bucket","methods":[{"name":"create","args":[],"returns":{"type":"void"}},{"name":"bootstrap","args":[{"type":"pay","name":"seed"}],"returns":{"type":"void"}},{"name":"set_bucket_edition","args":[{"type":"(uint64,uint64,uint64)","name":"edition"}],"returns":{"type":"void"}},{"name":"get_bucket_edition_ids","args":[],"returns":{"type":"string"}},{"name":"is_active_bucket_edition","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"bool"}},{"name":"get_bucket_edition","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"(uint64,bool,uint64,uint64,uint64)"}},{"name":"disable_bucket_edition","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"void"}},{"name":"enable_bucket_edition","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"void"}},{"name":"set_bucket_edition_prices","args":[{"type":"uint64","name":"edition_id"},{"type":"(uint64,uint64)[]","name":"prices"}],"returns":{"type":"void"}},{"name":"get_bucket_edition_prices","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"(uint64,uint64)[]"}},{"name":"mint","args":[{"type":"txn","name":"seed"},{"type":"uint64","name":"edition_id"},{"type":"string","name":"metadata_hash"},{"type":"string","name":"uri"}],"returns":{"type":"uint64"}},{"name":"claim","args":[{"type":"asset","name":"token"}],"returns":{"type":"void"}}],"networks":{},"desc":"This is web3 bucket contract used to apply storage"}');function aQ(e){let{data:[t,n,a],target:i="_blank"}=e;return(0,ec.BX)("div",{className:" flex items-center text-2xl",children:[(0,ec.BX)("div",{className:" mr-2",children:[t,":"]}),a?(0,ec.tZ)("a",{className:" underline underline-offset-2 !text-black-1",target:i,href:a,children:n}):(0,ec.tZ)("div",{className:" underline underline-offset-2",children:n})]})}let aV=eo.memo(e=>{var t,n,a,i;let{editions:l,onNext:r}=e,{chain:s}=(0,nJ.LN)(),c=s&&s.id,[o,d]=aB(),u=o.editionId,m=(0,eo.useMemo)(()=>l.find(e=>e.id===u),[l,u]),[p,y]=em(!1),h=aH(),{data:f}=(0,nJ.mx)(),{address:g}=(0,nJ.mA)(),[b]=n_(),v=ed(),x=nV.isConnected(),A=ep(async()=>{if(!p&&x&&o.price&&o.editionId){y(!0);try{var e;let t=new af.default.ABIContract(aJ),n=await ag.getTransactionParams().do();n.flatFee=!0,n.fee=2e3;let a=(e=nV.wallet,async(t,n)=>{let a=eH.map(n,e=>({txn:t[e]})),i=await e.signTransaction([a]);return Promise.resolve(i)}),i=aF.parseUnits(o.price.fmtPrice,o.price.decimals),l="0x0"===o.price.currency?af.default.makePaymentTxnWithSuggestedParamsFromObject({from:nV.account,to:eY.fL,amount:BigInt(i.toString()),suggestedParams:n}):af.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:nV.account,to:eY.fL,suggestedParams:n,assetIndex:Number(o.price.currency.slice(2)),amount:BigInt(i.toString())}),s=[];s.push({appIndex:eY.PD,name:af.default.encodeUint64(o.editionId)});let c={appID:eY.PD,method:t.getMethodByName("mint"),methodArgs:[{txn:l,signer:a},o.editionId,e7(o.metadata),"ipfs://".concat(o.metadataCID,"#arc3")],sender:nV.account,signer:a,boxes:s,suggestedParams:n};"0x0"!==o.price.currency&&Object.assign(c,{assets:[parseInt(o.price.currency.slice(2))]});let u=new af.default.AtomicTransactionComposer;u.addMethodCall(c);let m=await u.execute(ag,4),A=Number(m.methodResults[0].returnValue);console.log("Minted bucket token_id:".concat(A));let w=af.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:nV.account,to:nV.account,suggestedParams:n,assetIndex:A,amount:0}),Z=new af.default.AtomicTransactionComposer;Z.addTransaction({txn:w,signer:a}),Z.addMethodCall({appID:eY.PD,method:t.getMethodByName("claim"),methodArgs:[A],sender:nV.account,signer:a,suggestedParams:n}),await Z.execute(ag,4)}catch(k){console.log(k);return}}else{if(p||!h||!g||!o.price||!o.editionId||!f)return;y(!0);let N=aF.parseUnits(o.price.fmtPrice,o.price.decimals);try{let T="0x0000000000000000000000000000000000000000"===o.price.currency,I=null;if(T)I=await h.mint(g,aF.parseUnits(o.editionId+"",0),o.price.currency,"ipfs://".concat(o.metadataCID),{value:N});else{let C=(0,aU.uN)({address:o.price.currency,abi:aU.em,signerOrProvider:f}),B=await h.estimateGas.mint(g,aF.parseUnits(o.editionId+"",0),o.price.currency,"ipfs://".concat(o.metadataCID)).catch(()=>aF.parseUnits("396277",0));await C.approve(eY.Jh,N),I=await h.mint(g,aF.parseUnits(o.editionId+"",0),o.price.currency,"ipfs://".concat(o.metadataCID),{gasLimit:B})}await I.wait(1)}catch(M){console.error(M);return}}try{let S=await b(),E=null;for(;;){if(!v.safe)return;if((E=await e9.Z.get(ap("/auth/bucket/uuid/".concat(o.uuid)),{headers:{Authorization:"Bearer ".concat(S)}}).then(ah).catch(()=>null))&&E.tokenId&&E.mintTxHash)break;await e5(1e4)}d({mintTx:E.mintTxHash,tokenId:E.tokenId}),r()}catch(X){console.error(X)}y(!1)}),w=(0,eC.s0)(),Z=ep(()=>{d({},!0),w("/buckets")}),k=(0,eo.useMemo)(()=>o.mintTx&&m&&o.tokenId?e2(m.capacityInGb,o.tokenId):"",[o,m]);return(0,ec.BX)("div",{className:" px-10 pt-9 flex",children:[(0,ec.tZ)(aP,{size:m.capacityInGb}),!p&&!o.mintTx&&(0,ec.BX)("div",{className:"flex flex-1 px-12 flex-col items-center justify-center",children:[(0,ec.tZ)("div",{className:" text-2xl text-center",children:"Choose your preferred payment method and click the ‘Confirm and Pay’ button to proceed:"}),(0,ec.tZ)("div",{className:" flex ",children:m.prices.map((e,t)=>{var n,a;return(0,ec.BX)("div",{className:ew()("mr-4 text-center"),children:[(0,ec.tZ)(ej,{text:e.symbol,disHover:e.currency===(null===(n=o.price)||void 0===n?void 0:n.currency),className:ew()("font-medium !border-2 text-2xl mt-5 !w-[11.25rem] !py-[9px] cursor-pointer",{"!border-orange-15 !text-orange-15":e.currency===(null===(a=o.price)||void 0===a?void 0:a.currency)}),onClick(){d({price:e})}}),(0,ec.tZ)("span",{className:" text-sm mt-2 font-light whitespace-nowrap",children:"".concat(e.fmtPrice," ").concat(e.symbol," payable in 15 min")})]},"edition_price_".concat(t))})}),(0,ec.tZ)(ej,{text:"Confirm and Pay",className:"mt-12 text-lg w-48 h-[3.375rem]",onClick:A})]}),p&&(0,ec.tZ)(eN,{className:"flex-1 px-12 justify-center",text:"Payment Tx sent, please wait for a while to get on-chain confirmation..."}),!p&&o.mintTx&&(0,ec.BX)("div",{className:"flex flex-1 px-12 flex-col ",children:[(0,ec.BX)("div",{className:" text-2xl font-medium mb-8",children:["Congrats,",(0,ec.tZ)("br",{}),"You have completed all the minting processes for this W3Bucket NFT!"]}),(0,ec.tZ)(aQ,{data:["W3Bucket NFT Token ID",o.tokenId,x?(t=o.tokenId,"".concat(eY.sr,"/asset/").concat(t)):(n=o.tokenId,"".concat(e3(c),"/token/").concat(eY.Jh,"?a=").concat(n))]}),(0,ec.tZ)(aQ,{data:["Mint TX ID",eq(o.mintTx,9,5),x?(a=o.mintTx,"".concat(eY.sr,"/tx/").concat(a)):(i=o.mintTx,"".concat(e3(c),"/tx/").concat(i))]}),(0,ec.tZ)(aQ,{target:"_self",data:["W3Bucket Identifier",k,"/#/bucket/".concat(k,"/").concat(o.ipns)]}),(0,ec.tZ)("div",{className:" text-2xl font-medium mt-8",children:"Return to the W3Bucket Home Page and start your Crust Cloud journey. Bon Voyage!"}),(0,ec.tZ)(ej,{text:"Complete",className:" self-center text-lg !w-[11.25rem] h-[3.375rem] mt-20",onClick:Z})]})]})});var aK=n(48764).Buffer,aq=new class{async getEditionNum(){var e;return null!==(e=this.getApplicationGlobalValue("edition_num","string"))&&void 0!==e?e:0}async getEditionIds(){let e=await this.getApplicationBoxByName("edition_ids","string"),t=af.default.ABIType.from("uint64[30]");return t.decode(e.value).map(e=>Number(e))}async getEditionById(e){let t=af.default.ABIType.from("uint64"),n=t.encode(e),a=await this.client.getApplicationBoxByName(eY.PD,n).do(),i=af.default.ABIType.from("(uint64,uint64,uint64,bool,uint8[".concat(a.value.length-25,"])")),l=i.decode(a.value),r=l[3];if(!r)return null;let s=l[l.length-1],c=s.map(e=>Number(e)),o=af.default.ABIType.from("(uint64,uint64)[]"),d=o.decode(c),u=[];return d.map(e=>{u.push({currency:e[0].toString(),price:e[1].toString()})}),{id:e,maxMintableSupply:l[0],capacityInGigabytes:l[1],currentSupplyMinted:l[2],prices:u}}async getApplicationGlobalValue(e,t){let n=await this.client.getApplicationByID(eY.PD).do(),a=af.default.ABIType.from(t),i=a.encode(e).slice(-e.length),l=aK.from(i).toString("base64");for(let r of n.params["global-state"])if(r.key===l)return r.value.uint;return null}getApplicationBoxByName(e,t){let n=af.default.ABIType.from(t),a=n.encode(e).slice(-e.length);return this.client.getApplicationBoxByName(eY.PD,a).do()}constructor(){this.client=new af.default.Algodv2(eY.GG,eY.EH)}};async function a_(){let e=await aq.getEditionNum(),t=await aq.getEditionIds();console.info("edition num:".concat(e,",edition ids:").concat(t));let n=[];for(let a=0;a=1&&n.push({id:l.id,capacityInGb:Number(l.capacityInGigabytes),totalSupply:Number(l.maxMintableSupply),minted:Number(l.currentSupplyMinted),prices:r})}return console.info("editions:",n),n}let a$=eo.memo(()=>{let{value:e,loading:t}=function(){let e=aH(),{chain:t}=(0,nJ.LN)(),n=t&&t.id,{data:a}=(0,nJ.mx)(),i=nV.isConnected(),l=(0,ao.Z)(async()=>{if(e&&n&&a){let t=await e.getBucketEditions(!0);console.info("data:",t);let l=[];for(let r of t){if(r.maxMintableSupply.lte(r.currentSupplyMinted))continue;let s=await e.getBucketEditionPrices(r.editionId);console.info("prices:",s);let c=[];for(let o of s){let d=18,u="ETH";if("0x0000000000000000000000000000000000000000"!==o.currency){let m=(0,aU.uN)({address:o.currency,abi:aU.em,signerOrProvider:a});d=await m.decimals(),u=await m.symbol()}c.push({currency:o.currency,symbol:u,decimals:d,price:o.price.toString(),fmtPrice:aF.formatUnits(o.price,d)})}c.length>=1&&l.push({id:r.editionId.toNumber(),capacityInGb:r.capacityInGigabytes.toNumber(),totalSupply:r.maxMintableSupply.toNumber(),minted:r.currentSupplyMinted.toNumber(),prices:c})}return console.info("editions:",l),l}return i?a_():null},[e,n,a,i]);return(0,eo.useMemo)(()=>({...l,loading:l.loading}),[l])}(),n=(0,eC.s0)(),a=(0,eo.useMemo)(()=>["1.Select your preferred bucket","2.Process NFT metadata","3.Make payment and mint"],[]),[i,l]=em(-1),[r,s]=aB(),[c]=n_();(0,eo.useEffect)(()=>{let e=async()=>{try{if(console.info("do taks:"),!r.uuid)return l(0);let e=await c(),t=await e9.Z.get(ap("/auth/bucket/uuid/".concat(r.uuid)),{headers:{Authorization:"Bearer ".concat(e)}}).then(ah),n=r.editionId;if(t.metadata){let a=t.metadata.attributes.find(e=>"Edition"===e.trait_type);a&&(n=new Number(a.value).valueOf())}s({metadata:t.metadata,ipns:t.ipnsId,metadataTX:t.metadataTxHash,metadataCID:t.metadataCid,mintTx:t.mintTxHash,tokenId:t.tokenId,editionId:n}),t.mintTxHash?l(2):t.metadataTxHash?l(1):l(0)}catch(i){l(0)}};return e(),()=>{s({},!0)}},[]);let o=(0,eo.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return l(t=>t+e)},[l]),{address:d}=(0,nJ.mA)();return(0,eo.useEffect)(()=>{d&&(s({},!0),l(0))},[d]),(0,ec.tZ)(an,{menuId:1,children:(0,ec.tZ)("div",{className:" flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:" relative px-8 pb-10",children:[(0,ec.BX)("div",{className:" sticky top-0 z-10 bg-white pt-16 pb-3",children:[(0,ec.tZ)("div",{className:"inline-block",onClick(){s({},!0),n("/buckets")},children:(0,ec.BX)("div",{className:"flex items-center cursor-pointer",children:[(0,ec.tZ)(t_,{icon:"cru-fo-chevron-left",className:" mr-3"}),(0,ec.tZ)("span",{children:"Exit Mint Process"})]})}),(0,ec.tZ)("div",{className:"h-px bg-black-1 my-7"}),(0,ec.tZ)(aI,{data:a,current:i})]}),e&&(0,ec.BX)(ec.HY,{children:[0===i&&!t&&(0,ec.tZ)(aS,{editions:e,onNext:o}),1===i&&(0,ec.tZ)(aG,{editions:e,onNext:o}),i>=2&&(0,ec.tZ)(aV,{editions:e,onNext:o})]}),(t||i<0)&&(0,ec.tZ)(eN,{className:" text-black-1 justify-center h-[calc(100vh_-_17.75rem)]"})]})})})}),a0=eo.memo(e=>{let{options:t,current:n,perfix:a,className:i,onOptionChange:l,...r}=e,s=(0,eo.useMemo)(()=>a?"".concat(a," ").concat(n.text):n.text,[n,a]),c=(0,eo.useRef)(),[o,d]=(0,aa.Z)(!1);return(0,ai.Z)(c,()=>o&&d(!1)),(0,ec.BX)("div",{...r,ref:c,className:ew()(i," relative text-gray-7"),children:[(0,ec.BX)("div",{className:" whitespace-nowrap cursor-pointer flex items-center",onClick:d,children:[s," ",(0,ec.tZ)("span",{className:"cru-fo-chevron-down ml-3"})]}),o&&(0,ec.tZ)("div",{className:" absolute top-full right-0 shadow-md bg-white z-10",children:t.map((e,t)=>(0,ec.tZ)("div",{className:ew()(" py-[8px] px-4 whitespace-nowrap cursor-pointer",{"bg-black-1 text-white":e===n}),onClick(){l&&l(e),d(!1)},children:e.text},"options_".concat(t)))})]})}),a1=eo.memo(()=>{let{list:e,current:t,setCurrent:n}=as(),a=(0,eo.useMemo)(()=>e.map(e=>({...e,text:"".concat(e.name," ").concat(e.location)})),[e]),i=(0,eo.useMemo)(()=>[{text:"Random"}],[]),[l,r]=(0,eo.useState)(()=>a.find(e=>e.value===t.value)),s=ep(t=>{r(t),n(e.find(e=>e.value===t.value))}),[c,o]=(0,eo.useState)(i[0]);return(0,ec.tZ)(an,{menuId:2,children:(0,ec.tZ)("div",{className:"flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:" m-8 px-8 py-[1.5625rem] border-solid border-black-1 border min-w-[35rem]",children:[(0,ec.tZ)("div",{className:" font-medium text-xl",children:"Preferences"}),(0,ec.BX)("div",{className:" mt-4 whitespace-nowrap flex items-center",children:[(0,ec.tZ)("span",{className:"font-medium text-lg",children:"Choose preferred gateway :"}),(0,ec.tZ)(a0,{className:" ml-2",options:a,current:l,onOptionChange:s})]}),(0,ec.BX)("div",{className:" mt-4 whitespace-nowrap flex items-center",children:[(0,ec.tZ)("span",{className:"font-medium text-lg",children:"Gateway Match Strategy :"}),(0,ec.tZ)(a0,{className:" ml-2",options:i,current:c,onOptionChange:o})]})]})})})});function a2(){let{store:e,update:t}=ex(),n=e.toasts||[];return(0,eo.useEffect)(()=>{let e=setInterval(()=>{t(()=>(n.shift(),{toasts:n}))},3e3);return()=>clearInterval(e)},[n]),(0,ec.tZ)("div",{className:"fixed top-5 right-5 z-[50]",children:n.map((e,t)=>(0,ec.tZ)("div",{className:"flex py-2 cursor-pointer justify-between items-center",children:(0,ec.tZ)(ar,{text:e.msg,status:e.type})},"toasts".concat(t)))})}var a5=eo.memo(function(){let e=ev();return(0,ec.tZ)(eg,{value:e,children:(0,ec.BX)("div",{className:"App relative",id:"app-root",children:[(0,ec.tZ)(ad.Z,{effect:"solid",clickable:!0,delayHide:200,isCapture:!0,overridePosition(e,t,n,a){let{top:i,left:l}=e;return a.style.maxWidth="300px",a.style.wordBreak="break-all",{top:i,left:l}}}),(0,ec.tZ)("div",{className:"App overflow-y-auto",children:(0,ec.tZ)(eI.UT,{children:(0,ec.BX)(eC.Z5,{children:[(0,ec.tZ)(eC.AW,{path:"/",element:(0,ec.tZ)(nU,{})}),(0,ec.tZ)(eC.AW,{path:"/buckets",element:(0,ec.tZ)(ak,{})}),(0,ec.tZ)(eC.AW,{path:"/bucket/:bucketId/:ipnsId",element:(0,ec.tZ)(aA,{})}),(0,ec.tZ)(eC.AW,{path:"/settings",element:(0,ec.tZ)(a1,{})}),(0,ec.tZ)(eC.AW,{path:"/mint",element:(0,ec.tZ)(a$,{})})]})})}),(0,ec.tZ)(eT,{}),(0,ec.tZ)(a2,{})]})})})},36563:function(){},53555:function(){}}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[424],{39547:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return a5}});var a,i,l,r,s,c,o,d,u,m,p,y,h,f,g,b,v,x,A,w,Z,k,N,T,I,C,B,M,S,E,X,O,j,P,W,L,R,Y,D,z,G,H,F,U,J,Q,V,K,q,_,$,ee,et,en,ea,ei,el,er,es,ec=n(35944),eo=n(67294);let ed=()=>{let e=(0,eo.useRef)({safe:!0});return(0,eo.useEffect)(()=>(e.current.safe=!0,()=>{e.current.safe=!1}),[]),e.current};function eu(){for(var e=arguments.length,t=Array(e),n=0;nt.map(e=>t=>{a.safe&&e(t)}),[t])}function em(e){let[t,n]=(0,eo.useState)(e),[a]=eu(n);return[t,a]}function ep(e){let t=(0,eo.useRef)(null);return(0,eo.useLayoutEffect)(()=>(t.current=e,()=>{})),(0,eo.useCallback)(function(){for(var e=arguments.length,n=Array(e),a=0;a{e.current||(e.current=!0,t().then(()=>{e.current=!1}))},[]);return[e,t]}let eh={loading:!1},ef=eo.createContext({update(){},oUpdate(){},store:eh}),eg=ef.Provider,eb=(e,t,n)=>{},ev=()=>{let[e,t]=(0,eo.useState)(eh),n=(0,eo.useCallback)(e=>{"function"==typeof e?t(t=>{let n=e(t),a={...t,...n};return eb(n,t,a),a}):t(t=>{let n={...t,...e};return eb(e,t,n),n})},[]);return{store:e,update:n,oUpdate:n}},ex=()=>{let{store:e,update:t}=(0,eo.useContext)(ef),[n]=eu(t);return(0,eo.useMemo)(()=>({store:e,update:n,oUpdate:t}),[e,t,n])};var eA=n(94184),ew=n.n(eA),eZ=n(79352);let ek=eo.memo(e=>(0,ec.tZ)(eZ.uur,{...e,className:ew()(e.className,"animate-spin text-5xl")})),eN=eo.memo(e=>{let{text:t="",loading_attr:n={},text_attr:a={},...i}=e;return(0,ec.BX)("div",{...i,className:ew()(i.className," flex flex-col items-center"),children:[(0,ec.tZ)(ek,{...n}),!!t&&(0,ec.tZ)("div",{...a,className:ew()(" text-2xl text-center mt-9",a.className),children:t})]})}),eT=eo.memo(()=>{let e=(0,eo.useCallback)(e=>{e.stopPropagation()},[]),{loading:t}=function(e){let{oUpdate:t,store:{loading:n}}=ex(),a=(0,eo.useCallback)(()=>t({loading:!0}),[t]),i=(0,eo.useCallback)(()=>t({loading:!1}),[t]);return(0,eo.useEffect)(()=>{"boolean"==typeof e&&(e?a():i())},[e]),(0,eo.useMemo)(()=>({show:a,hiden:i,loading:n}),[a,i,n])}();return t?(0,ec.tZ)("div",{className:" fixed left-0 top-0 z-50 w-screen h-screen flex justify-center items-center bg-opacity-60 bg-black-1",onMouseMove:e,onMouseDown:e,onClick:e,children:(0,ec.tZ)(eN,{className:"py-10"})}):null});var eI=n(79655),eC=n(89250);function eB(){return(eB=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{text:t="",className:n}=e;return(0,ec.tZ)("div",{className:ew()("text-left text-black font-medium text-[2.5rem] leading-[2.9375rem]",n),children:t})});function eW(){return(eW=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:6,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;return e?e.length<=t+n?e:"".concat(e.toString().substring(0,t),"...").concat(e.toString().substring(e.length-n)):""};function e_(e){if(e){let t=document.getElementById(e);t&&t.scrollIntoView({block:"start",behavior:"smooth"})}}function e$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_blank";window.open(e,t)}let e0=new(ez())("800000000");function e1(e){let[t,n]=e.split("-"),a=new(ez())(t,36).sub(e0).toString(10);return[a,n]}function e2(e,t){let n=new(ez())(e).add(e0);return"".concat(n.toString(36),"-").concat(t)}function e5(e){return new Promise(t=>setTimeout(t,e))}function e3(e){switch(e){case eV.c.mainnet.id:break;case eV.c.goerli.id:return"https://goerli.etherscan.io";case eV.c.arbitrum.id:return"https://arbiscan.io";case eV.c.arbitrumGoerli.id:return"https://goerli.arbiscan.io";default:console.warn("chainId:".concat(e," not supported."))}return"https://etherscan.io"}function e4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e<9765625e-10?"".concat(eF().floor(1048576*e,t)," KB"):e<1?"".concat(eF().floor(1024*e,t)," MB"):e<1024?"".concat(eF().floor(e,t)," GB"):e<1048576?"".concat(eF().floor(e/1024,t)," TB"):"".concat(eF().floor(e/1048576,t)," PB")}function e6(e){return"".concat(eY.C5,"/ipfs/").concat(e)}function e8(e,t){return e+Math.floor(Math.random()*(t-e))}function e7(e){return eK("sha256").update(e,"binary").digest("base64")}eQ.Kc&&(window.parseBucketId=e1,window.genBucketId=e2);var e9=n(5121);let te="ZXRoLTB4MEVDNzJGNEQ5MWVhN2ZiRjAyZTY2NUQzZDU5QzQ3MmVjY2M0ZWZFZDoweDc3NDdmNDkxMWNhOWY2YWJjODE0MTgxZTkzZmM1YjdlNzQ4MGIwYzM0ZGRmOWFmNGQ4NjQ3OTRiZmYzY2EzMTg2MzQyNWEwZDRjZjAyOTA1Mjc5MTIwNDliYjJlYTRkMTM1OGZlZjQ3ZDU4YzBmMTQxNjI3ZmMzMTIwNzMwODdjMWI";async function tt(e){let{data:t,endpoint:n=eY.sl,authBasic:a="Basic ".concat(te),onProgress:i,cancelToken:l=e9.Z.CancelToken.source().token}=e,r=await e9.Z.request({data:t,cancelToken:l,headers:{Authorization:a},method:"POST",onUploadProgress(e){i&&i(e.progress)},params:{pin:!0},url:"".concat(n,"/api/v0/add")});return r.data}async function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:te;try{if(0===e.length)throw Error("CID len err");let a=await e9.Z.post("".concat("https://pin.crustcode.com/psa","/pins"),JSON.stringify({cid:e,name:t}),{headers:{authorization:"Bearer "+n,"Content-Type":"application/json"}});return a.data}catch(i){return null}}function ta(){let{update:e}=ex(),t=(t,n)=>{e(e=>{let{toasts:n}=e;return{toasts:[{type:"error",msg:t}].concat(n||[])}})},n=(t,n)=>{e(e=>{let{toasts:n}=e;return{toasts:[{type:"success",msg:t}].concat(n||[])}})};return{error:t,success:n}}function ti(e){let{className:t,onClose:n,uploadRender:a,uploadBorder:i=!0,onSuccess:l,id:r=""}=e,s=ta(),[c,o]=(0,eo.useState)({progress:0,status:"stop"}),d=(0,eo.useRef)(null),u=(0,eo.useRef)(null),[m,p]=(0,eo.useState)(null),[y,h]=(0,eo.useState)(null),f=async()=>{"stop"===c.status&&u.current.click()};(0,eo.useEffect)(()=>{if(d.current){let e=d.current;e.addEventListener("dragover",e=>{e.preventDefault()}),e.addEventListener("dragenter",async()=>{e.querySelector("#waitUpload")&&(e.style.borderColor="#FC7823")}),e.addEventListener("dragleave",async()=>{e.style.borderColor="#131521"}),e.addEventListener("drop",async t=>{if(t.stopPropagation(),t.preventDefault(),e.querySelector("#waitUpload")){if(e.style.borderColor="#131521",t.dataTransfer.files.length>1||!/\.[a-zA-Z]+$/.test(t.dataTransfer.files[0].name))return s.error("Folders are not supported!"),!1;let[n]=t.dataTransfer.files;if(!n)return s.error("Please select a file."),!1;let a=n.size/1048576;if(a>100){s.error("Please select a file less than 100MB.");return}await g(n)}})}},[]);let g=async e=>{try{let t=e9.Z.CancelToken.source();p(t),o({progress:0,status:"upload"}),u.current.value="";let n=new FormData;if(!e||!e.name)return!1;n.append("file",e,e.name);let a=await tt({data:n,authBasic:"Basic ".concat("ZXRoLTB4MEVDNzJGNEQ5MWVhN2ZiRjAyZTY2NUQzZDU5QzQ3MmVjY2M0ZWZFZDoweDc3NDdmNDkxMWNhOWY2YWJjODE0MTgxZTkzZmM1YjdlNzQ4MGIwYzM0ZGRmOWFmNGQ4NjQ3OTRiZmYzY2EzMTg2MzQyNWEwZDRjZjAyOTA1Mjc5MTIwNDliYjJlYTRkMTM1OGZlZjQ3ZDU4YzBmMTQxNjI3ZmMzMTIwNzMwODdjMWI="),cancelToken:t.token,onProgress(e){o({progress:Math.round(99*e),status:"upload"})}});p(null),o({progress:100,status:"success"}),h(a),l&&l(a)}catch(i){console.error(i)}},b=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),m&&(m.cancel("CanceledError"),p(null)),o({progress:0,status:"stop"}),n&&n(),h(null)},v=async e=>{let t=e.target.files[0];if(!t)return s.error("Please select a file."),!1;let n=t.size/1048576;if(n>100){s.error("Please select a file less than 100MB.");return}await g(t)};return(0,ec.BX)("div",{id:r,className:ew()("w-full flex justify-center",t),children:[(0,ec.BX)("div",{ref:d,onClick:f,className:ew()("w-full h-full cursor-pointer relative max-w-[70rem] flex justify-center items-center border-black-1 border-4 border-dashed"),style:i||"upload"!==c.status?{}:{border:"none"},children:[n&&(0,ec.tZ)(eL,{className:"absolute z-10 right-2 top-2 cursor-pointer",onClick:b}),"stop"!==c.status?"upload"===c.status?(0,ec.tZ)("div",{className:ew()("w-full",{"px-5":!!a,"px-20":!a}),children:a?a(c.progress):(0,ec.tZ)(eR,{value:c.progress})}):(0,ec.BX)("div",{className:"text-black-3 text-lg flex flex-col px-20",children:[(0,ec.tZ)("label",{className:"text-xl font-medium text-black",children:"IPFS CID:"}),(0,ec.tZ)("span",{className:"mt-5",children:y.Hash}),(0,ec.BX)("div",{className:"mt-20",children:[(0,ec.tZ)("label",{className:"text-xl font-medium text-black",children:"You may want to:"}),(0,ec.BX)("div",{className:"flex flex-wrap mt-5",children:[(0,ec.tZ)("div",{className:"mr-5 w-1/2 mb-2 underline",onClick:()=>e$("".concat(eY.C5,"/ipfs/").concat(y.Hash)),children:"Get download link for this file"}),(0,ec.tZ)("div",{className:"underline",onClick:()=>e$("https://ipfs-scan.io/?cid=".concat(y.Hash)),children:"Verify on IPFS"}),(0,ec.tZ)("div",{className:"mr-5 w-1/2 underline",onClick:()=>e$("https://docs.crustcloud.io"),children:"Learn more about Crust Cloud's storage solution"}),(0,ec.tZ)("div",{onClick:()=>e$("http://test.crustcloud.io/#/buckets"),className:"underline",children:"Claim your W3Bucket NFT on testnet"})]})]})]}):(0,ec.tZ)("span",{style:{pointerEvents:"none"},id:"waitUpload",className:"text-black-1 font-medium text-[2rem] leading-normal",children:"Drag and drop your file here"})]}),(0,ec.tZ)("input",{ref:u,hidden:!0,onChange:v,type:"file"})]})}let tl=eo.memo(()=>{let[e,t]=(0,eo.useState)(!1),n=()=>{t(!0),setTimeout(()=>{e_("nftupload")},0)},a=()=>{t(!1),setTimeout(()=>{e_("nft")},0)};return(0,ec.tZ)("div",{className:"w-full py-6 px-12 flex justify-center pb-20 mt-3 text-slate-700 text-lg",id:"nft",children:(0,ec.BX)("div",{className:"w-full max-w-[1112px] flex flex-col text-black",children:[(0,ec.tZ)(eP,{className:"mt-6 mb-8 font-medium",text:"Web3 Storage Buckets & Web3 IPFS Gateways"}),(0,ec.tZ)("p",{className:"pb-20 text-2xl text-black-3",children:"Crust Cloud defines what cloud storage middlewares should look like in Web3 - every storage bucket is a NFT, and every IPFS gateway is a NFT."}),(0,ec.BX)("div",{className:"flex justify-center",children:[(0,ec.BX)("div",{className:"flex flex-col justify-between",children:[(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)(eM,{}),(0,ec.tZ)("span",{className:"text-6xl px-6",children:"="}),(0,ec.tZ)(eE,{})]}),(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)(eO,{}),(0,ec.tZ)("span",{className:"text-6xl px-6",children:"="}),(0,ec.tZ)(eE,{})]})]}),(0,ec.BX)("div",{className:"ml-16",children:[(0,ec.tZ)("h4",{className:"text-[1.375rem] font-semibold text-black mb-4",children:"Store files in W3Buckets: Decentralized, Guaranteed & Alive."}),(0,ec.tZ)("p",{className:"text-black-3",children:"All contents in the W3Buckets are immutable, decentralized stored, guaranteed with up to permanent persistence in the open internet, and most importantly, owned & controlled by the NFT owner."}),(0,ec.tZ)("h4",{className:"text-[1.375rem] font-semibold text-black mb-4 mt-20",children:"IPFS Remote Pin"}),(0,ec.tZ)("p",{className:"text-black-3",children:"Storage service are called by Standard IPFS Remote Pinning Service APIs that make your files always available (alive!) on IPFS with multiple replicas and accessible from everywhere."}),(0,ec.BX)("div",{className:"flex mt-8 text-black-1",children:[(0,ec.tZ)(ej,{onClick:n,className:"btn-173",text:"Play Quick Demo"}),(0,ec.tZ)(ej,{onClick:()=>eQ.Kc?e$("/#/buckets","_self"):e$("/#/buckets"),className:"btn-173 ml-5",text:"Launch App"})]})]})]}),e&&(0,ec.tZ)(ti,{id:"nftupload",className:"h-[32.937rem] mt-12",onClose:a})]})})}),tr=[[[42,49]],[[41,50]],[[38,53]],[[37,53]],[[20,26],[35,52]],[[18,28],[34,51],[82,85],[96,100],[110,111]],[[17,24],[27,27],[29,32],[36,36],[38,51],[81,84],[92,101],[109,111]],[[3,6],[11,12],[16,27],[29,34],[40,51],[80,81],[86,86],[89,89],[91,106],[110,115]],[[2,8],[10,24],[26,27],[30,36],[40,50],[67,74],[83,83],[85,86],[88,123]],[[2,24],[26,26],[28,31],[34,37],[40,49],[66,75],[77,86],[88,124]],[[1,31],[34,38],[40,46],[51,54],[66,73],[76,124]],[[1,28],[31,31],[33,37],[41,44],[52,53],[64,123]],[[2,27],[33,37],[42,43],[63,115],[118,122]],[[4,8],[11,27],[33,38],[60,60],[64,114],[116,119]],[[3,7],[13,30],[33,39],[59,61],[64,109],[116,118]],[[2,3],[13,31],[33,40],[58,62],[64,110],[116,118]],[[0,1],[14,40],[58,111],[116,117]],[[16,36],[40,40],[60,111],[115,116]],[[16,38],[40,41],[61,78],[81,109],[111,111]],[[16,39],[60,71],[73,73],[75,77],[80,108]],[[16,37],[58,62],[66,66],[68,71],[76,78],[80,108],[110,111]],[[16,35],[58,61],[65,65],[67,67],[69,78],[81,102],[104,107],[110,110]],[[17,35],[59,60],[63,65],[67,67],[69,69],[71,78],[80,103],[105,106],[109,110]],[[18,34],[61,65],[74,103],[105,105],[108,110]],[[19,32],[59,66],[69,70],[74,103],[107,108]],[[20,32],[58,104],[106,107]],[[20,27],[31,32],[58,78],[80,104]],[[21,26],[31,31],[57,73],[75,78],[82,103]],[[21,21],[23,25],[56,73],[75,82],[85,103]],[[23,26],[28,29],[31,33],[56,74],[76,82],[86,101]],[[23,29],[34,36],[56,74],[76,81],[87,91],[94,98],[100,100],[104,104]],[[25,30],[56,75],[77,80],[87,90],[94,99],[103,104]],[[28,31],[56,75],[77,78],[87,89],[95,99],[103,104]],[[30,31],[34,37],[55,76],[88,89],[96,99],[104,104]],[[30,39],[56,79],[88,89],[96,96],[98,98],[102,102],[104,105]],[[31,40],[57,79],[88,89],[96,96],[101,102],[104,105]],[[33,42],[58,61],[64,79],[95,97],[101,102]],[[32,42],[65,78],[95,97],[100,102],[106,106]],[[32,43],[65,76],[96,97],[100,104],[106,108]],[[31,45],[65,76],[96,98],[100,102],[104,104],[107,111]],[[31,47],[65,75],[97,99],[107,112]],[[31,47],[66,75],[98,100],[110,113]],[[32,47],[66,75],[100,101],[104,105],[110,113]],[[33,47],[66,76],[78,79],[107,108],[113,113]],[[33,46],[65,76],[78,79],[105,108],[111,111]],[[34,46],[65,75],[77,79],[104,112]],[[35,46],[66,75],[77,79],[104,113]],[[35,45],[66,74],[77,78],[102,113]],[[35,44],[67,74],[77,78],[101,114]],[[35,43],[67,73],[77,77],[101,114]],[[35,43],[67,72],[101,114]],[[35,42],[68,72],[102,114]],[[35,41],[68,71],[102,114]],[[34,41],[68,69],[101,103],[108,108],[110,114],[123,123]],[[34,39],[110,113],[123,124]],[[34,38],[111,112],[122,124]],[[34,37],[112,113],[122,124]],[[34,36],[112,112],[121,122]],[[33,37],[120,121]],[[33,36]],[[33,35]],[[34,37]],[[35,36]]],ts=(0,eo.memo)(function(e){let{className:t,activePos:n,onChange:a}=e,[i,l]=(0,eo.useState)([]);(0,eo.useMemo)(()=>{if(n.length>0){let e=[];n.map(t=>{for(let n=0;n=r[0]&&t.x<=r[1]&&t.y===n){e.push(r),i=!0;break}}if(i)break}}),l(e)}},[n]),(0,eo.useMemo)(()=>{i.length>0&&a&&a(i)},[i]);let r=e=>{let t=e[0],n=e[1],a=[];for(let i=t;i<=n;i++)a.push(i);return a},s=(e,t)=>{let a=eF().find(n,n=>n.x===e&&n.y===t);return a?"red":"#666"};return(0,ec.tZ)("svg",{viewBox:"0 0 880 450",className:ew()("",t),children:tr.map((e,t)=>e.map(e=>r(e).map((e,n)=>(0,ec.tZ)("circle",{fill:s(e,t),cx:(e+1)*7,cy:(t+1)*7,r:"2.6"},"circle".concat(n)))))})});function tc(){return(tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let e=ty();return{logo:(0,ec.tZ)(tp,{className:""}),name:"AAVE",activePos:e.activePos,total:e.total}})()],tf=eo.memo(()=>{let[e,t]=(0,eo.useState)(0),n=()=>{t(e-1>=0?e-1:th.length-1)},a=()=>{t(e+1>th.length-1?0:e+1)};return(0,ec.tZ)("div",{className:"w-full pt-6 pb-[min(12vmin,18.75rem)] px-12 flex flex-col items-center",children:(0,ec.BX)("div",{className:"my-10 text-black w-full max-w-[1310px]",children:[(0,ec.tZ)(eP,{className:"mx-auto max-w-[1120px] ",text:"Discover some real use cases"}),th.map((t,i)=>i===e&&(0,ec.BX)("div",{className:ew()("flex justify-center pt-5"),children:[(0,ec.tZ)(ts,{activePos:t.activePos,className:"flex-1 pt-16"}),(0,ec.BX)("div",{className:"flex flex-shrink-0 flex-col items-center w-[22.625rem] ml-10 ",children:[(0,ec.BX)("div",{className:"h-[4.625rem] w-full flex justify-between items-center",children:[(0,ec.tZ)(tu,{className:"cursor-pointer",onClick:n}),t.logo,(0,ec.tZ)(tu,{className:"rotate-180 cursor-pointer",onClick:a})]}),(0,ec.BX)("span",{className:"text-black text-lg mt-12 font-medium",children:["Check this real-time monitor to see how we help ",t.name," decentralized host their Dapp frontend:"]}),(0,ec.BX)("div",{className:"text-black-3 text-lg mt-3",children:[(0,ec.BX)("p",{className:"mt-5",children:[(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:t.total})," IPFS Replicas all around the globe"]}),(0,ec.BX)("p",{className:"mt-5",children:[(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:"99+"})," Years guaranteed with ",(0,ec.tZ)("span",{className:"text-orange-500 font-medium text-2xl",children:"1.5ETH"})," in payment contract"]}),(0,ec.BX)("p",{className:"mt-5",children:["Guranteed by ",(0,ec.tZ)("a",{className:"text-black-3 underline",href:"https://crust.network/",target:"_blank",children:"decentralized incentive protocol"})," on IPFS"]}),(0,ec.BX)("p",{className:"mt-5",children:["Verifiable on ",(0,ec.tZ)("a",{className:"text-black-3 underline",href:"https://ipfs-scan.io/",target:"_blank",children:"IPFS Scan"})]})]})]})]},"monitorProject".concat(i)))]})})});var tg=n(85769),tb=n(85118),tv=n(53459),tx=n(15029),tA=n(99477);function tw(){let e="#787980",t=(0,eo.useMemo)(()=>{let e=[],t=new tA.Vector3;for(let n=0;n<2e3;n++){t.x=2*Math.random()-1,t.y=2*Math.random()-1,t.z=2*Math.random()-1,t.normalize(),t.multiplyScalar(26);let a=[t.x,t.y,t.z];t.multiplyScalar(.2*Math.random()+1);let i=[t.x,t.y,t.z];e.push([a,i])}return e},[]),n=(0,eo.useMemo)(()=>{let e=[],t=new tA.Vector3;for(let n=0;n<300;n++){t.x=n%2==0?-1:1,t.y=(2*Math.random()-1)*.5,t.z=(2*Math.random()-1)*.3,t.normalize(),t.multiplyScalar(26+4*Math.random()-2);let a=[t.x,t.y,t.z];t.multiplyScalar(2*Math.random()+1.3);let i=[t.x,t.y,t.z],l=Math.abs(a[0]-i[0]),r=Math.round(1+5*l/27),s=[i[0]-a[0],i[1]-a[1],i[2]-a[2]],[c,o,d]=[s[0]/(r+1),s[1]/(r+1),s[2]/(r+1)],u=[];if(Math.random()>.5)for(let m=1;m<=r;m++){let p=Math.ceil(Math.random()-.5),y=(3*Math.random()+2)*p;u.push([a[0]+m*c,a[1]+m*o+y,a[2]+m*d+0])}e.push([a,i,u])}return e},[]),a=(0,eo.useRef)(),i=(0,eo.useRef)(),l=(0,eo.useRef)({count:0}),r=(0,eo.useRef)({});(0,tv.C)((e,t,n)=>{if(a.current){let s=2*Math.PI,c=a.current.rotation.x+s*t*.01;a.current.rotation.x=c>s?c-s:c}if(i.current){let o=l.current.count%6==0;for(let d of i.current.children)if("Points"===d.type){let m=d,p=m.geometry.getAttribute("position");for(let y=0;y2*f.max?1:g,v=b<=f.max?b-1:2*f.max-b-1;p.setXYZ(y,h.getX(v),h.getY(v),h.getZ(v))}else p.setXYZ(y,h.getX(0),h.getY(0),h.getZ(0))}p.needsUpdate=!0}else if("Line"===d.type){let x=d,A=r[x.name];if(A){let w=A.count+(o?1:0),Z=w>2*A.max?1:w,k=Z<=A.max?Z:2*A.max-Z;x.geometry.setDrawRange(0,k),A.count=Z}else if(x.geometry.setDrawRange(0,0),.001>Math.random()){let N=Math.round(x.geometry.getAttribute("position").array.length/3);r[x.name]={count:1,max:N}}}l.current.count++,l.current.count>600&&(l.current.count=0)}},-2);let s=(0,tg.m)("disc.png"),c=(0,eo.useMemo)(()=>new tA.Float32BufferAttribute(t.flatMap(e=>e[1]),3),[t]),o=(0,eo.useMemo)(()=>new tA.Float32BufferAttribute(t.flatMap(e=>e[0].concat(e[1])),3),[t]),d=(0,eo.useMemo)(()=>new tA.Float32BufferAttribute(n.flatMap(e=>e[1]),3),[n]),u=(0,eo.useMemo)(()=>{let e=[];for(let[t,a,i]of n){let l=[t,...i,a],r=new tA.CatmullRomCurve3(l.map(e=>new tA.Vector3(...e)),!1,"chordal",.5),s=Math.abs(t[0]-a[0]),c=Math.round(20+160*s/27),o=r.getPoints(c).flatMap(e=>[e.x,e.y,e.z]);e.push(new tA.Float32BufferAttribute(o,3))}return e},[n]);return(0,ec.BX)("group",{position:[40,0,0],children:[(0,ec.BX)("group",{ref:a,children:[(0,ec.BX)("points",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:c}}),(0,ec.tZ)("pointsMaterial",{color:e,opacity:.7,map:s,size:4,blending:tA.AdditiveBlending,depthTest:!1,transparent:!0})]}),(0,ec.BX)("lineSegments",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:o}}),(0,ec.tZ)("lineBasicMaterial",{color:e,linewidth:1})]})]}),(0,ec.BX)("group",{ref:i,children:[(0,ec.BX)("points",{children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:d}}),(0,ec.tZ)("pointsMaterial",{color:"#cdcccc",opacity:.7,map:s,size:4,blending:tA.AdditiveBlending,depthTest:!1,transparent:!0})]}),u.map((t,n)=>(0,ec.BX)("line_",{name:n,children:[(0,ec.tZ)("bufferGeometry",{attributes:{position:t}}),(0,ec.tZ)("lineBasicMaterial",{color:e,linewidth:1})]},"line_".concat(n)))]})]})}(0,tv.e)({Line_:tA.Line});let tZ=eo.memo(function(){return(0,ec.BX)(tx.Xz,{gl:{antialias:!0},children:[(0,ec.tZ)(tb.i,{makeDefault:!0,zoom:9,args:[-150,50,30,-30,50,-100]}),(0,ec.tZ)("ambientLight",{color:"#eaeaea",intensity:1}),(0,ec.BX)("mesh",{position:[0,0,-100],children:[(0,ec.tZ)("planeGeometry",{args:[1e3,1e3]}),(0,ec.tZ)("meshStandardMaterial",{color:"black"})]}),(0,ec.tZ)(tw,{})]})});var tk=n(21132);function tN(){return(tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t((0,tk.tf)(()=>{setTimeout(()=>{window.scroll(0,0)},50)}),(0,ec.BX)("div",{className:"w-full min-h-min relative",children:[(0,ec.tZ)("div",{className:"w-full bg-black h-screen absolute left-0 top-0 z-0",children:(0,ec.tZ)(tZ,{})}),(0,ec.BX)("div",{className:"z-1 h-[100vh] relative w-full py-6 px-12 flex flex-col items-center",children:[(0,ec.tZ)("div",{className:"h-14 w-full max-w-[1112px] flex justify-between items-center font-WorkSans",children:(0,ec.tZ)("div",{className:"text-[88px] ml-3 mt-5",children:(0,ec.tZ)(tE,{})})}),(0,ec.BX)("div",{className:"h-full my-10 w-full max-w-[1112px] flex flex-col justify-center mt-[-1rem]",children:[(0,ec.BX)("div",{className:"font-RobotoMono font-bold text-[2.5rem] leading-tight",children:[(0,ec.tZ)("p",{children:"Crust Cloud"}),(0,ec.tZ)("p",{children:"Redefining Web3 Storage"})]}),(0,ec.BX)("div",{className:"flex flex-col mt-12 pl-1 mb-20",children:[(0,ec.BX)("div",{className:"flex mb-3",children:[(0,ec.tZ)(ej,{text:"Documentations",className:"btn-173 border-white text-white",onClick:()=>e$("https://docs.crustcloud.io/")}),(0,ec.tZ)(ej,{text:"Launch App",className:"btn-173 ml-3 border-white text-white",onClick:()=>eQ.Kc?e$("/#/buckets","_self"):e$("/#/buckets")})]}),(0,ec.tZ)("div",{className:"flex",children:(0,ec.tZ)(ej,{text:"Contact the team",className:"btn-173 border-white text-white",onClick:()=>e$("https://forms.gle/NUSvEDDR4AmP8wbV6")})})]})]})]})]})));function tO(){return(tO=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,ec.tZ)("div",{className:"w-full py-20 px-12 flex flex-col items-center justify-center text-black-1",children:(0,ec.BX)("div",{className:"w-full max-w-[1112px]",children:[(0,ec.tZ)(eP,{className:"w-full pb-14",text:"Crust Cloud is a Web3 storage cloud"}),(0,ec.BX)("div",{className:"w-full flex justify-between items-end text-lg",children:[(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-black-1 mt-12",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-black-1 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"IaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Infrastructure-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.BX)("div",{className:"flex items-center mt-6",children:[(0,ec.tZ)(tj,{}),(0,ec.tZ)(tW,{className:"ml-11"})]}),(0,ec.tZ)("a",{href:"https://ipfs.io",target:"_blank",className:"text-2xl text-black-1 font-medium leading-7 mt-5 mb-3 underline no-skip-ink",children:"IPFS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"the distrbuted file system"}),(0,ec.tZ)("a",{href:"https://crust.network",target:"_blank",className:"text-2xl text-black-1 font-medium leading-7 mt-5 mb-3 underline no-skip-ink",children:"Crust Network"}),(0,ec.tZ)("p",{className:"w-[294px] leading-[1.3125rem] text-center",children:"the decentralized storage protocol & incentive layer of IPFS"})]}),(0,ec.tZ)("div",{})]}),(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.tZ)("h4",{className:"text-orange-15 font-medium text-[2rem] leading-[2.375rem] mb-4",children:"Crust Cloud Products"}),(0,ec.BX)("div",{className:"flex",children:[(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-orange-15",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-orange-15 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"PaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Platform-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center pt-7 pb-14",children:[(0,ec.BX)("div",{className:"flex items-center text-[2.5rem]",children:[(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tR,{}),(0,ec.tZ)("span",{className:"px-3",children:"+"}),(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tD,{})]}),(0,ec.tZ)("h6",{onClick:()=>e_("nft"),className:"text-2xl font-medium leading-7 mt-[1.7rem] mb-3 underline no-skip-ink cursor-pointer",children:"W3Buckets"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"NFT-nized IPFS storage buckets"}),(0,ec.tZ)("h6",{onClick:()=>e_("nft"),className:"text-2xl font-medium leading-7 mt-5 mb-3 underline no-skip-ink cursor-pointer",children:"W3Gateways"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem]",children:"NFT-nized IPFS Gateways"})]})]}),(0,ec.BX)("div",{className:"w-[348px] h-[418px] border-2 border-orange-15",children:[(0,ec.BX)("div",{className:"flex flex-col items-center border-b-2 border-orange-15 py-6",children:[(0,ec.tZ)("div",{className:"text-[2rem] font-medium",children:"SaaS"}),(0,ec.tZ)("span",{className:"leading-[1.3125rem] mt-[.625rem]",children:"Software-as-a-Service"})]}),(0,ec.BX)("div",{className:"flex flex-col items-center pt-7",children:[(0,ec.BX)("div",{className:"flex items-center text-[2.5rem]",children:[(0,ec.tZ)("span",{className:"mr-2",children:"W3"}),(0,ec.tZ)(tG,{})]}),(0,ec.tZ)("h6",{onClick:()=>e_("widget"),className:"text-2xl font-medium leading-7 mt-[2rem] mb-3 underline no-skip-ink cursor-pointer",children:"Web3 Storage Widgets"}),(0,ec.tZ)("p",{className:"w-[298px] leading-[1.3125rem] text-center",children:"Rich-text Editor/Publisher Widget IPFS File Storage Widget"}),(0,ec.tZ)("p",{className:"w-[298px] leading-[1.3125rem] text-center",children:"IPFS Storage Retrieval Widget and more..."})]})]})]})]})]})]})}));function tF(){return(tF=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{icon:t,...n}=e;return"string"==typeof t?(0,ec.tZ)("span",{...n,className:ew()(n.className,t)}):(0,ec.tZ)(t,{...n})}),t$=eo.memo(e=>{let{onClose:t,title:n,className:a,...i}=e;return(0,ec.BX)("div",{...i,className:ew()(" flex pb-5 justify-between border-b border-solid border-b-gray-16",a),children:[(0,ec.tZ)("div",{className:"text-black-3 text-lg",children:n}),(0,ec.tZ)("div",{className:"text-gray-12",children:(0,ec.tZ)(t_,{icon:"cru-fo-x",className:" text-xl cursor-pointer",onClick:t})})]})}),t0=eo.memo(e=>{let{outClick:t,outClassname:n,className:a,children:i,...l}=e,r=null==document?void 0:document.getElementById("app-root");return r?(0,tq.createPortal)((0,ec.tZ)("div",{onClick:t,className:ew()(n,"fixed left-0 top-0 w-screen h-screen z-40 bg-opacity-50 bg-black flex justify-center items-center"),children:(0,ec.tZ)("div",{...l,className:ew()(a," min-w-[27.5rem] p-5 bg-white text-black-1"),children:i})}),r):null});var t1=n(8193);let t2=eo.memo(e=>{let{onClose:t,className:n}=e;return(0,ec.tZ)(t_,{className:ew()("absolute right-6 top-6 text-3xl font-bold cursor-pointer",n),onClick:t,icon:t1.SV5})});function t5(e){let{onClose:t}=e,[n,a]=(0,eo.useState)(0),[i,l]=(0,eo.useState)({Hash:""}),r=e=>{a(3),l(e)},s=e=>(0,ec.BX)("div",{className:"flex flex-col items-center",children:[(0,ec.tZ)("p",{className:"w-[24rem] text-black-3 text-2xl text-center mb-10",children:"Publishing & Uploading to IPFS Please wait..."}),(0,ec.tZ)(eR,{value:e})]});return(0,ec.tZ)(t0,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white flex min-h-[40.75rem] relative",children:[(0,ec.tZ)(t2,{onClose:()=>t&&t()}),(0,ec.BX)("div",{className:"bg-black w-80 text-white px-8 py-16 text-lg",children:[(0,ec.tZ)("div",{className:"mb-12 text-2xl font-medium",children:"IPFS File Storage Widget"}),3===n?(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 2:"}),(0,ec.tZ)("p",{className:"font-light",children:"When Upload process is completed, you will get an IPFS CID (unique identifier to your stored content) and a Storage Manager Tx No. (Tx No. for the IPFS storage action of your content)."})]}):(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 1:"}),(0,ec.tZ)("p",{className:"mb-5 font-light",children:"Drag and drop a file into the box."}),(0,ec.BX)("p",{className:"font-light",children:["When you finish, click on the ",(0,ec.tZ)("span",{className:"font-semibold",children:"'Upload'"})," button to continue."]})]})]}),(0,ec.tZ)("div",{className:"min-w-[50rem] flex justify-center items-center",children:3===n?(0,ec.BX)("div",{className:"text-center text-black-3 flex flex-col items-center",children:[(0,ec.tZ)(t_,{className:"text-[3.125rem] text-black mb-4",icon:t1.KP3}),(0,ec.tZ)("div",{className:"text-[1.375rem] text-black font-semibold mb-4",children:"Publish successfully!"}),(0,ec.tZ)("p",{className:"mb-14 text-lg",children:"This content has been published and decentralized stored on IPFS."}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Your content's IPFS CID:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7 mb-8",children:i.Hash}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Storage Manager Tx No:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7",children:eq("0x69b9f8cf491b55c485dbb43a86a7e48f7649aa45c958cd245461d04c3146bd91",23,23)})]}):(0,ec.tZ)(ti,{uploadRender:s,onSuccess:r,uploadBorder:!1,className:"h-[29.937rem] w-[42.5rem]"})})]})})}var t3=n(7297),t4=n(18872),t6=n(81482),t8=n(93282);n(37640);var t7=n(96412),t9=n.n(t7),ne=n(4979),nt=n.n(ne),nn=n(31026),na=n(378),ni=n(611),nl=n(49891),nr=n(84672),ns=n(56073),nc=n(54340),no=n(82874),nd=n(5705),nu=n(71265),nm=n(11033),np=n(31871),ny=n(78469),nh=n(55658),nf=n(78822),ng=n(98584),nb=n(81373),nv=n(13848),nx=n(32085),nA=n(92003),nw=n.n(nA),nZ=n(241),nk=n(57375),nN=n(27353),nT=n(48764).Buffer;function nI(){let e=(0,t3.Z)(['\n width: 100%;\n height: 100%;\n padding: 80px 24px 24px 24px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ol,\n ul {\n list-style: revert !important;\n margin: revert !important;\n padding: revert !important;\n }\n .remirror-editor-wrapper {\n padding-top: unset;\n border-radius: 0;\n border: 1px solid #dfe3e7 !important;\n outline: unset !important;\n overflow: auto;\n height: 447px;\n max-width: 872px;\n max-height: 447px;\n .ProseMirror {\n overflow: hidden;\n min-height: 100%;\n padding: "1rem";\n box-shadow: unset !important;\n pre {\n padding: ',";\n margin: 0;\n }\n .remirror-is-empty:first-of-type::before{\n font-style: normal !important;\n }\n }\n }\n"]);return nI=function(){return e},e}function nC(){let e=(0,t3.Z)(["\n height: 72px !important;\n background-color: #f4f5f7 !important;\n padding: 24px !important;\n border: 1px solid #dfe3e7 !important;\n overflow: hidden !important;\n button {\n padding: unset !important;\n width: 24px !important;\n height: 24px !important;\n /* font-size: 22px; */\n margin-right: 18px !important;\n outline: unset !important;\n border: unset !important;\n background-color: transparent !important;\n }\n "]);return nC=function(){return e},e}async function nB(e){let t=await nN.J.digest(e);return nk.k0.createV0(t).toString()}let nM=eY.C5,nS=new Map,nE=(0,t4.iv)(nI(),(0,nn.y2)("space",3)),nX=e=>{let{style:t,className:n,children:a}=e;return(0,ec.tZ)("div",{style:t,className:"".concat(nE," ").concat(n," w-full"),children:a})},nO={color:{primary:"#FC7823",primaryText:"#FC7823",outline:"transparent",background:"transparent",hover:{primary:"#FC7823",primaryText:"#FC7823"}},fontFamily:{default:"var(--work-sans)"}},nj=()=>(0,ec.BX)(t6.o8,{className:(0,t4.iv)(nC()),children:[(0,ec.tZ)(t6.pQ,{attrs:{level:1}}),(0,ec.tZ)(t6.pQ,{attrs:{level:2}}),(0,ec.tZ)(t6.pQ,{attrs:{level:3}}),(0,ec.tZ)(t6.Vu,{}),(0,ec.tZ)(t6.NV,{}),(0,ec.tZ)(t6.kj,{}),(0,ec.tZ)(t6.QD,{}),(0,ec.tZ)(t6.Om,{}),(0,ec.tZ)(t6.XR,{}),(0,ec.tZ)(t6.gf,{})]}),nP=e=>{let{placeholder:t="Please input text...",initialContent:n="",editorUpdate:a,onUpFinish:i}=e,l=(0,eo.useMemo)(()=>{let e=new ni.y5({autoLink:!0});return e.addHandler("onClick",(e,t)=>(console.log("You clicked link: ".concat(JSON.stringify(t))),!0)),e},[]);(0,eo.useRef)("");let[r,s]=(0,eo.useState)(""),[c,o]=(0,eo.useState)(""),[d,u]=(0,eo.useState)(!1),[m,p]=(0,eo.useState)(""),[y,h]=(0,eo.useState)(-1),f=(0,eo.useMemo)(()=>-1!==y?"uping":r?"finish":"edit",[y,r]),g=async()=>{let e=await nw()();if(e&&e.isMetaMask){await e.request({method:"eth_requestAccounts"});let t=new nZ.Q(e),n=t.getSigner(),a=await n.getAddress(),i=await n.signMessage("You are signing this message for DEMO purpose only. Sign this message to prove you own this account and you will be able to publish your Web3 content.");return nT.from("eth-".concat(a,":").concat(i)).toString("base64")}return""},b=async(e,t)=>{try{let n=e9.Z.CancelToken.source();t&&t(0);let a=await tt({data:e,cancelToken:n.token,onProgress:t});return console.log(a),a}catch(i){console.error(i.message)}return null},v=async()=>{try{let e=await g();if(!e)return;let t=new FormData;t.append("file",c);let n=await b(t,e=>h(Math.round(99*e)));if(null===n){p("Cannot save markdown file."),u(!0),s("Save markdown failed.");return}let a=n.Hash;await tn(a,"text.md"),s(a),h(-1),i&&i(n)}catch(l){console.error(l)}},x=e=>{let t=0,n=[];for(let{file:a,progress:i}of(console.info("files:",e),e))n.push(()=>new Promise((e,n)=>{let i=new FileReader;i.addEventListener("load",async l=>{console.log(a),t+=1,console.info("readed:",i.result);let r=await nB(new Uint8Array(i.result));console.info("imgKey:",r);let s=nS.get(r);if(!s){let c=new FormData;c.append("file",a,a.name);let o=await b(c);if(null!==o)try{await tn(o.Hash,a.name);let d=await function(e){return new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>t(!1),n.src=e,n.loading="eager"})}("".concat(nM,"/ipfs/").concat(o.Hash));if(!d)throw"pre load error";s=o.Hash,nS.set(r,o.Hash)}catch(u){console.error(u)}}s?e({src:"".concat(nM,"/ipfs/").concat(s),fileName:a.name}):n()},{once:!0}),i.readAsArrayBuffer(a)}));return n},A=(0,eo.useCallback)(()=>{let e=document.createElement("div");return e.className="w-[100px] h-[100px] p-[30px]",tq.render((0,ec.tZ)(ek,{}),e),e},[]),w=(0,eo.useCallback)(()=>[new nl.X({placeholder:t}),new nr.x({data:nx,plainText:!0}),l,new ns.H({}),new nc.V,new no.Gc({uploadHandler:x,createPlaceholder:A,enableResizing:!0}),new nd.f,new nu.e({}),new nm.V,new np.z,new ny.UQ({enableSpine:!0}),new ny._3,new ny.Jb({priority:na.xV.High,enableCollapsible:!0}),new nh.l,new nf.W({supportedLanguages:[t9(),nt()]}),new ng.F,new nb.g({copyAsMarkdown:!1}),new nv.h],[t]),{manager:Z}=(0,t8.iF)({extensions:w,stringHandler:"markdown",content:n}),k=e=>{var t;(null===(t=e.tr)||void 0===t?void 0:t.docChanged)&&(null==a||a(e)),console.info("p:",e.helpers.getMarkdown())};return(0,eo.useEffect)(()=>{let e=setInterval(()=>{o(Z.extensionStore.helpers.getMarkdown())},500);return()=>clearInterval(e)},[Z]),(0,ec.BX)(t6.f6,{as:nX,theme:nO,children:["edit"==f&&(0,ec.BX)(t8.O1,{manager:Z,autoFocus:!0,onBlur:k,onChange:k,children:[(0,ec.tZ)(nj,{}),(0,ec.tZ)(t8.PG,{}),(0,ec.tZ)("div",{className:"flex justify-center",children:(0,ec.tZ)(ej,{disabled:!c,className:"btn-173 mt-4",text:"Publish",onClick:v})})]}),"uping"==f&&(0,ec.BX)("div",{className:"mb-[3.5rem] font-WorkSans px-14 flex flex-col items-center",children:[(0,ec.tZ)("p",{className:"w-[24rem] text-black-3 text-2xl text-center mb-10",children:"Publishing & Uploading to IPFS Please wait..."}),(0,ec.tZ)(eR,{value:y})]}),"finish"==f&&(0,ec.tZ)(ec.HY,{children:(0,ec.BX)("div",{className:"mb-[3.5rem] text-center font-WorkSans text-black-3 flex flex-col items-center",children:[(0,ec.tZ)(t_,{className:"text-[3.125rem] text-black mb-4",icon:t1.KP3}),(0,ec.tZ)("div",{className:"text-[1.375rem] text-black font-semibold mb-4",children:"Publish successfully!"}),(0,ec.tZ)("p",{className:"mb-14 text-lg",children:"This content has been published and decentralized stored on IPFS."}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Your content's IPFS CID:"}),(0,ec.tZ)("div",{className:"text-sm text-gray-7 mb-8",children:r}),(0,ec.tZ)("div",{className:"mb-2 text-lg",children:"Storage Manager Tx No:"}),(0,ec.tZ)("p",{className:"text-sm text-gray-7",children:eq("0x69b9f8cf491b55c485dbb43a86a7e48f7649aa45c958cd245461d04c3146bd91",23,23)})]})})]})};function nW(e){let{onClose:t}=e,[n,a]=(0,eo.useState)(0);return(0,ec.tZ)(t0,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white flex h-[40.75rem] relative",children:[(0,ec.tZ)(t2,{onClose:()=>t&&t()}),(0,ec.BX)("div",{className:"bg-black w-80 text-white px-8 py-16 text-lg",children:[(0,ec.tZ)("div",{className:"mb-12 text-2xl font-medium",children:"Rich-text Content Publisher Widget"}),0===n&&(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 1:"}),(0,ec.tZ)("p",{className:"mb-5 font-light",children:"Type in any text and try to do some simple edit work."}),(0,ec.BX)("p",{className:"font-light",children:["When you finish, click on the ",(0,ec.tZ)("span",{className:"font-semibold",children:"'Publish'"})," button to continue."]})]}),1===n&&(0,ec.BX)("div",{className:"text-lg",children:[(0,ec.tZ)("div",{className:"mb-5 font-medium",children:"Demo Step 2:"}),(0,ec.tZ)("p",{className:"font-light",children:"When Publish and Upload processes are completed, you will get an IPFS CID (unique identifier to your stored content) and a Storage Manager Tx No. (Tx No. for the IPFS storage action of your content)."})]})]}),(0,ec.tZ)("div",{className:"min-w-[50rem] flex items-center justify-center",children:(0,ec.tZ)(nP,{onUpFinish:e=>e&&a(1)})})]})})}var nL=n(48570),nR=n(76199),nY=n(34209),nD=n(79166);let nz=eo.memo(e=>(0,ec.tZ)(nL.D,{children:e.code,linkTarget:"_blank",components:{h5(e){let{node:t,...n}=e;return(0,ec.tZ)("h5",{style:{fontSize:"18px",fontStyle:"normal"},...n})},code(e){let{node:t,inline:n,className:a,children:i,...l}=e,r=/language-(\w+)/.exec(a||"");return!n&&r?(0,ec.tZ)(nY.Z,{children:String(i).replace(/\n$/,""),style:nD.Z,language:r[1],PreTag:"div",...l}):(0,ec.tZ)("code",{className:a,...l,children:i})}},remarkPlugins:[nR.Z]}));function nG(e){let{onClose:t}=e;return(0,ec.tZ)(t0,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white min-w-[56rem] flex flex-col relative p-6",children:[(0,ec.BX)("div",{className:"flex justify-between items-center mb-6",children:[(0,ec.tZ)("a",{className:"text-2xl underline text-black-1",href:"https://docs.crustcloud.io",target:"_blank",children:"Dev Guidance"}),(0,ec.tZ)(t2,{className:"mt-[-0.3rem]",onClose:()=>t&&t()})]}),(0,ec.tZ)("div",{children:(0,ec.tZ)(nz,{code:"\n##### React:\n\n~~~jsx\nimport { MDEditor } from '@cloud3/react-widgets'\nexport default function App(){\n return(\n \n )\n}\n~~~\n \n \n\n##### Vue:\n\n~~~jsx\n\n\n~~~\n"})})]})})}function nH(e){let{onClose:t}=e;return(0,ec.tZ)(t0,{className:"p-0",children:(0,ec.BX)("div",{className:"bg-white min-w-[56rem] flex flex-col relative p-6",children:[(0,ec.BX)("div",{className:"flex justify-between items-center mb-6",children:[(0,ec.tZ)("a",{className:"text-2xl underline text-black-1",href:"https://docs.crustcloud.io",target:"_blank",children:"Dev Guidance"}),(0,ec.tZ)(t2,{className:"mt-[-0.3rem]",onClose:()=>t&&t()})]}),(0,ec.tZ)("div",{children:(0,ec.tZ)(nz,{code:"\n##### React:\n\n~~~jsx\nimport { DragStorage } from '@cloud3/react-widgets'\nexport function(){\n return(\n \n )\n}\n~~~\n \n \n\n##### Vue:\n~~~jsx\n\n\n~~~\n"})})]})})}let nF=eo.memo(()=>{let[e,t]=(0,eo.useState)(!1),[n,a]=(0,eo.useState)(!1),[i,l]=(0,eo.useState)(!1),[r,s]=(0,eo.useState)(!1);return(0,ec.BX)("div",{id:"widget",className:"w-full pb-20 pt-16 px-12 flex flex-col items-center justify-center text-black bg-[#F5F5F5]",children:[(0,ec.BX)("div",{className:"w-full max-w-[1112px] text-lg",children:[(0,ec.tZ)(eP,{className:"w-full mb-8",text:"Web3 Storage Widgets"}),(0,ec.tZ)("p",{className:"w-full text-left text-2xl text-black-3 mb-20",children:"Users should own their contents and take full control of them just like what they do to their assets, but they do not."}),(0,ec.BX)("div",{className:"flex justify-between",children:[(0,ec.BX)("div",{className:"w-[405px] flex flex-col items-center",children:[(0,ec.tZ)(tU,{}),(0,ec.tZ)("p",{className:"mt-14 text-black-3",children:"Web3 Content Widgets contains several easy-integrating, non-intrusive widges that helps Dapps to manage decentralized IPFS storage and give back content ownership to users."})]}),(0,ec.BX)("div",{className:"flex flex-col",children:[(0,ec.BX)("div",{className:"flex",children:[(0,ec.tZ)(tQ,{}),(0,ec.BX)("div",{className:"ml-9",children:[(0,ec.tZ)("h5",{className:"font-semibold text-[1.375rem] mb-4",children:"Rich-text Content Publisher Widget"}),(0,ec.tZ)("p",{className:"w-[490px] text-black-3",children:"This widget contains a rich-text editor that can auto upload contents to IPFS alongside the publish process. "}),(0,ec.BX)("div",{className:"flex mt-5 text-black-1",children:[(0,ec.tZ)(ej,{onClick:()=>t(!0),className:"btn-173",text:"Play Demo"}),(0,ec.tZ)(ej,{onClick:()=>a(!0),className:"btn-173 ml-5",text:"Show Code"})]})]})]}),(0,ec.BX)("div",{className:"flex mt-20",children:[(0,ec.tZ)(tK,{className:"mt-2"}),(0,ec.BX)("div",{className:"ml-9",children:[(0,ec.tZ)("h5",{className:"font-semibold text-[1.375rem] mb-4",children:"IPFS File Storage Widget"}),(0,ec.tZ)("p",{className:"w-[490px] text-black-3",children:"This widget helps applications/dapps to upload files of general types to IPFS and manage file storage for their users. "}),(0,ec.BX)("div",{className:"flex mt-5 text-black-1",children:[(0,ec.tZ)(ej,{onClick:()=>l(!0),className:"btn-173",text:"Play Demo"}),(0,ec.tZ)(ej,{onClick:()=>s(!0),className:"btn-173 ml-5",text:"Show Code"})]})]})]})]})]})]}),e&&(0,ec.tZ)(nW,{onClose:()=>t(!1)}),n&&(0,ec.tZ)(nG,{onClose:()=>a(!1)}),i&&(0,ec.tZ)(t5,{onClose:()=>l(!1)}),r&&(0,ec.tZ)(nH,{onClose:()=>s(!1)})]})}),nU=()=>(0,ec.BX)("div",{className:"w-full",children:[(0,ec.tZ)(tX,{}),(0,ec.tZ)(tH,{}),(0,ec.tZ)(nF,{}),(0,ec.tZ)(tl,{}),(0,ec.tZ)(tf,{})]});var nJ=n(38109),nQ=n(92339),nV=new class{async connect(){try{var e;let t=await this.wallet.reconnectSession();this.wallet.isConnected&&t.length||(t=await this.wallet.connect()),null===(e=this.wallet.connector)||void 0===e||e.on("disconnect",()=>{this.wallet.disconnect(),this.account=null}),this.account=t[0]}catch(n){console.error(n)}}isConnected(){return this.wallet.isConnected&&!!this.account}disconnect(){this.wallet.disconnect(),this.account=null}constructor(){this.account=null,this.wallet=new nQ.DQ({chainId:eY.pg}),this.wallet.reconnectSession().then(e=>{var t;null===(t=this.wallet.connector)||void 0===t||t.on("disconnect",()=>{this.wallet.disconnect(),this.account=null}),e.length>0&&(this.account=e[0])})}},nK=n(48764).Buffer;function nq(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auth",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,[a,i]=(0,eo.useState)(localStorage.getItem(e)||""),{signTypedDataAsync:l}=(0,nJ.yw)(),{chain:r}=(0,nJ.LN)(),s=r&&r.id;r&&r.unsupported;let{address:c}=(0,nJ.mA)(),o=nV.isConnected(),d=ep(async a=>{let r=localStorage.getItem(e)||"";if((!l||!c||!s)&&!o)throw"not connect wallet";o&&(s=eY.pg,c="0x".concat(nV.account));let d=eJ()().unix();if(t&&r){let u=JSON.parse(window.atob(r)).data;if(u.domain.chainId==="".concat(s)&&u.message.signingAddress===c&&u.message.tokenId===a&&(0===u.message.expirationTimestamp||u.message.expirationTimestamp-d>300))return i(r),r}let m=n<=0?0:eJ()().add(n,"hours").unix(),p={domain:{chainId:"".concat(s),name:"Cloud3.cc",verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",version:"1"},message:{description:"Sign for W3 Bucket Access Authentication",signingAddress:c,tokenAddress:o?eY.fL:eY.Jh,effectiveTimestamp:d,expirationTimestamp:m},primaryType:"W3Bucket",types:{W3Bucket:[{name:"description",type:"string"},{name:"signingAddress",type:"address"},{name:"tokenAddress",type:"address"},{name:"effectiveTimestamp",type:"uint256"},{name:"expirationTimestamp",type:"uint256"}]}};a&&(p.message.tokenId=a,p.types.W3Bucket.push({name:"tokenId",type:"string"})),await e5(800);let y="";if(o){let h=nK.from(JSON.stringify({domain:p.domain,types:p.types,value:p.message})),f=await nV.wallet.signData([{data:h,message:"For authentication"}],nV.account);y=window.btoa(String.fromCharCode.apply(null,f[0]))}else y=await l({domain:p.domain,types:p.types,value:p.message});let g=window.btoa(JSON.stringify({data:p,signature:y}));return localStorage.setItem(e,g),i(g),g});return[d,a]}function n_(){return nq("for_mint",!0,3)}function n$(){return nq("auth",!0,12)}var n0=n(63750),n1=n(86893);let n2=eo.memo(e=>{let{className:t,...n}=e;return(0,ec.tZ)("span",{...n,className:ew()(t," font-SquadaOne text-[2.5rem]"),children:"Crust Cloud"})});var n5=n(82775);let n3=eo.memo(e=>{let{onClose:t}=e,{connectAsync:n,connectors:a,data:i}=(0,nJ.$4)(),{switchNetworkAsync:l}=(0,nJ.g0)(),r=(0,eC.s0)(),s=ep(async()=>{try{let e=await (async()=>{let e=await nw()();if(e&&e.isMetaMask){await e.request({method:"eth_requestAccounts"});let t=new nZ.Q(e),n=t.getSigner(),a=await n.getChainId();if(eY.k0.has(a))return a}return console.warn("Cannot get chainId from provider or unsupported chain, use ".concat(eY.XL[0].id)),eY.XL[0].id})(),t=new n5.i({chains:[eY.k0.get(e)]});console.info("data:",i),console.info("cts:",a),(!i||i.chain.unsupported)&&l?await l(e):await n({chainId:e,connector:t}),r("/buckets")}catch(s){console.error(s)}}),c=ep(async()=>{try{await nV.connect(),r("/buckets")}catch(e){console.error(e)}});return(0,ec.BX)(t0,{outClick:t,children:[(0,ec.tZ)(t$,{title:"Connect Wallet",onClose:t}),(0,ec.BX)("div",{onClick:s,className:"bg-[#ececec] hover:bg-[#dfdfdf] h-14 mt-5 flex px-6 py-3 cursor-pointer justify-between items-center",children:[(0,ec.tZ)(tM,{className:" text-[1.75rem]"}),(0,ec.tZ)("div",{className:" text-black-1 text-sm",children:"MetaMask"}),(0,ec.tZ)("div",{className:" w-[1.75rem]"})]}),(0,ec.BX)("div",{onClick:c,className:"bg-[#ececec] hover:bg-[#dfdfdf] h-14 mt-5 flex px-6 py-3 cursor-pointer justify-between items-center",children:[(0,ec.tZ)(tS,{className:" text-[1.75rem]"}),(0,ec.tZ)("div",{className:" text-black-1 text-sm",children:"PeraWallet"}),(0,ec.tZ)("div",{className:" w-[1.75rem]"})]})]})});var n4=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BucketMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"EditionPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"EditionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITIONS_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_TOKEN_ID_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"}],"name":"getBucketEditionPrices","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"activeOnly","type":"bool"}],"name":"getBucketEditions","outputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"},{"internalType":"uint256","name":"currentSupplyMinted","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEdition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","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":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"prices","type":"tuple[]"}],"name":"setBucketEditionPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEditionParams[]","name":"editions","type":"tuple[]"}],"name":"setBucketEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","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":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]'),n6=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"BucketMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"EditionPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"editionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"name":"EditionUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"PermanentURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITIONS_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_MAX_MINTABLE_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EDITION_TOKEN_ID_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_EDITION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"}],"name":"getBucketEditionPrices","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"activeOnly","type":"bool"}],"name":"getBucketEditions","outputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"},{"internalType":"uint256","name":"currentSupplyMinted","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEdition[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"string","name":"uri","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","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":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.EditionPrice[]","name":"prices","type":"tuple[]"}],"name":"setBucketEditionPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"editionId","type":"uint256"},{"internalType":"uint256","name":"capacityInGigabytes","type":"uint256"},{"internalType":"uint256","name":"maxMintableSupply","type":"uint256"}],"internalType":"struct BucketEditionUpgradable.BucketEditionParams[]","name":"editions","type":"tuple[]"}],"name":"setBucketEditions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","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":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"currency","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]');let n8=[];function n7(){let{chain:e}=(0,nJ.LN)(),t=e&&e.id,{address:n}=(0,nJ.mA)(),a=nV.isConnected();return t&&((0,eY._D)(t),n8=t===eV.c.arbitrumGoerli.id||t===eV.c.arbitrum.id?n4:n6),(0,eo.useMemo)(()=>n&&eY.k0.has(t)||a,[n,t,a])}var n9=n(60155),ae=n(62313);let at=eQ.TQ||eQ.Cg?"Claim your test version W3Bucket NFT and start your decentralized cloud storage experience on Crust Cloud testnet. To continue, please connect your Ethereum wallet and switch to Goerli testnet.":"W3Bucket runs on Ethereum mainnet. To start your decentralized cloud storage experience, please connect your Ethereum wallet.",an=eo.memo(e=>{let{menuId:t,children:n,...a}=e,{address:i}=(0,nJ.mA)(),{chain:l}=(0,nJ.LN)(),r=n7(),s=nV.isConnected();s&&(i="0x".concat(nV.account));let c=(0,eo.useMemo)(()=>[{id:1,icon:n0.QdO,text:"W3Buckets",path:"/buckets"},{id:2,icon:tB,text:"Settings",path:"/settings"},{id:3,icon:"cru-fo-homework",text:"Docs",url:"https://docs.crustcloud.io"}],[]),o=(0,eC.s0)(),[d,u]=(0,eo.useState)(!1);(0,eo.useEffect)(()=>{r&&u(!1)},[r]);let{disconnect:m}=(0,nJ.qL)(),p=ep(()=>{m(),localStorage.removeItem("for_mint"),localStorage.removeItem("auth"),localStorage.removeItem("for_upload"),nV.disconnect(),o("/buckets")}),y=(0,eo.useRef)(null),h=(0,ae.Z)(y);return(0,ec.tZ)("div",{...a,className:ew()(a.className," w-full h-screen min-h-max text-black-1"),children:(0,ec.BX)("div",{className:" w-full flex h-full",children:[(0,ec.BX)("div",{className:"h-full w-64 flex flex-col border-r-8 border-solid border-[#EEEEEE]",children:[(0,ec.BX)("div",{className:"my-8 flex items-center mx-auto",children:[(0,ec.tZ)(n2,{className:"text-black-1"}),r&&(0,ec.tZ)("div",{className:ew()(" ml-4 text-xs px-[0.39rem] py-[0.13rem] mb-[-0.42rem] text-white",eQ.TQ||eQ.Cg?"bg-gray-11":"bg-blue-2"),children:s?"Algorand":l.name.replace(" ","")})]}),(0,ec.tZ)("div",{className:"flex-1",children:c.map((e,n)=>(0,ec.BX)("div",{className:ew()(" pl-10 py-4 text-lg cursor-pointer ",{"bg-black-1":e.id===t,"text-white":e.id===t,"!text-gray-7 !bg-transparent":!r}),onClick(){r&&(e.path?o(e.path):e.url&&e$(e.url))},children:[(0,ec.tZ)(t_,{icon:r?e.icon:n9.gMo,className:" text-2xl inline-block align-middle"}),(0,ec.tZ)("span",{className:"ml-3 align-middle",children:e.text})]},"menu_".concat(n)))}),(0,ec.tZ)(ej,{ref:y,className:ew()("w-[12.8125rem] h-[3.375rem] text-lg self-end mx-auto mb-10",{" hidden":!r}),onClick:p,text:h?"Disconnect":eq(s?i.slice(2):i,6,6)})]}),r?n:(0,ec.BX)("div",{className:"flex-1 flex px-[15%] pt-[30vh] h-full flex-col items-center",children:[(0,ec.tZ)("div",{className:" text-xl text-black text-center",children:at}),(0,ec.tZ)(ej,{text:"Connect Wallet",className:"mt-8",onClick:()=>u(!0)})]}),d&&(0,ec.tZ)(n3,{onClose:()=>u(!1)})]})})});var aa=n(89211),ai=n(69293);let al=eo.memo(function(e){let{text:t,dropData:n,onChange:a,className:i}=e,[l,r]=(0,aa.Z)(!1),s=(0,eo.useRef)();(0,ai.Z)(s,()=>l&&r(!1));let c=e=>{r(!1),a&&a(e)};return(0,ec.BX)("div",{className:"text-black relative",ref:s,children:[(0,ec.tZ)(ej,{className:"btn-173",text:t,onClick:()=>r(!l)}),l&&(0,ec.tZ)("ul",{className:"text-black absolute w-full bg-white mt-3 border-1 border-gray-300 top-10 left-0 p-2 text-sm",children:n&&n.length>0&&n.map((e,t)=>(0,ec.BX)("li",{onClick:()=>c(e.value),className:"h-10 cursor-pointer leading-10 hover:bg-zinc-200 px-2 flex items-center",children:[e.icon&&(0,ec.tZ)(t_,{icon:e.icon,className:"text-sm mr-3"}),e.text]},"dropdown".concat(t)))})]})}),ar=eo.memo(function(e){let{text:t,status:n,className:a}=e;return(0,ec.BX)("div",{className:ew()("flex items-center text-sm text-black border-1 h-14 w-full px-5","success"===n?"border-[#32CB9D] bg-green-50":"border-[#EF4C56] bg-rose-50"),children:[(0,ec.tZ)(t_,{icon:"success"===n?t1.mny:t1.LHV,className:ew()("text-xl mr-3","success"===n?"text-[#32CB9D]":"text-[#EF4C56]")}),(0,ec.tZ)("span",{children:t})]})});function as(){let{store:{currentGateway:e},oUpdate:t}=ex(),n=(0,eo.useMemo)(()=>e||function(){let e=localStorage.getItem("last_gateway"),t=eY.gi.find(t=>t.value===e);return(console.info("last-:",t),t)?t:eY.gi[0]}(),[e]),a=ep(e=>{t({currentGateway:e}),localStorage.setItem("last_gateway",e.value)});return{list:eY.gi,setCurrent:a,current:n}}function ac(e){let{total:t,pgSize:n,pgNum:a,onChange:i,className:l}=e,r=Math.ceil(t/n),s=(0,eo.useMemo)(()=>r<=1?[]:r<=6?eF().range(r).map(e=>({name:"".concat(e+1)})):a<=3?eF().range(a+1).map(e=>({name:"".concat(e+1)})).concat([{name:"..."},{name:""+r}]):a>=r-2?[{name:"1"},{name:"..."}].concat(eF().range(a-2,r).map(e=>({name:"".concat(e+1)}))):(console.log([{name:"1"},{name:"..."},{name:a-1+""},{name:a+""},{name:a+1+""},{name:"..."},{name:r+""}]),[{name:"1"},{name:"..."},{name:a-1+""},{name:a+""},{name:a+1+""},{name:"..."},{name:r+""}]),[r,a]),c=()=>{i&&a{i&&a>1&&i(eF().toNumber(a-1))};return(0,ec.tZ)("div",{className:ew()("flex justify-center text-gray-400 text-sm mt-5",l),children:(0,ec.BX)("div",{className:"flex",children:[r>1&&(0,ec.tZ)("span",{onClick:o,className:"mr-8 cursor-pointer",children:"<"}),s.map((e,t)=>(0,ec.tZ)("div",{className:ew()({"text-black":e.name===""+a,omit:"..."===e.name},"mr-8 cursor-pointer"),onClick(){i&&"..."!==e.name&&i(eF().toNumber(e.name))},children:e.name},"key_page_".concat(t))),r>1&&(0,ec.tZ)("span",{onClick:c,className:"cursor-pointer",children:">"})]})})}var ao=n(40344),ad=n(24762),au=n(20640),am=n.n(au);function ap(e){let t="https://api.crustcloud.io";return eQ.TQ&&(t="https://beta-api.crustcloud.io"),eQ.Cg&&(t="https://test-api.crustcloud.io"),"".concat(t).concat(e)}function ay(e){let t="https://pin.crustcloud.io";return eQ.TQ&&(t="https://beta-pin.crustcloud.io"),eQ.Cg&&(t="https://test-pin.crustcloud.io"),"".concat(t).concat(e)}function ah(e){if(200===e.data.code)return e.data.data;throw{_type:"ResError",...e.data}}var af=n(81338),ag=new af.default.Algodv2(eY.GG,eY.EH);let ab=()=>{let{bucketId:e}=(0,eC.UO)(),t=(0,eC.s0)(),n="\n**Upload**\xa0file with the standard\xa0[IPFS API](https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-add)\xa0and get the CID:\n\n~~~bash\ncurl -X POST 'https:///api/v0/add?pin=true' --header 'Authorization: Bearer ' --form 'path=@\"\"'\n~~~\n\n**Pin**\xa0the CID with the standard\xa0[IPFS Pinning Service API](https://ipfs.github.io/pinning-services-api-spec/#operation/addPin):\n\n~~~bash\ncurl -X POST '".concat(ay("/psa/pins"),'\' --header \'Authorization: Bearer \' --data-raw \'{\n "cid": "",\n "name": ""\n}\'\n~~~\n');return(0,ec.BX)(ec.HY,{children:[(0,ec.BX)("div",{className:"sticky top-0 bg-white px-8 pt-16 flex items-center pb-5 mb-2 min-w-[62rem]",children:[(0,ec.tZ)(t_,{icon:n0.QdO,className:"text-xl mr-2"}),(0,ec.tZ)("span",{className:"mr-2 cursor-pointer",onClick(){t("/buckets")},children:"W3Buckets"}),(0,ec.tZ)(t_,{icon:n1.Tfp,className:"mr-2"}),(0,ec.tZ)("span",{children:"W3BUCKET(".concat(e,")")})]}),(0,ec.tZ)("div",{className:"px-8 pb-8 text-lg border-b-8 border-solid border-[#eeeeee] min-w-[62rem]",children:(0,ec.BX)("div",{className:" border border-black-1 border-solid px-8 pt-6 pb-5",children:[(0,ec.tZ)("div",{className:" text-xl font-medium",children:"Guidance on Storage"}),(0,ec.tZ)("div",{className:" my-4",children:"Files can be uploaded and decentralized pinned to IPFS by using this web interface, or by CLI as shown in the curl sample below."}),(0,ec.tZ)(nz,{code:n}),(0,ec.tZ)("div",{className:" mt-8 text-xl font-medium",children:"Get more references"}),(0,ec.BX)("div",{className:" mt-4 flex flex-wrap",children:[(0,ec.tZ)("a",{className:" underline text-black-1 mr-5",target:"_blank",href:"https://docs.crustcloud.io/w3bucket/aboutnft",children:"General Guidance on W3Bucket"}),(0,ec.tZ)("a",{className:" underline text-black-1 mr-5",target:"_blank",href:"https://docs.crustcloud.io/w3bucket/uploadfile",children:"Using APIs and W3Auth"})]})]})})]})},av=e=>new Promise((t,n)=>{let a=localStorage.getItem(e+"_files");a?t(JSON.parse(a)):n()}),ax=(e,t)=>new Promise(n=>{t&&localStorage.setItem(e+"_files",JSON.stringify(t)),n(!0)}),aA=eo.memo(()=>{let{bucketId:e,ipnsId:t}=(0,eC.UO)(),[,n]=(0,eo.useMemo)(()=>e1(e),[e]),a=(0,eo.useRef)(null),i=(0,eo.useRef)(null),[l,r]=(0,eo.useState)({progress:0,status:"stop",errorMsg:""}),[s,c]=(0,eo.useState)(1),[o,d]=(0,eo.useState)(""),[u,m]=(0,eo.useState)(""),[p,y]=(0,eo.useState)([]),h=ta(),[f,g]=(0,eo.useState)(null),[b]=nq("for_upload",!1,1),[v]=n$(),x=(0,eC.s0)(),{address:A}=(0,nJ.mA)(),w=nV.isConnected();(0,eo.useMemo)(()=>{x("/buckets")},[A]),(0,tk.tf)(()=>{av(e).then(e=>{y(e)}).catch(()=>{y([])})}),(0,ao.Z)(async()=>{if(w)try{let e=await ag.accountAssetInformation(nV.account,parseInt(n)).do();e&&e["asset-holding"]&&0!==e["asset-holding"].amount||x("/buckets")}catch(t){console.error(t)}},[n,w]);let{current:Z}=as(),{value:k}=(0,ao.Z)(async()=>{let e=await e9.Z.request({method:"POST",params:{arg:t},url:"".concat(Z.value,"/api/v0/name/resolve")}),n=await e9.Z.request({url:"".concat(Z.value).concat(e.data.Path)});return n.data},[t]),{value:N}=(0,ao.Z)(async()=>{let e=await v(),n=await e9.Z.request({headers:{Authorization:"Bearer ".concat(e)},method:"GET",url:ap("/auth/bucket/".concat(t))});return n.data.data},[t]),{fFiles:T,total:I}=(0,eo.useMemo)(()=>{let e=[];p&&(e=p);let t=eF().filter(e,e=>e.name.indexOf(u.trim())>-1);t=t.sort(function(e,t){return t.createTime-e.createTime});let n=eF().chunk(t,10),a=t.length;return{fFiles:n,total:a}},[u,p]);(0,eo.useEffect)(()=>{ad.Z.rebuild()},[p,T]),(0,eo.useMemo)(()=>{p&&p.length>0&&ax(e,p)},[p]),(0,eo.useMemo)(()=>{if(k&&k.length){if(p){p.map(e=>{for(let t=0;t!t.has(e.cid)&&t.set(e.cid,1)))}else y(k)}},[k]);let C=()=>{a.current.value="",i.current.value=""},B=e=>{let t=e.target.files,a=0;if(!t.length)return!1;let i=!0;for(let l=0;l64){h.error("The file name cannot exceed 64 characters."),C(),i=!1;break}if(N){let{maxStorageSize:s,usedStorageSize:c}=N;if(a>s-c)return h.error("No enough space for this file/folder!"),C(),!1}if(!i)return!1;b(n).then(async e=>{try{let n=0,i=e9.Z.CancelToken.source();g(i),r({progress:0,status:"upload",errorMsg:""});let l=new FormData;if(1===t.length)l.append("file",t[0],t[0].name);else if(t.length>1){for(let s of t)l.append("file",s,s._webkitRelativePath||s.webkitRelativePath);n=1}C();let c=await tt({cancelToken:i.token,data:l,endpoint:Z.value,authBasic:"Bearer ".concat(e),onProgress(e){r({progress:Math.round(99*e),status:"upload",errorMsg:""})}});g(null);let o="",d="";if("string"==typeof c){let u=c.replaceAll("}\n{","},{"),m=JSON.parse("[".concat(u,"]")),h=m.length-1;o=m[h].Hash,d=m[h].Name}else o=c.Hash,d=c.Name;if(!o||!d)return r({progress:0,status:"fail",errorMsg:""}),!1;let f=await e9.Z.request({data:{cid:o,name:d,meta:{gatewayId:1}},cancelToken:i.token,headers:{Authorization:"Bearer ".concat(e)},method:"POST",url:ay("/psa/pins")}),{error:b}=f.data;if(b)return r({progress:0,status:"fail",errorMsg:b.details?b.details:""}),!1;r({progress:100,status:"success",errorMsg:""}),y(p.concat([{name:d,cid:o,fileSize:a,fileType:n,createTime:eJ()().format("X").valueOf(),isNew:!0}]))}catch(v){throw console.error(v),v}}).catch(e=>{console.log(e.toString()),C()})},M=e=>{"file"===e?a.current.click():"folder"===e&&i.current.click()},S=()=>{m(o)},E=e=>{let t=window.event||e;13==t.keyCode&&S()},X=()=>{"upload"===l.status&&f&&(f.cancel("stop"),g(null)),r({progress:0,status:"stop",errorMsg:""})};return(0,ec.BX)(an,{menuId:1,children:[(0,ec.tZ)("div",{className:"flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:"relative",children:[(0,ec.tZ)(ab,{}),(0,ec.BX)("div",{className:"p-8 flex-1 text-lg v-full flex flex-col min-w-[62rem]",children:[(0,ec.BX)("div",{className:"sticky top-[6.5rem] bg-white w-full flex items-center z-10",children:[(0,ec.tZ)(al,{dropData:[{text:"File",icon:n1.tHe,value:"file"},{text:"Folder",icon:n1.QoU,value:"folder"}],text:"Upload",onChange:M}),(0,ec.tZ)("input",{ref:a,type:"file",hidden:!0,onChange:B}),(0,ec.tZ)("input",{ref:i,type:"file",hidden:!0,webkitdirectory:"",directory:!0,onChange:B}),(0,ec.tZ)("span",{className:"ml-5",children:"Thunder Gateway Seattle, US"}),(0,ec.tZ)("div",{className:"flex-1"}),(0,ec.BX)("div",{className:"relative w-1/2 h-12 max-w-sm border-solid border-black-1 border rounded overflow-hidden",children:[(0,ec.tZ)("input",{className:"w-full h-full pl-5 pr-10 active:border-0",onKeyDown:E,onChange:e=>d(e.target.value)}),(0,ec.tZ)(t_,{icon:n1.jRj,className:"text-2xl absolute top-[0.7rem] right-2 cursor-pointer",onClick:S})]})]}),(0,ec.BX)("div",{className:"sticky top-36 bg-white py-4 flex items-center font-medium border-b-1 border-solid border-b-black-1 pt-5",children:[(0,ec.tZ)("div",{className:"flex-initial w-[25%] md:w-[20%] pl-3",children:"File Name"}),(0,ec.tZ)("div",{className:"flex-initial w-[20%] md:w-[25%]",children:"CID"}),(0,ec.tZ)("div",{className:"flex-initial w-[30%]",children:"Link"}),(0,ec.tZ)("div",{className:"flex-initial w-[10%]",children:"File Size"}),(0,ec.tZ)("div",{className:"flex-initial w-[15%]",children:"TimeStamp"})]}),(0,ec.tZ)("div",{className:" text-sm text-gray-6",children:T&&T[s-1]&&T[s-1].map((e,t)=>(0,ec.BX)("div",{className:ew()("flex items-center pt-4 pb-8",e.isNew?"text-gray-300":""),children:[(0,ec.tZ)("div",{className:"flex-initial w-[25%] md:w-[20%] pl-3",children:(0,ec.BX)("div",{className:"flex items-center pr-8",children:[(0,ec.tZ)("span",{className:"truncate","data-tip":e.name.length>20?e.name:"",children:e.name}),1===e.fileType&&(0,ec.tZ)(t_,{className:"ml-2 min-w-[14px]",icon:n1.QoU})]})}),(0,ec.tZ)("div",{className:"flex-initial w-[20%] md:w-[25%]",children:(0,ec.tZ)("span",{"data-tip":e.cid,"data-for":"cidColumn",children:eq(e.cid,10,10)})}),(0,ec.tZ)("div",{className:"flex-initial w-[30%] truncate pr-8","data-for":"linkColumn","data-tip":"".concat(eY.HE,"/ipfs/").concat(e.cid),children:"".concat(eY.HE,"/ipfs/").concat(e.cid)}),(0,ec.tZ)("div",{className:"flex-initial w-[10%]",children:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!+e)return"0 B";let n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(t<0?0:t))," ").concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}(e.fileSize)}),(0,ec.tZ)("div",{className:"flex-initial w-[15%] text-gray-6",children:e.isNew?(0,ec.tZ)("span",{"data-tip":"The ".concat(0===e.fileType?"file":"folder"," has been successfully uploaded to your bucket. It takes several minutes to finalize the decentralized storage and IPNS update processes."),children:(0,ec.tZ)(t_,{icon:n0.kjE})}):eJ()(1e3*e.createTime).format("YYYY-MM-DD HH:mm:ss")})]},"files_".concat(t)))}),(0,ec.tZ)(ac,{total:I,pgSize:10,pgNum:s,onChange(e){c(e)}})]})]})}),"stop"!==l.status&&(0,ec.BX)(t0,{children:[(0,ec.tZ)(t$,{title:"Upload File",onClose:X}),(0,ec.BX)("div",{className:"bg-white mt-5 flex py-3 cursor-pointer justify-between items-center h-20",children:["upload"===l.status&&(0,ec.tZ)(eR,{value:l.progress}),"success"===l.status&&(0,ec.tZ)(ar,{text:"Upload successful",status:l.status}),"fail"===l.status&&(0,ec.tZ)(ar,{text:l.errorMsg?l.errorMsg:"Upload fail",status:l.status}),"cancel"===l.status&&(0,ec.tZ)(ar,{text:"Upload cancel",status:"fail"})]})]}),(0,ec.tZ)(ad.Z,{id:"cidColumn",effect:"solid",isCapture:!0,delayHide:250,clickable:!0,getContent:e=>(0,ec.tZ)("div",{className:"flex items-center",children:(0,ec.BX)("div",{className:"inline-block w-[13rem] break-words",children:[e,(0,ec.tZ)(t_,{className:"ml-2 cursor-pointer inline-block",onClick(){am()(e),h.success("copy success")},icon:n1.C3L})]})})}),(0,ec.tZ)(ad.Z,{id:"linkColumn",effect:"solid",isCapture:!0,delayHide:250,clickable:!0,getContent:e=>(0,ec.tZ)("div",{className:"flex items-center",children:(0,ec.BX)("div",{className:"inline-block w-[15rem] break-words",children:[e,(0,ec.tZ)(t_,{className:"ml-2 cursor-pointer inline-block",onClick(){am()(e),h.success("copy success")},icon:n1.C3L})]})})})]})}),aw=eo.memo(e=>{let{text:t="Empty",empty_attr:n={},text_attr:a={},...i}=e;return(0,ec.BX)("div",{...i,className:ew()(i.className,"text-gray-7 flex flex-col items-center"),children:[(0,ec.tZ)(tE,{...n,className:ew()(" text-8xl",null==n?void 0:n.className)}),!!t&&(0,ec.tZ)("div",{...a,className:ew()(" text-2xl",a.className),children:t})]})}),aZ=eo.memo(e=>{var t,n,a,i;let{data:l,className:r}=e,{chain:s}=(0,nJ.LN)(),c=(0,eC.s0)(),o=nV.isConnected(),d=(0,eo.useMemo)(()=>l.maxStorageSize/1024/1024/1024,[l]),u=(0,eo.useMemo)(()=>e4(d),[d]),m=(0,eo.useMemo)(()=>e4(l.usedStorageSize/1024/1024/1024,2),[l]),p=(0,eo.useMemo)(()=>e2(d,l.tokenId),[l,d]),y=()=>{c("/bucket/".concat(p,"/").concat(l.ipnsId))};return(0,ec.BX)("div",{className:ew()("h-min p-5 md:p-2 border border-solid border-black-1",r),children:[(0,ec.tZ)("img",{className:"w-full aspect-[360/531] object-contain",src:e6(l.metadata.image.replace("ipfs://",""))}),(0,ec.tZ)("div",{className:" text-lg font-semibold mt-[0.625rem] truncate",children:"W3BUCKET(".concat(p,")")}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Current Usage"}),(0,ec.BX)("div",{children:[(0,ec.tZ)("span",{className:"text-orange-15",children:m}),"/",u]})]}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Files"}),(0,ec.tZ)("div",{children:"".concat(l.fileCount," Files")})]}),(0,ec.BX)("div",{className:"flex text-sm my-[2px] justify-between",children:[(0,ec.tZ)("div",{children:"Created"}),(0,ec.tZ)("div",{children:eJ()(1e3*l.mintTimestamp).format("YYYY-MM-DD")})]}),(0,ec.BX)("div",{className:"flex text-xs my-2 justify-between",children:[(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:(t=l.ipnsId,"".concat(eY.gi[0].value,"/ipns/").concat(t)),children:"IPNS Link"}),(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:o?(n=eY.fL,"".concat(eY.sr,"/address/").concat(n)):(a=s.id,i=eY.Jh,"".concat(e3(a),"/address/").concat(i)),children:"View NFT Contract"}),(0,ec.tZ)("a",{className:" text-blue-3",target:"_blank",href:e6(l.metadataCid),children:"View Metadata"})]}),(0,ec.tZ)(ej,{onClick:y,className:"!w-full mt-[2px] text-lg !py-1",text:"Enter W3Bucket"})]})}),ak=eo.memo(()=>{let e=n7(),t=nV.isConnected(),{address:n}=(0,nJ.mA)(),[a]=n$(),{value:i,loading:l}=(0,ao.Z)(async()=>{if((!e||!n)&&!t)return[];let i=await a(),l=await e9.Z.get(ap("/auth/bucket/list"),{headers:{Authorization:"Bearer ".concat(i)}});return ah(l).sort(function(e,t){return t.mintTimestamp-e.mintTimestamp})},[e,t,n]),r=(0,eC.s0)(),s=(0,eo.useCallback)(()=>r("/mint"),[r]);return(0,ec.tZ)(an,{menuId:1,children:(0,ec.BX)("div",{className:"flex-1 h-full overflow-y-auto",children:[(0,ec.BX)("div",{className:"px-8 relative pb-8",children:[(0,ec.BX)("div",{className:"sticky top-0 pt-10 bg-white ",children:[(0,ec.BX)("div",{className:" w-full flex justify-between pb-5 whitespace-nowrap ",children:[(0,ec.BX)("div",{className:" inline-block text-2xl self-center font-medium h-min",children:["Your W3Buckets(",(null==i?void 0:i.length)||0,")"]}),(0,ec.tZ)(ej,{className:"whitespace-nowrap w-max",text:"Mint a New W3Bucket",onClick:s})]}),(0,ec.tZ)("div",{className:"h-5 border-t-1 border-solid border-black-1"})]}),i&&!l&&(0,ec.tZ)("div",{className:ew()("w-full overflow-y-auto gap-5 grid grid-cols-[repeat(auto-fill,_minmax(305px,_1fr))]",i.length<3?"grid-cols-[repeat(auto-fill,_minmax(310px,310px))]":""),children:i.map((e,t)=>(0,ec.tZ)(aZ,{data:e},"bucket_".concat(t)))})]}),!l&&1>(0,eH.size)(i)&&(0,ec.tZ)(aw,{text:"No Buckets",className:" h-[calc(100%_-_11rem)] justify-center"}),l&&(0,ec.tZ)(eN,{className:" h-[calc(100%_-_11rem)] justify-center"})]})})});function aN(e){return(0,ec.tZ)("svg",{width:"1em",height:"1em",viewBox:"0 0 11 9",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,ec.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.4496 2.29301C10.8401 1.90248 10.8401 1.26932 10.4496 0.878796C10.0591 0.488271 9.42591 0.488271 9.03538 0.878796L4.08564 5.82854L1.96432 3.70722C1.57379 3.3167 0.940626 3.3167 0.550102 3.70722C0.159577 4.09775 0.159577 4.73091 0.550102 5.12144L3.37853 7.94986C3.76905 8.34039 4.40222 8.34039 4.79274 7.94986L10.4496 2.29301Z"})})}let aT=eo.memo(e=>{let{finish:t,active:n,text:a,type:i}=e;return(0,ec.BX)("div",{className:" flex-1",children:[(0,ec.BX)("div",{className:"flex items-center",children:[(0,ec.tZ)("div",{className:ew()(" flex-1 h-[2px] ",{"bg-orange-15":(n||t)&&"left"!==i,"bg-gray-16":!(n||t)&&"left"!==i})}),(0,ec.tZ)("div",{className:ew()(" w-4 h-4 rounded-lg bg-white flex items-center justify-center",{" !bg-orange-15":n||t}),children:t?(0,ec.tZ)(aN,{className:"text-xs relative text-white"}):(0,ec.tZ)("div",{className:ew()(" w-2 h-2 rounded bg-gray-16",{" !bg-white":n})})}),(0,ec.tZ)("div",{className:ew()(" flex-1 h-[2px] ",{"bg-orange-15":t&&"right"!==i,"bg-gray-16":!t&&"right"!==i})})]}),(0,ec.tZ)("div",{className:ew()("text-center text-gray-8 mt-2",{" !text-orange-15":n}),children:a})]})}),aI=eo.memo(e=>{let{data:t,current:n}=e;return(0,ec.tZ)("div",{className:" flex",children:t.map((e,a)=>(0,ec.tZ)(aT,{text:e,type:0===a?"left":a===t.length-1?"right":"mid",finish:a{n?t({mintData:aC}):t(t=>{let{mintData:n}=t;return{mintData:{...n||aC,..."function"==typeof e?e(n):e}}})},[t]);return(0,eo.useMemo)(()=>[e,n],[e,n])}function aM(e){return e.map(e=>e.fmtPrice+" "+e.symbol).join(" or ")}let aS=eo.memo(e=>{let{editions:t,onNext:n}=e,{chain:a}=(0,nJ.LN)(),i=a&&a.id;nV.isConnected()&&(i=eY.pg);let[l,r]=aB();(0,eo.useEffect)(()=>{void 0===l.editionId&&t.length&&r({chainId:i,editionId:t[0].id,price:t[0].prices[0]})},[l,r,t]);let s=l.editionId,c=(0,eo.useMemo)(()=>t.find(e=>e.id===s),[t,s]);return(0,ec.BX)("div",{className:" px-10 pt-9",children:[(0,ec.BX)("div",{className:" text-2xl",children:["Now you are starting to mint a new W3Bucket!",(0,ec.tZ)("br",{}),"First, choose your preferred bucket type:"]}),(0,ec.tZ)(ej,{text:"W3Bucket",disHover:!0,className:" !border-2 !border-orange-15 !text-orange-15 text-2xl py-[9px] !w-[11.25rem] mt-5"}),(0,ec.tZ)("div",{className:" text-2xl mt-12",children:"Select your preferred bucket size:"}),(0,ec.tZ)("div",{className:"flex items-center mt-5",children:t.map((e,t)=>(0,ec.BX)("div",{className:ew()("mr-4 text-center"),children:[(0,ec.tZ)(ej,{text:e4(e.capacityInGb),disHover:e.id===s,className:ew()(" font-medium !border-2 text-2xl mt-5 !w-[11.25rem] py-[9px] cursor-pointer",{"!border-orange-15 !text-orange-15":e.id===s}),onClick(){r({chainId:i,editionId:e.id,price:e.prices[0]})}}),(0,ec.tZ)("span",{className:" whitespace-nowrap text-sm mt-2 font-light",children:"".concat(aM(e.prices))})]},"editions_".concat(t)))}),c&&(0,ec.BX)("div",{className:" text-2xl mt-12",children:["Your W3Bucket NFT to be minted:"," ",(0,ec.tZ)("span",{className:" text-orange-15",children:"W3Bucket"}),","," ",(0,ec.tZ)("span",{className:" text-orange-15",children:e4(c.capacityInGb)}),(0,ec.tZ)("br",{}),"Payable: ",aM(c.prices)]}),(0,ec.tZ)(ej,{text:"Next Step",className:"mt-12 text-lg !w-[11.25rem] !h-[3.375rem]",onClick(){console.info("click:"),n()},disabled:!c})]})});var aE=n(61501);let aX=["A-b1","A1","A2"],aO=eo.memo(e=>{let{type:t,value:n,...a}=e;return n?(0,ec.BX)("div",{...a,children:["A1"===t&&(0,ec.tZ)(aE.QRNormal,{value:n}),"A2"===t&&(0,ec.tZ)(aE.QRNormal,{value:n,type:"round",posType:"round"}),"A3"===t&&(0,ec.tZ)(aE.QRNormal,{value:n,type:"rand",posType:"planet"}),"A-a1"===t&&(0,ec.tZ)(aE.QRLine,{value:n,direction:"h-v",posType:"roundRect"}),"A-a2"===t&&(0,ec.tZ)(aE.QRLine,{value:n,direction:"cross",posType:"rect"}),"A-b1"===t&&(0,ec.tZ)(aE.QRFunc,{value:n,type:"round",posType:"round"}),"A-b2"===t&&(0,ec.tZ)(aE.QRFunc,{value:n,type:"round",posType:"round",funcType:"B"}),"C1"===t&&(0,ec.tZ)(aE.QRImage,{value:n,size:150}),"C2"===t&&(0,ec.tZ)(aE.QRResImage,{value:n,alignType:"bw",timingType:"bw"}),"SP-1"===t&&(0,ec.tZ)(aE.QRDsj,{value:n}),"SP-2"===t&&(0,ec.tZ)(aE.QRRandRect,{value:n}),"SP-3"===t&&(0,ec.tZ)(aE.QRBubble,{value:n})]}):null}),aj={gray:["#EEEEEE","#FFFFFF","#131521"],yellow:["#FFDC5E","#E9C132","#131521"],red:["#FF6B81","#F4526A","#131521"],purple:["#B073EF","#925DC8","#FFFFFF"],green:["#27C282","#1EA966","#FFFFFF"],blue:["#58AEFF","#3895EB","#FFFFFF"]},aP=eo.memo(eo.forwardRef((e,t)=>{let{size:n}=e,[{color:a,qrcode:i,ipns:l}]=aB(),[r,s,c]=aj[a];return(0,ec.BX)("div",{ref:t,id:"generate_bucket_image",className:" w-[22.5rem] h-[33.1875rem] relative p-6 flex flex-col justify-between",style:{backgroundColor:r},children:[(0,ec.BX)("div",{className:"flex items-center",style:{color:c},children:[(0,ec.tZ)("div",{className:"p-[3px] overflow-hidden rounded-xl",style:{backgroundColor:s},children:(0,ec.tZ)(tE,{style:{fontSize:"2.1875rem"}})}),(0,ec.tZ)("span",{className:" font-Roboto text-3xl font-medium ml-[0.625rem]",children:"W3BUCKET"})]}),l?(0,ec.tZ)(n0.gHS,{className:" text-[18.75rem]",style:{color:s}}):(0,ec.tZ)(n0.QdO,{className:" text-[18.75rem]",style:{color:s}}),(0,ec.tZ)("div",{className:" font-bold text-end",style:{color:c},children:e4(n)}),(0,ec.tZ)(aO,{value:l,type:i,className:" w-[11.5rem] h-[11.5rem] absolute left-[5rem] bottom-[7.4rem]"})]})}));var aW=n(46293),aL=n(48764).Buffer;function aR(e){let{ipns:t,onContinue:n}=e,[a,i]=(0,eo.useState)(!1);return(0,ec.BX)("div",{className:"pl-12 flex-1 break-words",children:[(0,ec.BX)("div",{className:"p-8 border-solid border-black-1 border flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-xl mb-4",children:"Tip:"}),(0,ec.BX)("div",{className:"text-lg",children:["This is the QR Code of the"," ",(0,ec.tZ)("span",{className:"font-semibold",children:"IPNS name"})," for this W3Bucket. This IPNS name is a ",(0,ec.tZ)("span",{className:"font-semibold",children:"unique"})," and"," ",(0,ec.tZ)("span",{className:"font-semibold",children:"immutable"})," identifier on IPFS that ",(0,ec.tZ)("span",{className:"font-semibold",children:"permanently"})," points to the storage history (a .json file, also acts as the list of the bucket storage) of this W3Bucket."]}),(0,ec.tZ)("div",{className:"text-lg mt-7",children:"You can always fetch the storage history via any IPFS gateway or IPFS node."}),(0,ec.tZ)(ej,{text:"Got it",className:" mt-8 !w-[8.25rem] h-11 self-center",onClick:()=>i(!0)})]}),a&&(0,ec.BX)("div",{className:" mt-10 text-lg flex flex-col",children:[(0,ec.tZ)("div",{className:" break-all text-center",children:t}),(0,ec.tZ)("div",{className:" font-medium text-center",children:"The IPNS name for this W3Bucket has successfully generated and published to IPFS."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-6 !w-[8.25rem] h-11 self-center",onClick:n})]})]})}function aY(e){let t=eF().keys(aj),{onContinue:n}=e,[a,i]=aB();return(0,ec.BX)("div",{className:"px-20 flex-1 flex flex-col justify-center",children:[(0,ec.BX)("div",{className:"flex",children:[(0,ec.tZ)("div",{className:" whitespace-nowrap mr-10 mt-3",children:"Background Color"}),(0,ec.tZ)("div",{className:" flex flex-wrap items-center",children:t.map(e=>(0,ec.tZ)("div",{style:{backgroundColor:aj[e][0]},onClick:()=>i({color:e}),className:ew()("rounded-xl w-5 h-5 overflow-hidden cursor-pointer mr-[1.875rem] my-4",{"border-solid border-orange-15 border":a.color===e})},"mint_colors_".concat(e)))})]}),(0,ec.BX)("div",{className:"flex mt-8",children:[(0,ec.tZ)("div",{className:" mr-16 whitespace-nowrap",children:"QR Code Style"}),(0,ec.tZ)("div",{className:"flex items-center flex-wrap",children:aX.map(e=>(0,ec.tZ)("span",{onClick:()=>i({qrcode:e}),className:ew()(" whitespace-nowrap rounded-md px-2 py-1 overflow-hidden cursor-pointer mr-[1rem] bg-slate-50",{"border-solid border-orange-15 border":a.qrcode===e}),children:e},"mint_colors_".concat(e)))})]}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-16 !w-[11.25rem] !py-3 self-center",onClick:n})]})}function aD(e){let{data:[t,n]}=e;return(0,ec.BX)(ec.HY,{children:[(0,ec.BX)("div",{className:" text-sm mt-4",children:[t,":"]}),(0,ec.tZ)("div",{className:" text-sm text-gray-7",children:n})]})}function az(e){let{onContinue:t}=e,[n,a]=aB(),[i,l]=em(!1),[r]=n_(),[,s]=ey(),c=ed(),o=ep(async()=>{i||s(async()=>{try{l(!0),await e5(100);let e=document.getElementById("generate_bucket_image");if(!e)return l(!1);let t=await r(),i=await (0,aW.SE)(e),s=new FormData;s.append("file",i,"bucket_image.png");let o=await tt({data:s}),d=await i.arrayBuffer(),u=aL.from(d),m=e7(u);await tn(o.Hash,"bucket_image.png");let p=await e9.Z.post(ap("/auth/bucket/metadata/generate"),{uuid:n.uuid,cid:o.Hash,imageIntegrity:m},{headers:{Authorization:"Bearer ".concat(t)}}),y="success"===p.data.message;if(!y)throw p.data.message;let h=null;for(;c.safe&&(await e5(1e4),!(h=await e9.Z.get(ap("/auth/bucket/uuid/".concat(n.uuid)),{headers:{Authorization:"Bearer ".concat(t)}}).then(ah).catch(()=>null))||!h.metadataTxHash););if(!c.safe)return;a({metadata:h.metadata,metadataCID:h.metadataCid,metadataTX:h.metadataTxHash})}catch(f){console.error(f)}l(!1)})}),[d,u]=em(!1);return(0,ec.BX)(ec.HY,{children:[!n.metadata&&!i&&(0,ec.BX)("div",{className:"px-12 flex-1 flex flex-col items-center justify-center",children:[(0,ec.tZ)("div",{className:" text-2xl text-center",children:"The metadata file (including this profile image) for your W3Bucket NFT has been fully generated. Click the Continue button to process decentralized storage for the metadata."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-8 !w-[11.25rem] !py-3 self-center",onClick:o})]}),i&&(0,ec.tZ)(eN,{className:"px-12 flex-1 justify-center",text:"The NFT metadata is being decentralized stored and it will be the very first file stored in this W3Bucket! Please wait..."}),n.metadata&&!i&&(0,ec.BX)("div",{className:"px-12 flex-1 flex flex-col items-center",children:[(0,ec.BX)("div",{className:"p-8 w-full border-solid border-black-1 border flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-xl mb-4",children:"Tip:"}),(0,ec.BX)("div",{className:"flex",children:[(0,ec.BX)("div",{className:"flex-1 mr-8",children:[(0,ec.tZ)("div",{className:"font-semibold text-lg",children:"NFT Metadata.json file"}),(0,ec.tZ)(aD,{data:["IPFS CID",eq(n.metadataCID,10,10)]}),(0,ec.tZ)(aD,{data:["Crust Network Storage Order TXID",eq(n.metadataTX,10,10)]}),(0,ec.tZ)(aD,{data:["IPNS",eq(n.ipns,10,10)]}),(0,ec.tZ)(aD,{data:["Storage Protocol","Crust"]})]}),(0,ec.BX)("div",{className:"flex-1",children:[(0,ec.tZ)("div",{className:"font-semibold text-lg",children:"NFT profile image"}),(0,ec.tZ)(aD,{data:["IPFS CID",eq(n.metadata.image.replace("ipfs://",""),10,10)]}),(0,ec.tZ)(aD,{data:["Crust Network Storage Order TXID",eq(n.metadata.dStorage.dstorage_note,10,10)]}),(0,ec.tZ)("div",{className:" text-sm font-medium mt-6",children:"You can check them later in the W3Bucket description information."}),(0,ec.tZ)(ej,{text:"Got it",className:" mt-3 !w-[8.25rem] h-11 self-center",onClick:()=>u(!0)})]})]})]}),d&&(0,ec.BX)("div",{className:" mt-10 text-lg flex flex-col",children:[(0,ec.tZ)("div",{className:" font-medium text-center",children:"Congrats! The metadata of this W3Bucket is fully processed. You will soon get this truly Web3 storage bucket NFT! Click the Continue button to the last step."}),(0,ec.tZ)(ej,{text:"Continue",className:" mt-6 !w-[8.25rem] h-11 self-center",onClick:()=>t()})]})]})]})}let aG=eo.memo(e=>{let{editions:t,onNext:n}=e,[a,i]=aB(),l=a.editionId,r=(0,eo.useMemo)(()=>t.find(e=>e.id===l)||t[0],[t,l]),[s,c]=em(0),o=(0,eo.useCallback)(()=>c(e=>e+1),[c]),d=a.ipns,[u]=n_(),[,m]=ey();return(0,eo.useEffect)(()=>{d?a.metadataTX?c(3):d&&c(e=>0===e?1:e):m(()=>u().then(e=>e9.Z.post(ap("/auth/ipns/gen"),{bucketInfo:JSON.stringify({chainId:a.chainId,editionId:a.editionId})},{headers:{Authorization:"Bearer ".concat(e)}}).then(ah)).then(e=>{i({ipns:e.ipnsId,uuid:e.uuid}),c(1)}).catch(e=>{console.info("error:",e),n(-1)}))},[d,a]),(0,ec.BX)("div",{className:" px-10 pt-9 flex",children:[(0,ec.tZ)(aP,{size:r.capacityInGb}),0===s&&(0,ec.tZ)(eN,{className:" self-center text-center p-9",text:"Generating a unique IPNS name for this W3Bucket... Please wait."}),1===s&&(0,ec.tZ)(aR,{ipns:d,onContinue:o}),2===s&&(0,ec.tZ)(aY,{onContinue:o}),3===s&&(0,ec.tZ)(az,{onContinue:n})]})});function aH(){let e=(0,nJ.yL)(),{data:t}=(0,nJ.mx)();return(0,nJ.cq)({address:eY.Jh,abi:n8,signerOrProvider:t||e})}var aF=n(61744),aU=n(2984),aJ=JSON.parse('{"name":"W3Bucket","methods":[{"name":"create","args":[],"returns":{"type":"void"}},{"name":"bootstrap","args":[{"type":"pay","name":"seed"}],"returns":{"type":"void"}},{"name":"set_bucket_edition","args":[{"type":"(uint64,uint64,uint64)","name":"edition"}],"returns":{"type":"void"}},{"name":"get_bucket_edition_ids","args":[],"returns":{"type":"string"}},{"name":"is_active_bucket_edition","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"bool"}},{"name":"get_bucket_edition","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"(uint64,bool,uint64,uint64,uint64)"}},{"name":"disable_bucket_edition","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"void"}},{"name":"enable_bucket_edition","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"void"}},{"name":"set_bucket_edition_prices","args":[{"type":"uint64","name":"edition_id"},{"type":"(uint64,uint64)[]","name":"prices"}],"returns":{"type":"void"}},{"name":"get_bucket_edition_prices","args":[{"type":"uint64","name":"edition_id"}],"returns":{"type":"(uint64,uint64)[]"}},{"name":"mint","args":[{"type":"txn","name":"seed"},{"type":"uint64","name":"edition_id"},{"type":"string","name":"metadata_hash"},{"type":"string","name":"uri"}],"returns":{"type":"uint64"}},{"name":"claim","args":[{"type":"asset","name":"token"}],"returns":{"type":"void"}}],"networks":{},"desc":"This is web3 bucket contract used to apply storage"}');function aQ(e){let{data:[t,n,a],target:i="_blank"}=e;return(0,ec.BX)("div",{className:" flex items-center text-2xl",children:[(0,ec.BX)("div",{className:" mr-2",children:[t,":"]}),a?(0,ec.tZ)("a",{className:" underline underline-offset-2 !text-black-1",target:i,href:a,children:n}):(0,ec.tZ)("div",{className:" underline underline-offset-2",children:n})]})}let aV=eo.memo(e=>{var t,n,a,i;let{editions:l,onNext:r}=e,{chain:s}=(0,nJ.LN)(),c=s&&s.id,[o,d]=aB(),u=o.editionId,m=(0,eo.useMemo)(()=>l.find(e=>e.id===u),[l,u]),[p,y]=em(!1),h=aH(),{data:f}=(0,nJ.mx)(),{address:g}=(0,nJ.mA)(),[b]=n_(),v=ed(),x=nV.isConnected(),A=ep(async()=>{if(!p&&x&&o.price&&o.editionId){y(!0);try{var e;let t=new af.default.ABIContract(aJ),n=await ag.getTransactionParams().do();n.flatFee=!0,n.fee=2e3;let a=(e=nV.wallet,async(t,n)=>{let a=eH.map(n,e=>({txn:t[e]})),i=await e.signTransaction([a]);return Promise.resolve(i)}),i=aF.parseUnits(o.price.fmtPrice,o.price.decimals),l="0x0"===o.price.currency?af.default.makePaymentTxnWithSuggestedParamsFromObject({from:nV.account,to:eY.fL,amount:BigInt(i.toString()),suggestedParams:n}):af.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:nV.account,to:eY.fL,suggestedParams:n,assetIndex:Number(o.price.currency.slice(2)),amount:BigInt(i.toString())}),s=[];s.push({appIndex:eY.PD,name:af.default.encodeUint64(o.editionId)});let c={appID:eY.PD,method:t.getMethodByName("mint"),methodArgs:[{txn:l,signer:a},o.editionId,e7(o.metadata),"ipfs://".concat(o.metadataCID,"#arc3")],sender:nV.account,signer:a,boxes:s,suggestedParams:n};"0x0"!==o.price.currency&&Object.assign(c,{assets:[parseInt(o.price.currency.slice(2))]});let u=new af.default.AtomicTransactionComposer;u.addMethodCall(c);let m=await u.execute(ag,4),A=Number(m.methodResults[0].returnValue);console.log("Minted bucket token_id:".concat(A));let w=af.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:nV.account,to:nV.account,suggestedParams:n,assetIndex:A,amount:0}),Z=new af.default.AtomicTransactionComposer;Z.addTransaction({txn:w,signer:a}),Z.addMethodCall({appID:eY.PD,method:t.getMethodByName("claim"),methodArgs:[A],sender:nV.account,signer:a,suggestedParams:n}),await Z.execute(ag,4)}catch(k){console.log(k);return}}else{if(p||!h||!g||!o.price||!o.editionId||!f)return;y(!0);let N=aF.parseUnits(o.price.fmtPrice,o.price.decimals);try{let T="0x0000000000000000000000000000000000000000"===o.price.currency,I=null;if(T)I=await h.mint(g,aF.parseUnits(o.editionId+"",0),o.price.currency,"ipfs://".concat(o.metadataCID),{value:N});else{let C=(0,aU.uN)({address:o.price.currency,abi:aU.em,signerOrProvider:f}),B=await h.estimateGas.mint(g,aF.parseUnits(o.editionId+"",0),o.price.currency,"ipfs://".concat(o.metadataCID)).catch(()=>aF.parseUnits("396277",0));await C.approve(eY.Jh,N),I=await h.mint(g,aF.parseUnits(o.editionId+"",0),o.price.currency,"ipfs://".concat(o.metadataCID),{gasLimit:B})}await I.wait(1)}catch(M){console.error(M);return}}try{let S=await b(),E=null;for(;;){if(!v.safe)return;if((E=await e9.Z.get(ap("/auth/bucket/uuid/".concat(o.uuid)),{headers:{Authorization:"Bearer ".concat(S)}}).then(ah).catch(()=>null))&&E.tokenId&&E.mintTxHash)break;await e5(1e4)}d({mintTx:E.mintTxHash,tokenId:E.tokenId}),r()}catch(X){console.error(X)}y(!1)}),w=(0,eC.s0)(),Z=ep(()=>{d({},!0),w("/buckets")}),k=(0,eo.useMemo)(()=>o.mintTx&&m&&o.tokenId?e2(m.capacityInGb,o.tokenId):"",[o,m]);return(0,ec.BX)("div",{className:" px-10 pt-9 flex",children:[(0,ec.tZ)(aP,{size:m.capacityInGb}),!p&&!o.mintTx&&(0,ec.BX)("div",{className:"flex flex-1 px-12 flex-col items-center justify-center",children:[(0,ec.tZ)("div",{className:" text-2xl text-center",children:"Choose your preferred payment method and click the ‘Confirm and Pay’ button to proceed:"}),(0,ec.tZ)("div",{className:" flex ",children:m.prices.map((e,t)=>{var n,a;return(0,ec.BX)("div",{className:ew()("mr-4 text-center"),children:[(0,ec.tZ)(ej,{text:e.symbol,disHover:e.currency===(null===(n=o.price)||void 0===n?void 0:n.currency),className:ew()("font-medium !border-2 text-2xl mt-5 !w-[11.25rem] !py-[9px] cursor-pointer",{"!border-orange-15 !text-orange-15":e.currency===(null===(a=o.price)||void 0===a?void 0:a.currency)}),onClick(){d({price:e})}}),(0,ec.tZ)("span",{className:" text-sm mt-2 font-light whitespace-nowrap",children:"".concat(e.fmtPrice," ").concat(e.symbol," payable in 15 min")})]},"edition_price_".concat(t))})}),(0,ec.tZ)(ej,{text:"Confirm and Pay",className:"mt-12 text-lg w-48 h-[3.375rem]",onClick:A})]}),p&&(0,ec.tZ)(eN,{className:"flex-1 px-12 justify-center",text:"Payment Tx sent, please wait for a while to get on-chain confirmation..."}),!p&&o.mintTx&&(0,ec.BX)("div",{className:"flex flex-1 px-12 flex-col ",children:[(0,ec.BX)("div",{className:" text-2xl font-medium mb-8",children:["Congrats,",(0,ec.tZ)("br",{}),"You have completed all the minting processes for this W3Bucket NFT!"]}),(0,ec.tZ)(aQ,{data:["W3Bucket NFT Token ID",o.tokenId,x?(t=o.tokenId,"".concat(eY.sr,"/asset/").concat(t)):(n=o.tokenId,"".concat(e3(c),"/token/").concat(eY.Jh,"?a=").concat(n))]}),(0,ec.tZ)(aQ,{data:["Mint TX ID",eq(o.mintTx,9,5),x?(a=o.mintTx,"".concat(eY.sr,"/tx/").concat(a)):(i=o.mintTx,"".concat(e3(c),"/tx/").concat(i))]}),(0,ec.tZ)(aQ,{target:"_self",data:["W3Bucket Identifier",k,"/#/bucket/".concat(k,"/").concat(o.ipns)]}),(0,ec.tZ)("div",{className:" text-2xl font-medium mt-8",children:"Return to the W3Bucket Home Page and start your Crust Cloud journey. Bon Voyage!"}),(0,ec.tZ)(ej,{text:"Complete",className:" self-center text-lg !w-[11.25rem] h-[3.375rem] mt-20",onClick:Z})]})]})});var aK=n(48764).Buffer,aq=new class{async getEditionNum(){var e;return null!==(e=this.getApplicationGlobalValue("edition_num","string"))&&void 0!==e?e:0}async getEditionIds(){let e=await this.getApplicationBoxByName("edition_ids","string"),t=af.default.ABIType.from("uint64[30]");return t.decode(e.value).map(e=>Number(e))}async getEditionById(e){let t=af.default.ABIType.from("uint64"),n=t.encode(e),a=await this.client.getApplicationBoxByName(eY.PD,n).do(),i=af.default.ABIType.from("(uint64,uint64,uint64,bool,uint8[".concat(a.value.length-25,"])")),l=i.decode(a.value),r=l[3];if(!r)return null;let s=l[l.length-1],c=s.map(e=>Number(e)),o=af.default.ABIType.from("(uint64,uint64)[]"),d=o.decode(c),u=[];return d.map(e=>{u.push({currency:e[0].toString(),price:e[1].toString()})}),{id:e,maxMintableSupply:l[0],capacityInGigabytes:l[1],currentSupplyMinted:l[2],prices:u}}async getApplicationGlobalValue(e,t){let n=await this.client.getApplicationByID(eY.PD).do(),a=af.default.ABIType.from(t),i=a.encode(e).slice(-e.length),l=aK.from(i).toString("base64");for(let r of n.params["global-state"])if(r.key===l)return r.value.uint;return null}getApplicationBoxByName(e,t){let n=af.default.ABIType.from(t),a=n.encode(e).slice(-e.length);return this.client.getApplicationBoxByName(eY.PD,a).do()}constructor(){this.client=new af.default.Algodv2(eY.GG,eY.EH)}};async function a_(){let e=await aq.getEditionNum(),t=await aq.getEditionIds();console.info("edition num:".concat(e,",edition ids:").concat(t));let n=[];for(let a=0;a=1&&n.push({id:l.id,capacityInGb:Number(l.capacityInGigabytes),totalSupply:Number(l.maxMintableSupply),minted:Number(l.currentSupplyMinted),prices:r})}return console.info("editions:",n),n}let a$=eo.memo(()=>{let{value:e,loading:t}=function(){let e=aH(),{chain:t}=(0,nJ.LN)(),n=t&&t.id,{data:a}=(0,nJ.mx)(),i=nV.isConnected(),l=(0,ao.Z)(async()=>{if(e&&n&&a){let t=await e.getBucketEditions(!0);console.info("data:",t);let l=[];for(let r of t){if(r.maxMintableSupply.lte(r.currentSupplyMinted))continue;let s=await e.getBucketEditionPrices(r.editionId);console.info("prices:",s);let c=[];for(let o of s){let d=18,u="ETH";if("0x0000000000000000000000000000000000000000"!==o.currency){let m=(0,aU.uN)({address:o.currency,abi:aU.em,signerOrProvider:a});d=await m.decimals(),u=await m.symbol()}c.push({currency:o.currency,symbol:u,decimals:d,price:o.price.toString(),fmtPrice:aF.formatUnits(o.price,d)})}c.length>=1&&l.push({id:r.editionId.toNumber(),capacityInGb:r.capacityInGigabytes.toNumber(),totalSupply:r.maxMintableSupply.toNumber(),minted:r.currentSupplyMinted.toNumber(),prices:c})}return console.info("editions:",l),l}return i?a_():null},[e,n,a,i]);return(0,eo.useMemo)(()=>({...l,loading:l.loading}),[l])}(),n=(0,eC.s0)(),a=(0,eo.useMemo)(()=>["1.Select your preferred bucket","2.Process NFT metadata","3.Make payment and mint"],[]),[i,l]=em(-1),[r,s]=aB(),[c]=n_();(0,eo.useEffect)(()=>{let e=async()=>{try{if(console.info("do taks:"),!r.uuid)return l(0);let e=await c(),t=await e9.Z.get(ap("/auth/bucket/uuid/".concat(r.uuid)),{headers:{Authorization:"Bearer ".concat(e)}}).then(ah),n=r.editionId;if(t.metadata){let a=t.metadata.attributes.find(e=>"Edition"===e.trait_type);a&&(n=new Number(a.value).valueOf())}s({metadata:t.metadata,ipns:t.ipnsId,metadataTX:t.metadataTxHash,metadataCID:t.metadataCid,mintTx:t.mintTxHash,tokenId:t.tokenId,editionId:n}),t.mintTxHash?l(2):t.metadataTxHash?l(1):l(0)}catch(i){l(0)}};return e(),()=>{s({},!0)}},[]);let o=(0,eo.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return l(t=>t+e)},[l]),{address:d}=(0,nJ.mA)();return(0,eo.useEffect)(()=>{d&&(s({},!0),l(0))},[d]),(0,ec.tZ)(an,{menuId:1,children:(0,ec.tZ)("div",{className:" flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:" relative px-8 pb-10",children:[(0,ec.BX)("div",{className:" sticky top-0 z-10 bg-white pt-16 pb-3",children:[(0,ec.tZ)("div",{className:"inline-block",onClick(){s({},!0),n("/buckets")},children:(0,ec.BX)("div",{className:"flex items-center cursor-pointer",children:[(0,ec.tZ)(t_,{icon:"cru-fo-chevron-left",className:" mr-3"}),(0,ec.tZ)("span",{children:"Exit Mint Process"})]})}),(0,ec.tZ)("div",{className:"h-px bg-black-1 my-7"}),(0,ec.tZ)(aI,{data:a,current:i})]}),e&&(0,ec.BX)(ec.HY,{children:[0===i&&!t&&(0,ec.tZ)(aS,{editions:e,onNext:o}),1===i&&(0,ec.tZ)(aG,{editions:e,onNext:o}),i>=2&&(0,ec.tZ)(aV,{editions:e,onNext:o})]}),(t||i<0)&&(0,ec.tZ)(eN,{className:" text-black-1 justify-center h-[calc(100vh_-_17.75rem)]"})]})})})}),a0=eo.memo(e=>{let{options:t,current:n,perfix:a,className:i,onOptionChange:l,...r}=e,s=(0,eo.useMemo)(()=>a?"".concat(a," ").concat(n.text):n.text,[n,a]),c=(0,eo.useRef)(),[o,d]=(0,aa.Z)(!1);return(0,ai.Z)(c,()=>o&&d(!1)),(0,ec.BX)("div",{...r,ref:c,className:ew()(i," relative text-gray-7"),children:[(0,ec.BX)("div",{className:" whitespace-nowrap cursor-pointer flex items-center",onClick:d,children:[s," ",(0,ec.tZ)("span",{className:"cru-fo-chevron-down ml-3"})]}),o&&(0,ec.tZ)("div",{className:" absolute top-full right-0 shadow-md bg-white z-10",children:t.map((e,t)=>(0,ec.tZ)("div",{className:ew()(" py-[8px] px-4 whitespace-nowrap cursor-pointer",{"bg-black-1 text-white":e===n}),onClick(){l&&l(e),d(!1)},children:e.text},"options_".concat(t)))})]})}),a1=eo.memo(()=>{let{list:e,current:t,setCurrent:n}=as(),a=(0,eo.useMemo)(()=>e.map(e=>({...e,text:"".concat(e.name," ").concat(e.location)})),[e]),i=(0,eo.useMemo)(()=>[{text:"Random"}],[]),[l,r]=(0,eo.useState)(()=>a.find(e=>e.value===t.value)),s=ep(t=>{r(t),n(e.find(e=>e.value===t.value))}),[c,o]=(0,eo.useState)(i[0]);return(0,ec.tZ)(an,{menuId:2,children:(0,ec.tZ)("div",{className:"flex-1 h-full overflow-y-auto",children:(0,ec.BX)("div",{className:" m-8 px-8 py-[1.5625rem] border-solid border-black-1 border min-w-[35rem]",children:[(0,ec.tZ)("div",{className:" font-medium text-xl",children:"Preferences"}),(0,ec.BX)("div",{className:" mt-4 whitespace-nowrap flex items-center",children:[(0,ec.tZ)("span",{className:"font-medium text-lg",children:"Choose preferred gateway :"}),(0,ec.tZ)(a0,{className:" ml-2",options:a,current:l,onOptionChange:s})]}),(0,ec.BX)("div",{className:" mt-4 whitespace-nowrap flex items-center",children:[(0,ec.tZ)("span",{className:"font-medium text-lg",children:"Gateway Match Strategy :"}),(0,ec.tZ)(a0,{className:" ml-2",options:i,current:c,onOptionChange:o})]})]})})})});function a2(){let{store:e,update:t}=ex(),n=e.toasts||[];return(0,eo.useEffect)(()=>{let e=setInterval(()=>{t(()=>(n.shift(),{toasts:n}))},3e3);return()=>clearInterval(e)},[n]),(0,ec.tZ)("div",{className:"fixed top-5 right-5 z-[50]",children:n.map((e,t)=>(0,ec.tZ)("div",{className:"flex py-2 cursor-pointer justify-between items-center",children:(0,ec.tZ)(ar,{text:e.msg,status:e.type})},"toasts".concat(t)))})}var a5=eo.memo(function(){let e=ev();return(0,ec.tZ)(eg,{value:e,children:(0,ec.BX)("div",{className:"App relative",id:"app-root",children:[(0,ec.tZ)(ad.Z,{effect:"solid",clickable:!0,delayHide:200,isCapture:!0,overridePosition(e,t,n,a){let{top:i,left:l}=e;return a.style.maxWidth="300px",a.style.wordBreak="break-all",{top:i,left:l}}}),(0,ec.tZ)("div",{className:"App overflow-y-auto",children:(0,ec.tZ)(eI.UT,{children:(0,ec.BX)(eC.Z5,{children:[(0,ec.tZ)(eC.AW,{path:"/",element:(0,ec.tZ)(nU,{})}),(0,ec.tZ)(eC.AW,{path:"/buckets",element:(0,ec.tZ)(ak,{})}),(0,ec.tZ)(eC.AW,{path:"/bucket/:bucketId/:ipnsId",element:(0,ec.tZ)(aA,{})}),(0,ec.tZ)(eC.AW,{path:"/settings",element:(0,ec.tZ)(a1,{})}),(0,ec.tZ)(eC.AW,{path:"/mint",element:(0,ec.tZ)(a$,{})})]})})}),(0,ec.tZ)(eT,{}),(0,ec.tZ)(a2,{})]})})})},36563:function(){},53555:function(){}}]); \ No newline at end of file diff --git a/_next/static/chunks/730.24aab07e05af5c5b.js b/_next/static/chunks/730.8ce76f11348f70ce.js similarity index 97% rename from _next/static/chunks/730.24aab07e05af5c5b.js rename to _next/static/chunks/730.8ce76f11348f70ce.js index 5c4f5fa..7e8b291 100644 --- a/_next/static/chunks/730.24aab07e05af5c5b.js +++ b/_next/static/chunks/730.8ce76f11348f70ce.js @@ -477,7 +477,7 @@ * * Copyright (c) 2014-2015 Jon Schlinkert, contributors. * Licensed under the MIT License - */ var r=n(47798);e.exports=function(e,t){if(!r(e)&&"function"!=typeof e)return{};var n={};if("string"==typeof t)return t in e&&(n[t]=e[t]),n;for(var i=t.length,o=-1;++o1e4)throw Error("References have circular dependency. Please, check them.");n[r]=e}),r=r.reverse(),n=n.map(function(t){return r.forEach(function(n){t=t.replace(RegExp("(\\"+i+n+"\\"+i+")","g"),e[0]+"$1"+e[1])}),t})});var a=RegExp("\\"+i+"([0-9]+)\\"+i);function s(e,t,n){for(var r,i=[],o=0;r=a.exec(e);){if(o++>1e4)throw Error("Circular references in parenthesis");i.push(e.slice(0,r.index)),i.push(s(t[r[1]],t)),e=e.slice(r.index+r[0].length)}return i.push(e),i}return o?n:s(n[0],n)}function n(e,t){if(t&&t.flat){var n,r=t&&t.escape||"___",i=e[0];if(!i)return"";for(var o=RegExp("\\"+r+"([0-9]+)\\"+r),a=0;i!=n;){if(a++>1e4)throw Error("Circular references in "+e);n=i,i=i.replace(o,s)}return i}return e.reduce(function e(t,n){return Array.isArray(n)&&(n=n.reduce(e,"")),t+n},"");function s(t,n){if(null==e[n])throw Error("Reference "+n+"is undefined");return e[n]}}function r(e,r){return Array.isArray(e)?n(e,r):t(e,r)}r.parse=t,r.stringify=n,e.exports=r},89435:function(e){"use strict";var t,n=59;function r(e){var r,i="&"+e+";";return(t=t||document.createElement("i")).innerHTML=i,((r=t.textContent).charCodeAt(r.length-1)!==n||"semi"===e)&&r!==i&&r}e.exports=r},57574:function(e,t,n){"use strict";var r=n(37452),i=n(93580),o=n(46195),a=n(79480),s=n(7961),l=n(89435);e.exports=B;var u={}.hasOwnProperty,c=String.fromCharCode,d=Function.prototype,p={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},f=9,h=10,m=12,g=32,b=38,y=59,v=60,w=61,E=35,S=88,x=120,_=65533,k="named",A="hexadecimal",T="decimal",C={};C[A]=16,C[T]=10;var R={};R[k]=s,R[T]=o,R[A]=a;var D=1,O=2,I=3,N=4,M=5,L=6,P=7,F={};function B(e,t){var n,r,i={};for(r in t||(t={}),p)n=t[r],i[r]=null==n?p[r]:n;return(i.position.indent||i.position.start)&&(i.indent=i.position.indent||[],i.position=i.position.start),U(e,i)}function U(e,t){var n,o,a,p,B,U,$,H,V,G,q,W,K,Y,Z,X,J,Q,ee,et=t.additional,en=t.nonTerminated,er=t.text,ei=t.reference,eo=t.warning,ea=t.textContext,es=t.referenceContext,el=t.warningContext,eu=t.position,ec=t.indent||[],ed=e.length,ep=0,ef=-1,eh=eu.column||1,em=eu.line||1,eg="",eb=[];for("string"==typeof et&&(et=et.charCodeAt(0)),X=ey(),H=eo?ev:d,ep--,ed++;++ep65535&&(U-=65536,G+=c(U>>>10|55296),U=56320|1023&U),U=G+c(U))):Y!==k&&H(N,Q)),U?(ew(),X=ey(),ep=ee-1,eh+=ee-K+1,eb.push(U),J=ey(),J.offset++,ei&&ei.call(es,U,{start:X,end:J},e.slice(K-1,ee)),X=J):(eg+=p=e.slice(K-1,ee),eh+=p.length,ep=ee-1)}else 10===B&&(em++,ef++,eh=0),B==B?(eg+=c(B),eh++):ew();return eb.join("");function ey(){return{line:em,column:eh,offset:ep+(eu.offset||0)}}function ev(e,t){var n=ey();n.column+=t,n.offset+=t,eo.call(el,F[e],n,e)}function ew(){eg&&(eb.push(eg),er&&er.call(ea,eg,{start:X,end:ey()}),eg="")}}function z(e){return e>=55296&&e<=57343||e>1114111}function j(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(65535&e)==65535||(65535&e)==65534}F[1]="Named character references must be terminated by a semicolon",F[O]="Numeric character references must be terminated by a semicolon",F[I]="Named character references cannot be empty",F[N]="Numeric character references cannot be empty",F[M]="Named character references must be known",F[L]="Numeric character references cannot be disallowed",F[P]="Numeric character references cannot be outside the permissible Unicode range"},91915:function(e){var t,n;t=self,n=function(){return(()=>{var e={192(e,t){var n,r,i=function(){var e,t,n=function(e,t){var n=e,r=l[t],i=null,o=0,a=null,s=[],c={},y=function(e,t){i=function(e){for(var t=Array(e),n=0;n=7&&x(e),null==a&&(a=A(n,r,s)),k(a,t)},v=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1||o<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||o<=t+r||(i[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},E=function(){for(var e=8;e>r&1);i[Math.floor(r/3)][r%3+o-8-3]=a}for(r=0;r<18;r+=1)a=!e&&1==(t>>r&1),i[r%3+o-8-3][Math.floor(r/3)]=a},_=function(e,t){for(var n=r<<3|t,a=u.getBCHTypeInfo(n),s=0;s<15;s+=1){var l=!e&&1==(a>>s&1);s<6?i[s][8]=l:s<8?i[s+1][8]=l:i[o-15+s][8]=l}for(s=0;s<15;s+=1)l=!e&&1==(a>>s&1),s<8?i[8][o-s-1]=l:s<9?i[8][15-s-1+1]=l:i[8][15-s-1]=l;i[o-8][8]=!e},k=function(e,t){for(var n=-1,r=o-1,a=7,s=0,l=u.getMaskFunction(t),c=o-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var d=0;d<2;d+=1)if(null==i[r][c-d]){var p=!1;s>>a&1)),l(r,c-d)&&(p=!p),i[r][c-d]=p,-1==(a-=1)&&(s+=1,a=7)}if((r+=n)<0||o<=r){r-=n,n=-n;break}}},A=function(e,t,n){for(var r=p.getRSBlocks(e,t),i=f(),o=0;o8*s)throw"code length overflow. ("+i.getLengthInBits()+">"+8*s+")";for(i.getLengthInBits()+4<=8*s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*s||(i.put(236,8),i.getLengthInBits()>=8*s));)i.put(17,8);return function(e,t){for(var n=0,r=0,i=0,o=Array(t.length),a=Array(t.length),s=0;s=0?h.getAt(m):0}}var g=0;for(p=0;pr)&&(e=r,t=n)}return t}())},c.createTableTag=function(e,t){e=e||2;var n="";n+='';for(var r=0;r";for(var i=0;i';n+=""}return(n+="")+"
"},c.createSvgTag=function(e,t,n,r){var i={};"object"==typeof arguments[0]&&(e=(i=arguments[0]).cellSize,t=i.margin,n=i.alt,r=i.title),e=e||2,t=void 0===t?4*e:t,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var o,a,s,l,u=c.getModuleCount()*e+2*t,d="";for(l="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+='"+(r.text?''+T(r.text)+"":"")+(n.text?''+T(n.text)+"":"")+'"},c.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var n=c.getModuleCount()*e+2*t,r=t,i=n-t;return w(n,n,function(t,n){if(r<=t&&t"};var T=function(e){for(var t="",n=0;n":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=r}}return t};return c.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,n,r,i,o,a=1*c.getModuleCount()+2*e,s=e,l=a-e,u={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "},p="";for(t=0;t=l?d[o]:u[o];p+="\n"}return a%2&&e>0?p.substring(0,p.length-a-1)+Array(a+1).join("▀"):p.substring(0,p.length-1)}(t);e-=1,t=void 0===t?2*e:t;var n,r,i,o,a=c.getModuleCount()*e+2*t,s=t,l=a-t,u=Array(e+1).join("██"),d=Array(e+1).join(" "),p="",f="";for(n=0;n>>8),t.push(255&a)):t.push(r)}}return t}};var r,i,o,a,s,l={L:1,M:0,Q:3,H:2},u=(r=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],i=1335,o=7973,s=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(a={}).getBCHTypeInfo=function(e){for(var t=e<<10;s(t)-s(i)>=0;)t^=i<=0;)t^=o<5&&(n+=3+o-5)}for(r=0;r=256;)t-=255;return e[t]}}}();function d(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},getLengthInBits:function(){return t},putBit:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n},h=function(e){var t=e,n=function(e){for(var t=0,n=0;n>>8&255)+(255&i),e.put(i,13),n+=2}if(n>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(var i=0;i0&&(t+=","),t+=e[n];return t+"]"}};return t},v=function(e){var t=e,n=0,r=0,i=0,o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return{read:function(){for(;i<8;){if(n>=t.length){if(0==i)return -1;throw"unexpected end of file./"+i}var e=t.charAt(n);if(n+=1,"="==e)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}var a=r>>>i-8&255;return i-=8,a}}},w=function(e,t,n){for(var r,i,o,a,s,l,u,c,d,p,f,h,m,g,b=(r=e,i=t,o=r,a=i,s=Array(r*i),l=function(e){for(var t=1<>>t!=0)throw"length over";for(;l+t>=8;)a.writeByte(255&(e<>>=8-l,c=0,l=0;c|=e<0&&a.writeByte(c)}});p.write(t,r);var f=0,h=String.fromCharCode(s[0]);for(f+=1;fi.size()&&(i.size()==1<255;)e.writeByte(255),e.writeBytes(t,n,255),n+=255;e.writeByte(t.length-n),e.writeBytes(t,n,t.length-n),e.writeByte(0),e.writeString(";")}}),v=0;v=6;)m(c>>>d-6),d-=6},h.flush=function(){if(d>0&&(m(c<<6-d),c=0,d=0),p%3!=0)for(var e=3-p%3,t=0;t>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e)},void 0===(r="function"==typeof(n=function(){return i})?n.apply(t,[]):n)||(e.exports=r)},676(e,t,n){"use strict";n.d(t,{default:()=>N});var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2||o&&a||s&&l)this._basicSquare({x:t,y:n,size:r,rotation:0});else{if(2===u){var c=0;return o&&s?c=Math.PI/2:s&&a?c=Math.PI:a&&l&&(c=-Math.PI/2),void this._basicCornerRounded({x:t,y:n,size:r,rotation:c})}if(1===u)return c=0,s?c=Math.PI/2:a?c=Math.PI:l&&(c=-Math.PI/2),void this._basicSideRounded({x:t,y:n,size:r,rotation:c})}}else this._basicDot({x:t,y:n,size:r,rotation:0})},e.prototype._drawExtraRounded=function(e){var t=e.x,n=e.y,r=e.size,i=e.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,l=i?+i(0,1):0,u=o+a+s+l;if(0!==u){if(u>2||o&&a||s&&l)this._basicSquare({x:t,y:n,size:r,rotation:0});else{if(2===u){var c=0;return o&&s?c=Math.PI/2:s&&a?c=Math.PI:a&&l&&(c=-Math.PI/2),void this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:c})}if(1===u)return c=0,s?c=Math.PI/2:a?c=Math.PI:l&&(c=-Math.PI/2),void this._basicSideRounded({x:t,y:n,size:r,rotation:c})}}else this._basicDot({x:t,y:n,size:r,rotation:0})},e.prototype._drawClassy=function(e){var t=e.x,n=e.y,r=e.size,i=e.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,l=i?+i(0,1):0;0!==o+a+s+l?o||s?a||l?this._basicSquare({x:t,y:n,size:r,rotation:0}):this._basicCornerRounded({x:t,y:n,size:r,rotation:Math.PI/2}):this._basicCornerRounded({x:t,y:n,size:r,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:n,size:r,rotation:Math.PI/2})},e.prototype._drawClassyRounded=function(e){var t=e.x,n=e.y,r=e.size,i=e.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,l=i?+i(0,1):0;0!==o+a+s+l?o||s?a||l?this._basicSquare({x:t,y:n,size:r,rotation:0}):this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:n,size:r,rotation:Math.PI/2})},e}();var p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]r||i&&i=(t-i.hideXDots)/2&&e<(t+i.hideXDots)/2&&n>=(t-i.hideYDots)/2&&n<(t+i.hideYDots)/2||(null===(r=v[e])||void 0===r?void 0:r[n])||(null===(o=v[e-t+7])||void 0===o?void 0:o[n])||(null===(a=v[e])||void 0===a?void 0:a[n-t+7])||(null===(s=w[e])||void 0===s?void 0:s[n])||(null===(l=w[e-t+7])||void 0===l?void 0:l[n])||(null===(u=w[e])||void 0===u?void 0:u[n-t+7]))}),this.drawCorners(),this._options.image?[4,this.drawImage({width:i.width,height:i.height,count:t,dotSize:r})]:[3,4];case 3:d.sent(),d.label=4;case 4:return[2]}})})},e.prototype.drawBackground=function(){var e,t,n,r=this._element,i=this._options;if(r){var o=null===(e=i.backgroundOptions)||void 0===e?void 0:e.gradient,a=null===(t=i.backgroundOptions)||void 0===t?void 0:t.color;if((o||a)&&this._createColor({options:o,color:a,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:"background-color"}),null===(n=i.backgroundOptions)||void 0===n?void 0:n.round){var s=Math.min(i.width,i.height),l=document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id","clip-path-background-color"),this._defs.appendChild(this._backgroundClipPath),l.setAttribute("x",String((i.width-s)/2)),l.setAttribute("y",String((i.height-s)/2)),l.setAttribute("width",String(s)),l.setAttribute("height",String(s)),l.setAttribute("rx",String(s/2*i.backgroundOptions.round)),this._backgroundClipPath.appendChild(l)}}},e.prototype.drawDots=function(e){var t,n,r=this;if(!this._qr)throw"QR code is not defined";var i=this._options,o=this._qr.getModuleCount();if(o>i.width||o>i.height)throw"The canvas is too small.";var a=Math.min(i.width,i.height)-2*i.margin,s=Math.floor((i.shape===g?a/Math.sqrt(2):a)/o),l=Math.floor((i.width-o*s)/2),u=Math.floor((i.height-o*s)/2),c=new d({svg:this._element,type:i.dotsOptions.type});this._dotsClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id","clip-path-dot-color"),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(t=i.dotsOptions)||void 0===t?void 0:t.gradient,color:i.dotsOptions.color,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:"dot-color"});for(var p=function(t){for(var i=function(i){return e&&!e(t,i)?"continue":(null===(n=f._qr)||void 0===n?void 0:n.isDark(t,i))?(c.draw(l+t*s,u+i*s,s,function(n,a){return!(t+n<0||i+a<0||t+n>=o||i+a>=o)&&!(e&&!e(t+n,i+a))&&!!r._qr&&r._qr.isDark(t+n,i+a)}),void(c._element&&f._dotsClipPath&&f._dotsClipPath.appendChild(c._element))):"continue"},a=0;a=m-1&&h<=b-m&&S>=m-1&&S<=b-m||Math.sqrt((h-E)*(h-E)+(S-E)*(S-E))>E?w[h][S]=0:w[h][S]=this._qr.isDark(S-2*m<0?S:S>=o?S-2*m:S-m,h-2*m<0?h:h>=o?h-2*m:h-m)?1:0}var x=function(e){for(var t=function(t){if(!w[e][t])return"continue";c.draw(y+e*s,v+t*s,s,function(n,r){var i;return!!(null===(i=w[e+n])||void 0===i?void 0:i[t+r])}),c._element&&_._dotsClipPath&&_._dotsClipPath.appendChild(c._element)},n=0;ns?l:s,d=document.createElementNS("http://www.w3.org/2000/svg","rect");if(d.setAttribute("x",String(o)),d.setAttribute("y",String(a)),d.setAttribute("height",String(s)),d.setAttribute("width",String(l)),d.setAttribute("clip-path","url('#clip-path-"+u+"')"),n){if("radial"===n.type)(t=document.createElementNS("http://www.w3.org/2000/svg","radialGradient")).setAttribute("id",u),t.setAttribute("gradientUnits","userSpaceOnUse"),t.setAttribute("fx",String(o+l/2)),t.setAttribute("fy",String(a+s/2)),t.setAttribute("cx",String(o+l/2)),t.setAttribute("cy",String(a+s/2)),t.setAttribute("r",String(c/2));else{var p=((n.rotation||0)+i)%(2*Math.PI),f=(p+2*Math.PI)%(2*Math.PI),h=o+l/2,m=a+s/2,g=o+l/2,b=a+s/2;f>=0&&f<=.25*Math.PI||f>1.75*Math.PI&&f<=2*Math.PI?(h-=l/2,m-=s/2*Math.tan(p),g+=l/2,b+=s/2*Math.tan(p)):f>.25*Math.PI&&f<=.75*Math.PI?(m-=s/2,h-=l/2/Math.tan(p),b+=s/2,g+=l/2/Math.tan(p)):f>.75*Math.PI&&f<=1.25*Math.PI?(h+=l/2,m+=s/2*Math.tan(p),g-=l/2,b-=s/2*Math.tan(p)):f>1.25*Math.PI&&f<=1.75*Math.PI&&(m+=s/2,h+=l/2/Math.tan(p),b-=s/2,g-=l/2/Math.tan(p)),(t=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id",u),t.setAttribute("gradientUnits","userSpaceOnUse"),t.setAttribute("x1",String(Math.round(h))),t.setAttribute("y1",String(Math.round(m))),t.setAttribute("x2",String(Math.round(g))),t.setAttribute("y2",String(Math.round(b)))}n.colorStops.forEach(function(e){var n=e.offset,r=e.color,i=document.createElementNS("http://www.w3.org/2000/svg","stop");i.setAttribute("offset",100*n+"%"),i.setAttribute("stop-color",r),t.appendChild(i)}),d.setAttribute("fill","url('#"+u+"')"),this._defs.appendChild(t)}else r&&d.setAttribute("fill",r);this._element.appendChild(d)},e}(),S="canvas";for(var x={},_=0;_<=40;_++)x[_]=_;let k={type:S,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:x[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000"},backgroundOptions:{round:0,color:"#fff"}};var A=function(){return(A=Object.assign||function(e){for(var t,n=1,r=arguments.length;nMath.min(t.width,t.height)&&(t.margin=Math.min(t.width,t.height)),t.dotsOptions=A({},t.dotsOptions),t.dotsOptions.gradient&&(t.dotsOptions.gradient=T(t.dotsOptions.gradient)),t.cornersSquareOptions&&(t.cornersSquareOptions=A({},t.cornersSquareOptions),t.cornersSquareOptions.gradient&&(t.cornersSquareOptions.gradient=T(t.cornersSquareOptions.gradient))),t.cornersDotOptions&&(t.cornersDotOptions=A({},t.cornersDotOptions),t.cornersDotOptions.gradient&&(t.cornersDotOptions.gradient=T(t.cornersDotOptions.gradient))),t.backgroundOptions&&(t.backgroundOptions=A({},t.backgroundOptions),t.backgroundOptions.gradient&&(t.backgroundOptions.gradient=T(t.backgroundOptions.gradient))),t}var R=n(192),D=n.n(R),O=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},I=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\r\n'+n],{type:"image/svg+xml"})]):[2,new Promise(function(n){return t.toBlob(n,"image/"+e,1)})]:[2,null]}})})},e.prototype.download=function(e){return O(this,void 0,void 0,function(){var t,n,r,i;return I(this,function(o){switch(o.label){case 0:if(!this._qr)throw"QR code is empty";return t="png",n="qr","string"==typeof e?(t=e,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):"object"==typeof e&&null!==e&&(e.name&&(n=e.name),e.extension&&(t=e.extension)),[4,this._getElement(t)];case 1:return(r=o.sent())&&("svg"===t.toLowerCase()?s("data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i='\r\n'+(i=(new XMLSerializer).serializeToString(r))),n+".svg"):s(r.toDataURL("image/"+t),n+"."+t)),[2]}})})},e}()}},t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(676)})().default},e.exports=n()},17563:function(e,t,n){"use strict";let r=n(70610),i=n(44020),o=n(80500),a=e=>null==e;function s(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{let i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[",i,"]"].join("")]:[...n,[c(t,e),"[",c(i,e),"]=",c(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[]"].join("")]:[...n,[c(t,e),"[]=",c(r,e)].join("")];case"comma":case"separator":return t=>(n,r)=>null==r||0===r.length?n:0===n.length?[[c(t,e),"=",c(r,e)].join("")]:[[n,c(r,e)].join(e.arrayFormatSeparator)];default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,c(t,e)]:[...n,[c(t,e),"=",c(r,e)].join("")]}}function l(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){r[e]=n;return}void 0===r[e]&&(r[e]={}),r[e][t[1]]=n};case"bracket":return(e,n,r)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){r[e]=n;return}if(void 0===r[e]){r[e]=[n];return}r[e]=[].concat(r[e],n)};case"comma":case"separator":return(t,n,r)=>{let i="string"==typeof n&&n.split("").indexOf(e.arrayFormatSeparator)>-1,o=i?n.split(e.arrayFormatSeparator).map(t=>d(t,e)):null===n?n:d(n,e);r[t]=o};default:return(e,t,n)=>{if(void 0===n[e]){n[e]=t;return}n[e]=[].concat(n[e],t)}}}function u(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function d(e,t){return t.decode?i(e):e}function p(e){return Array.isArray(e)?e.sort():"object"==typeof e?p(Object.keys(e)).sort((e,t)=>Number(e)-Number(t)).map(t=>e[t]):e}function f(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function h(e){let t="",n=e.indexOf("#");return -1!==n&&(t=e.slice(n)),t}function m(e){e=f(e);let t=e.indexOf("?");return -1===t?"":e.slice(t+1)}function g(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function b(e,t){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let n=l(t),r=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return r;for(let i of e.split("&")){let[a,s]=o(t.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator"].includes(t.arrayFormat)?s:d(s,t),n(d(a,t),s,r)}for(let c of Object.keys(r)){let f=r[c];if("object"==typeof f&&null!==f)for(let h of Object.keys(f))f[h]=g(f[h],t);else r[c]=g(f,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=p(n):e[t]=n,e},Object.create(null))}t.extract=m,t.parse=b,t.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let n=n=>t.skipNull&&a(e[n])||t.skipEmptyString&&""===e[n],r=s(t),i={};for(let o of Object.keys(e))n(o)||(i[o]=e[o]);let l=Object.keys(i);return!1!==t.sort&&l.sort(t.sort),l.map(n=>{let i=e[n];return void 0===i?"":null===i?c(n,t):Array.isArray(i)?i.reduce(r(n),[]).join("&"):c(n,t)+"="+c(i,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[n,r]=o(e,"#");return Object.assign({url:n.split("?")[0]||"",query:b(m(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:d(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0},n);let r=f(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),a=Object.assign(o,e.query),s=t.stringify(a,n);s&&(s=`?${s}`);let l=h(e.url);return e.fragmentIdentifier&&(l=`#${c(e.fragmentIdentifier,n)}`),`${r}${s}${l}`}},86893:function(e,t,n){"use strict";n.d(t,{C3L:function(){return o},QoU:function(){return s},Tfp:function(){return i},jRj:function(){return l},tHe:function(){return a}});var r=n(88357);function i(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"}}]})(e)}function o(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}},{tag:"path",attr:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}}]})(e)}function a(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}},{tag:"polyline",attr:{points:"13 2 13 9 20 9"}}]})(e)}function s(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}}]})(e)}function l(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"}},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}}]})(e)}},88357:function(e,t,n){"use strict";n.d(t,{w_:function(){return u}});var r=n(67294),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o=r.createContext&&r.createContext(i),a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function l(e){return e&&e.map(function(e,t){return r.createElement(e.tag,a({key:t},e.attr),l(e.child))})}function u(e){return function(t){return r.createElement(c,a({attr:a({},e.attr)},t),l(e.child))}}function c(e){var t=function(t){var n,i=e.attr,o=e.size,l=e.title,u=s(e,["attr","size","title"]),c=o||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),r.createElement("svg",a({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,u,{className:n,style:a(a({color:e.color||t.color},t.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),l&&r.createElement("title",null,l),e.children)};return void 0!==o?r.createElement(o.Consumer,null,function(e){return t(e)}):t(i)}},71471:function(e,t){"use strict";/** + */ var r=n(47798);e.exports=function(e,t){if(!r(e)&&"function"!=typeof e)return{};var n={};if("string"==typeof t)return t in e&&(n[t]=e[t]),n;for(var i=t.length,o=-1;++o1e4)throw Error("References have circular dependency. Please, check them.");n[r]=e}),r=r.reverse(),n=n.map(function(t){return r.forEach(function(n){t=t.replace(RegExp("(\\"+i+n+"\\"+i+")","g"),e[0]+"$1"+e[1])}),t})});var a=RegExp("\\"+i+"([0-9]+)\\"+i);function s(e,t,n){for(var r,i=[],o=0;r=a.exec(e);){if(o++>1e4)throw Error("Circular references in parenthesis");i.push(e.slice(0,r.index)),i.push(s(t[r[1]],t)),e=e.slice(r.index+r[0].length)}return i.push(e),i}return o?n:s(n[0],n)}function n(e,t){if(t&&t.flat){var n,r=t&&t.escape||"___",i=e[0];if(!i)return"";for(var o=RegExp("\\"+r+"([0-9]+)\\"+r),a=0;i!=n;){if(a++>1e4)throw Error("Circular references in "+e);n=i,i=i.replace(o,s)}return i}return e.reduce(function e(t,n){return Array.isArray(n)&&(n=n.reduce(e,"")),t+n},"");function s(t,n){if(null==e[n])throw Error("Reference "+n+"is undefined");return e[n]}}function r(e,r){return Array.isArray(e)?n(e,r):t(e,r)}r.parse=t,r.stringify=n,e.exports=r},89435:function(e){"use strict";var t,n=59;function r(e){var r,i="&"+e+";";return(t=t||document.createElement("i")).innerHTML=i,((r=t.textContent).charCodeAt(r.length-1)!==n||"semi"===e)&&r!==i&&r}e.exports=r},57574:function(e,t,n){"use strict";var r=n(37452),i=n(93580),o=n(46195),a=n(79480),s=n(7961),l=n(89435);e.exports=B;var u={}.hasOwnProperty,c=String.fromCharCode,d=Function.prototype,p={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},f=9,h=10,m=12,g=32,b=38,y=59,v=60,w=61,E=35,S=88,x=120,_=65533,k="named",A="hexadecimal",T="decimal",C={};C[A]=16,C[T]=10;var R={};R[k]=s,R[T]=o,R[A]=a;var D=1,O=2,I=3,N=4,M=5,L=6,P=7,F={};function B(e,t){var n,r,i={};for(r in t||(t={}),p)n=t[r],i[r]=null==n?p[r]:n;return(i.position.indent||i.position.start)&&(i.indent=i.position.indent||[],i.position=i.position.start),U(e,i)}function U(e,t){var n,o,a,p,B,U,$,H,V,G,q,W,K,Y,Z,X,J,Q,ee,et=t.additional,en=t.nonTerminated,er=t.text,ei=t.reference,eo=t.warning,ea=t.textContext,es=t.referenceContext,el=t.warningContext,eu=t.position,ec=t.indent||[],ed=e.length,ep=0,ef=-1,eh=eu.column||1,em=eu.line||1,eg="",eb=[];for("string"==typeof et&&(et=et.charCodeAt(0)),X=ey(),H=eo?ev:d,ep--,ed++;++ep65535&&(U-=65536,G+=c(U>>>10|55296),U=56320|1023&U),U=G+c(U))):Y!==k&&H(N,Q)),U?(ew(),X=ey(),ep=ee-1,eh+=ee-K+1,eb.push(U),J=ey(),J.offset++,ei&&ei.call(es,U,{start:X,end:J},e.slice(K-1,ee)),X=J):(eg+=p=e.slice(K-1,ee),eh+=p.length,ep=ee-1)}else 10===B&&(em++,ef++,eh=0),B==B?(eg+=c(B),eh++):ew();return eb.join("");function ey(){return{line:em,column:eh,offset:ep+(eu.offset||0)}}function ev(e,t){var n=ey();n.column+=t,n.offset+=t,eo.call(el,F[e],n,e)}function ew(){eg&&(eb.push(eg),er&&er.call(ea,eg,{start:X,end:ey()}),eg="")}}function z(e){return e>=55296&&e<=57343||e>1114111}function j(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(65535&e)==65535||(65535&e)==65534}F[1]="Named character references must be terminated by a semicolon",F[O]="Numeric character references must be terminated by a semicolon",F[I]="Named character references cannot be empty",F[N]="Numeric character references cannot be empty",F[M]="Named character references must be known",F[L]="Numeric character references cannot be disallowed",F[P]="Numeric character references cannot be outside the permissible Unicode range"},92703:function(e,t,n){"use strict";var r=n(50414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},45697:function(e,t,n){e.exports=n(92703)()},50414:function(e){"use strict";var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=t},91915:function(e){var t,n;t=self,n=function(){return(()=>{var e={192(e,t){var n,r,i=function(){var e,t,n=function(e,t){var n=e,r=l[t],i=null,o=0,a=null,s=[],c={},y=function(e,t){i=function(e){for(var t=Array(e),n=0;n=7&&x(e),null==a&&(a=A(n,r,s)),k(a,t)},v=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1||o<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||o<=t+r||(i[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},E=function(){for(var e=8;e>r&1);i[Math.floor(r/3)][r%3+o-8-3]=a}for(r=0;r<18;r+=1)a=!e&&1==(t>>r&1),i[r%3+o-8-3][Math.floor(r/3)]=a},_=function(e,t){for(var n=r<<3|t,a=u.getBCHTypeInfo(n),s=0;s<15;s+=1){var l=!e&&1==(a>>s&1);s<6?i[s][8]=l:s<8?i[s+1][8]=l:i[o-15+s][8]=l}for(s=0;s<15;s+=1)l=!e&&1==(a>>s&1),s<8?i[8][o-s-1]=l:s<9?i[8][15-s-1+1]=l:i[8][15-s-1]=l;i[o-8][8]=!e},k=function(e,t){for(var n=-1,r=o-1,a=7,s=0,l=u.getMaskFunction(t),c=o-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var d=0;d<2;d+=1)if(null==i[r][c-d]){var p=!1;s>>a&1)),l(r,c-d)&&(p=!p),i[r][c-d]=p,-1==(a-=1)&&(s+=1,a=7)}if((r+=n)<0||o<=r){r-=n,n=-n;break}}},A=function(e,t,n){for(var r=p.getRSBlocks(e,t),i=f(),o=0;o8*s)throw"code length overflow. ("+i.getLengthInBits()+">"+8*s+")";for(i.getLengthInBits()+4<=8*s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*s||(i.put(236,8),i.getLengthInBits()>=8*s));)i.put(17,8);return function(e,t){for(var n=0,r=0,i=0,o=Array(t.length),a=Array(t.length),s=0;s=0?h.getAt(m):0}}var g=0;for(p=0;pr)&&(e=r,t=n)}return t}())},c.createTableTag=function(e,t){e=e||2;var n="";n+='';for(var r=0;r";for(var i=0;i';n+=""}return(n+="")+"
"},c.createSvgTag=function(e,t,n,r){var i={};"object"==typeof arguments[0]&&(e=(i=arguments[0]).cellSize,t=i.margin,n=i.alt,r=i.title),e=e||2,t=void 0===t?4*e:t,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var o,a,s,l,u=c.getModuleCount()*e+2*t,d="";for(l="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",d+='"+(r.text?''+T(r.text)+"":"")+(n.text?''+T(n.text)+"":"")+'"},c.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var n=c.getModuleCount()*e+2*t,r=t,i=n-t;return w(n,n,function(t,n){if(r<=t&&t"};var T=function(e){for(var t="",n=0;n":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=r}}return t};return c.createASCII=function(e,t){if((e=e||1)<2)return function(e){e=void 0===e?2:e;var t,n,r,i,o,a=1*c.getModuleCount()+2*e,s=e,l=a-e,u={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "},p="";for(t=0;t=l?d[o]:u[o];p+="\n"}return a%2&&e>0?p.substring(0,p.length-a-1)+Array(a+1).join("▀"):p.substring(0,p.length-1)}(t);e-=1,t=void 0===t?2*e:t;var n,r,i,o,a=c.getModuleCount()*e+2*t,s=t,l=a-t,u=Array(e+1).join("██"),d=Array(e+1).join(" "),p="",f="";for(n=0;n>>8),t.push(255&a)):t.push(r)}}return t}};var r,i,o,a,s,l={L:1,M:0,Q:3,H:2},u=(r=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],i=1335,o=7973,s=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},(a={}).getBCHTypeInfo=function(e){for(var t=e<<10;s(t)-s(i)>=0;)t^=i<=0;)t^=o<5&&(n+=3+o-5)}for(r=0;r=256;)t-=255;return e[t]}}}();function d(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n>>7-t%8&1)},put:function(e,t){for(var r=0;r>>t-r-1&1))},getLengthInBits:function(){return t},putBit:function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1}};return n},h=function(e){var t=e,n=function(e){for(var t=0,n=0;n>>8&255)+(255&i),e.put(i,13),n+=2}if(n>>8)},writeBytes:function(e,n,r){n=n||0,r=r||e.length;for(var i=0;i0&&(t+=","),t+=e[n];return t+"]"}};return t},v=function(e){var t=e,n=0,r=0,i=0,o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;throw"c:"+e};return{read:function(){for(;i<8;){if(n>=t.length){if(0==i)return -1;throw"unexpected end of file./"+i}var e=t.charAt(n);if(n+=1,"="==e)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}var a=r>>>i-8&255;return i-=8,a}}},w=function(e,t,n){for(var r,i,o,a,s,l,u,c,d,p,f,h,m,g,b=(r=e,i=t,o=r,a=i,s=Array(r*i),l=function(e){for(var t=1<>>t!=0)throw"length over";for(;l+t>=8;)a.writeByte(255&(e<>>=8-l,c=0,l=0;c|=e<0&&a.writeByte(c)}});p.write(t,r);var f=0,h=String.fromCharCode(s[0]);for(f+=1;fi.size()&&(i.size()==1<255;)e.writeByte(255),e.writeBytes(t,n,255),n+=255;e.writeByte(t.length-n),e.writeBytes(t,n,t.length-n),e.writeByte(0),e.writeString(";")}}),v=0;v=6;)m(c>>>d-6),d-=6},h.flush=function(){if(d>0&&(m(c<<6-d),c=0,d=0),p%3!=0)for(var e=3-p%3,t=0;t>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e)},void 0===(r="function"==typeof(n=function(){return i})?n.apply(t,[]):n)||(e.exports=r)},676(e,t,n){"use strict";n.d(t,{default:()=>N});var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2||o&&a||s&&l)this._basicSquare({x:t,y:n,size:r,rotation:0});else{if(2===u){var c=0;return o&&s?c=Math.PI/2:s&&a?c=Math.PI:a&&l&&(c=-Math.PI/2),void this._basicCornerRounded({x:t,y:n,size:r,rotation:c})}if(1===u)return c=0,s?c=Math.PI/2:a?c=Math.PI:l&&(c=-Math.PI/2),void this._basicSideRounded({x:t,y:n,size:r,rotation:c})}}else this._basicDot({x:t,y:n,size:r,rotation:0})},e.prototype._drawExtraRounded=function(e){var t=e.x,n=e.y,r=e.size,i=e.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,l=i?+i(0,1):0,u=o+a+s+l;if(0!==u){if(u>2||o&&a||s&&l)this._basicSquare({x:t,y:n,size:r,rotation:0});else{if(2===u){var c=0;return o&&s?c=Math.PI/2:s&&a?c=Math.PI:a&&l&&(c=-Math.PI/2),void this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:c})}if(1===u)return c=0,s?c=Math.PI/2:a?c=Math.PI:l&&(c=-Math.PI/2),void this._basicSideRounded({x:t,y:n,size:r,rotation:c})}}else this._basicDot({x:t,y:n,size:r,rotation:0})},e.prototype._drawClassy=function(e){var t=e.x,n=e.y,r=e.size,i=e.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,l=i?+i(0,1):0;0!==o+a+s+l?o||s?a||l?this._basicSquare({x:t,y:n,size:r,rotation:0}):this._basicCornerRounded({x:t,y:n,size:r,rotation:Math.PI/2}):this._basicCornerRounded({x:t,y:n,size:r,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:n,size:r,rotation:Math.PI/2})},e.prototype._drawClassyRounded=function(e){var t=e.x,n=e.y,r=e.size,i=e.getNeighbor,o=i?+i(-1,0):0,a=i?+i(1,0):0,s=i?+i(0,-1):0,l=i?+i(0,1):0;0!==o+a+s+l?o||s?a||l?this._basicSquare({x:t,y:n,size:r,rotation:0}):this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:t,y:n,size:r,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:n,size:r,rotation:Math.PI/2})},e}();var p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]r||i&&i=(t-i.hideXDots)/2&&e<(t+i.hideXDots)/2&&n>=(t-i.hideYDots)/2&&n<(t+i.hideYDots)/2||(null===(r=v[e])||void 0===r?void 0:r[n])||(null===(o=v[e-t+7])||void 0===o?void 0:o[n])||(null===(a=v[e])||void 0===a?void 0:a[n-t+7])||(null===(s=w[e])||void 0===s?void 0:s[n])||(null===(l=w[e-t+7])||void 0===l?void 0:l[n])||(null===(u=w[e])||void 0===u?void 0:u[n-t+7]))}),this.drawCorners(),this._options.image?[4,this.drawImage({width:i.width,height:i.height,count:t,dotSize:r})]:[3,4];case 3:d.sent(),d.label=4;case 4:return[2]}})})},e.prototype.drawBackground=function(){var e,t,n,r=this._element,i=this._options;if(r){var o=null===(e=i.backgroundOptions)||void 0===e?void 0:e.gradient,a=null===(t=i.backgroundOptions)||void 0===t?void 0:t.color;if((o||a)&&this._createColor({options:o,color:a,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:"background-color"}),null===(n=i.backgroundOptions)||void 0===n?void 0:n.round){var s=Math.min(i.width,i.height),l=document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id","clip-path-background-color"),this._defs.appendChild(this._backgroundClipPath),l.setAttribute("x",String((i.width-s)/2)),l.setAttribute("y",String((i.height-s)/2)),l.setAttribute("width",String(s)),l.setAttribute("height",String(s)),l.setAttribute("rx",String(s/2*i.backgroundOptions.round)),this._backgroundClipPath.appendChild(l)}}},e.prototype.drawDots=function(e){var t,n,r=this;if(!this._qr)throw"QR code is not defined";var i=this._options,o=this._qr.getModuleCount();if(o>i.width||o>i.height)throw"The canvas is too small.";var a=Math.min(i.width,i.height)-2*i.margin,s=Math.floor((i.shape===g?a/Math.sqrt(2):a)/o),l=Math.floor((i.width-o*s)/2),u=Math.floor((i.height-o*s)/2),c=new d({svg:this._element,type:i.dotsOptions.type});this._dotsClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id","clip-path-dot-color"),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(t=i.dotsOptions)||void 0===t?void 0:t.gradient,color:i.dotsOptions.color,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:"dot-color"});for(var p=function(t){for(var i=function(i){return e&&!e(t,i)?"continue":(null===(n=f._qr)||void 0===n?void 0:n.isDark(t,i))?(c.draw(l+t*s,u+i*s,s,function(n,a){return!(t+n<0||i+a<0||t+n>=o||i+a>=o)&&!(e&&!e(t+n,i+a))&&!!r._qr&&r._qr.isDark(t+n,i+a)}),void(c._element&&f._dotsClipPath&&f._dotsClipPath.appendChild(c._element))):"continue"},a=0;a=m-1&&h<=b-m&&S>=m-1&&S<=b-m||Math.sqrt((h-E)*(h-E)+(S-E)*(S-E))>E?w[h][S]=0:w[h][S]=this._qr.isDark(S-2*m<0?S:S>=o?S-2*m:S-m,h-2*m<0?h:h>=o?h-2*m:h-m)?1:0}var x=function(e){for(var t=function(t){if(!w[e][t])return"continue";c.draw(y+e*s,v+t*s,s,function(n,r){var i;return!!(null===(i=w[e+n])||void 0===i?void 0:i[t+r])}),c._element&&_._dotsClipPath&&_._dotsClipPath.appendChild(c._element)},n=0;ns?l:s,d=document.createElementNS("http://www.w3.org/2000/svg","rect");if(d.setAttribute("x",String(o)),d.setAttribute("y",String(a)),d.setAttribute("height",String(s)),d.setAttribute("width",String(l)),d.setAttribute("clip-path","url('#clip-path-"+u+"')"),n){if("radial"===n.type)(t=document.createElementNS("http://www.w3.org/2000/svg","radialGradient")).setAttribute("id",u),t.setAttribute("gradientUnits","userSpaceOnUse"),t.setAttribute("fx",String(o+l/2)),t.setAttribute("fy",String(a+s/2)),t.setAttribute("cx",String(o+l/2)),t.setAttribute("cy",String(a+s/2)),t.setAttribute("r",String(c/2));else{var p=((n.rotation||0)+i)%(2*Math.PI),f=(p+2*Math.PI)%(2*Math.PI),h=o+l/2,m=a+s/2,g=o+l/2,b=a+s/2;f>=0&&f<=.25*Math.PI||f>1.75*Math.PI&&f<=2*Math.PI?(h-=l/2,m-=s/2*Math.tan(p),g+=l/2,b+=s/2*Math.tan(p)):f>.25*Math.PI&&f<=.75*Math.PI?(m-=s/2,h-=l/2/Math.tan(p),b+=s/2,g+=l/2/Math.tan(p)):f>.75*Math.PI&&f<=1.25*Math.PI?(h+=l/2,m+=s/2*Math.tan(p),g-=l/2,b-=s/2*Math.tan(p)):f>1.25*Math.PI&&f<=1.75*Math.PI&&(m+=s/2,h+=l/2/Math.tan(p),b-=s/2,g-=l/2/Math.tan(p)),(t=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id",u),t.setAttribute("gradientUnits","userSpaceOnUse"),t.setAttribute("x1",String(Math.round(h))),t.setAttribute("y1",String(Math.round(m))),t.setAttribute("x2",String(Math.round(g))),t.setAttribute("y2",String(Math.round(b)))}n.colorStops.forEach(function(e){var n=e.offset,r=e.color,i=document.createElementNS("http://www.w3.org/2000/svg","stop");i.setAttribute("offset",100*n+"%"),i.setAttribute("stop-color",r),t.appendChild(i)}),d.setAttribute("fill","url('#"+u+"')"),this._defs.appendChild(t)}else r&&d.setAttribute("fill",r);this._element.appendChild(d)},e}(),S="canvas";for(var x={},_=0;_<=40;_++)x[_]=_;let k={type:S,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:x[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000"},backgroundOptions:{round:0,color:"#fff"}};var A=function(){return(A=Object.assign||function(e){for(var t,n=1,r=arguments.length;nMath.min(t.width,t.height)&&(t.margin=Math.min(t.width,t.height)),t.dotsOptions=A({},t.dotsOptions),t.dotsOptions.gradient&&(t.dotsOptions.gradient=T(t.dotsOptions.gradient)),t.cornersSquareOptions&&(t.cornersSquareOptions=A({},t.cornersSquareOptions),t.cornersSquareOptions.gradient&&(t.cornersSquareOptions.gradient=T(t.cornersSquareOptions.gradient))),t.cornersDotOptions&&(t.cornersDotOptions=A({},t.cornersDotOptions),t.cornersDotOptions.gradient&&(t.cornersDotOptions.gradient=T(t.cornersDotOptions.gradient))),t.backgroundOptions&&(t.backgroundOptions=A({},t.backgroundOptions),t.backgroundOptions.gradient&&(t.backgroundOptions.gradient=T(t.backgroundOptions.gradient))),t}var R=n(192),D=n.n(R),O=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})},I=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\r\n'+n],{type:"image/svg+xml"})]):[2,new Promise(function(n){return t.toBlob(n,"image/"+e,1)})]:[2,null]}})})},e.prototype.download=function(e){return O(this,void 0,void 0,function(){var t,n,r,i;return I(this,function(o){switch(o.label){case 0:if(!this._qr)throw"QR code is empty";return t="png",n="qr","string"==typeof e?(t=e,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):"object"==typeof e&&null!==e&&(e.name&&(n=e.name),e.extension&&(t=e.extension)),[4,this._getElement(t)];case 1:return(r=o.sent())&&("svg"===t.toLowerCase()?s("data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i='\r\n'+(i=(new XMLSerializer).serializeToString(r))),n+".svg"):s(r.toDataURL("image/"+t),n+"."+t)),[2]}})})},e}()}},t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(676)})().default},e.exports=n()},17563:function(e,t,n){"use strict";let r=n(70610),i=n(44020),o=n(80500),a=e=>null==e;function s(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{let i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[",i,"]"].join("")]:[...n,[c(t,e),"[",c(i,e),"]=",c(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[c(t,e),"[]"].join("")]:[...n,[c(t,e),"[]=",c(r,e)].join("")];case"comma":case"separator":return t=>(n,r)=>null==r||0===r.length?n:0===n.length?[[c(t,e),"=",c(r,e)].join("")]:[[n,c(r,e)].join(e.arrayFormatSeparator)];default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,c(t,e)]:[...n,[c(t,e),"=",c(r,e)].join("")]}}function l(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){r[e]=n;return}void 0===r[e]&&(r[e]={}),r[e][t[1]]=n};case"bracket":return(e,n,r)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){r[e]=n;return}if(void 0===r[e]){r[e]=[n];return}r[e]=[].concat(r[e],n)};case"comma":case"separator":return(t,n,r)=>{let i="string"==typeof n&&n.split("").indexOf(e.arrayFormatSeparator)>-1,o=i?n.split(e.arrayFormatSeparator).map(t=>d(t,e)):null===n?n:d(n,e);r[t]=o};default:return(e,t,n)=>{if(void 0===n[e]){n[e]=t;return}n[e]=[].concat(n[e],t)}}}function u(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function d(e,t){return t.decode?i(e):e}function p(e){return Array.isArray(e)?e.sort():"object"==typeof e?p(Object.keys(e)).sort((e,t)=>Number(e)-Number(t)).map(t=>e[t]):e}function f(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function h(e){let t="",n=e.indexOf("#");return -1!==n&&(t=e.slice(n)),t}function m(e){e=f(e);let t=e.indexOf("?");return -1===t?"":e.slice(t+1)}function g(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function b(e,t){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let n=l(t),r=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return r;for(let i of e.split("&")){let[a,s]=o(t.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator"].includes(t.arrayFormat)?s:d(s,t),n(d(a,t),s,r)}for(let c of Object.keys(r)){let f=r[c];if("object"==typeof f&&null!==f)for(let h of Object.keys(f))f[h]=g(f[h],t);else r[c]=g(f,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=p(n):e[t]=n,e},Object.create(null))}t.extract=m,t.parse=b,t.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let n=n=>t.skipNull&&a(e[n])||t.skipEmptyString&&""===e[n],r=s(t),i={};for(let o of Object.keys(e))n(o)||(i[o]=e[o]);let l=Object.keys(i);return!1!==t.sort&&l.sort(t.sort),l.map(n=>{let i=e[n];return void 0===i?"":null===i?c(n,t):Array.isArray(i)?i.reduce(r(n),[]).join("&"):c(n,t)+"="+c(i,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[n,r]=o(e,"#");return Object.assign({url:n.split("?")[0]||"",query:b(m(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:d(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0},n);let r=f(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),a=Object.assign(o,e.query),s=t.stringify(a,n);s&&(s=`?${s}`);let l=h(e.url);return e.fragmentIdentifier&&(l=`#${c(e.fragmentIdentifier,n)}`),`${r}${s}${l}`}},86893:function(e,t,n){"use strict";n.d(t,{C3L:function(){return o},QoU:function(){return s},Tfp:function(){return i},jRj:function(){return l},tHe:function(){return a}});var r=n(88357);function i(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"}}]})(e)}function o(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}},{tag:"path",attr:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}}]})(e)}function a(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}},{tag:"polyline",attr:{points:"13 2 13 9 20 9"}}]})(e)}function s(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}}]})(e)}function l(e){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"}},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}}]})(e)}},88357:function(e,t,n){"use strict";n.d(t,{w_:function(){return u}});var r=n(67294),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o=r.createContext&&r.createContext(i),a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function l(e){return e&&e.map(function(e,t){return r.createElement(e.tag,a({key:t},e.attr),l(e.child))})}function u(e){return function(t){return r.createElement(c,a({attr:a({},e.attr)},t),l(e.child))}}function c(e){var t=function(t){var n,i=e.attr,o=e.size,l=e.title,u=s(e,["attr","size","title"]),c=o||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),r.createElement("svg",a({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,u,{className:n,style:a(a({color:e.color||t.color},t.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),l&&r.createElement("title",null,l),e.children)};return void 0!==o?r.createElement(o.Consumer,null,function(e){return t(e)}):t(i)}},71471:function(e,t){"use strict";/** * @license React * react-is.production.min.js * diff --git a/_next/static/chunks/pages/_app-a44fcef8ff4d79b1.js b/_next/static/chunks/pages/_app-a44fcef8ff4d79b1.js deleted file mode 100644 index 394330e..0000000 --- a/_next/static/chunks/pages/_app-a44fcef8ff4d79b1.js +++ /dev/null @@ -1,31 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{8417:function(e,t,r){"use strict";r.d(t,{Z:function(){return G}});var n=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t;this._insertTag(((t=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&t.setAttribute("nonce",this.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t))}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?m[A]+" "+E:a(E,/&\f/g,m[A])).trim())&&(h[w++]=S);return b(e,t,r,0===o?R:l,h,f,d)}function B(e,t,r,n){return b(e,t,r,T,c(e,0,n),c(e,n+1,-1),n)}var F=function(e,t,r){for(var n=0,i=0;n=i,i=E(),38===n&&12===i&&(t[r]=1),!S(i);)A();return c(v,e,g)},D=function(e,t){var r=-1,n=44;do switch(S(n)){case 0:38===n&&12===E()&&(t[r]=1),e[r]+=F(g-1,t,r);break;case 2:e[r]+=C(n);break;case 4:if(44===n){e[++r]=58===E()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=o(n)}while(n=A());return e},U=function(e,t){var r;return r=D(k(e),t),v="",r},j=new WeakMap,q=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||j.get(r))&&!n){j.set(e,!0);for(var i=[],o=U(t,i),s=r.props,a=0,u=0;a-1&&!e.return)switch(e.type){case T:e.return=function e(t,r){switch(45^l(t,0)?(((r<<2^l(t,0))<<2^l(t,1))<<2^l(t,2))<<2^l(t,3):0){case 5103:return O+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return O+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return O+t+x+t+P+t+t;case 6828:case 4268:return O+t+P+t+t;case 6165:return O+t+P+"flex-"+t+t;case 5187:return O+t+a(t,/(\w+).+(:[^]+)/,O+"box-$1$2"+P+"flex-$1$2")+t;case 5443:return O+t+P+"flex-item-"+a(t,/flex-|-self/,"")+t;case 4675:return O+t+P+"flex-line-pack"+a(t,/align-content|flex-|-self/,"")+t;case 5548:return O+t+P+a(t,"shrink","negative")+t;case 5292:return O+t+P+a(t,"basis","preferred-size")+t;case 6060:return O+"box-"+a(t,"-grow","")+O+t+P+a(t,"grow","positive")+t;case 4554:return O+a(t,/([^-])(transform)/g,"$1"+O+"$2")+t;case 6187:return a(a(a(t,/(zoom-|grab)/,O+"$1"),/(image-set)/,O+"$1"),t,"")+t;case 5495:case 3959:return a(t,/(image-set\([^]*)/,O+"$1$`$1");case 4968:return a(a(t,/(.+:)(flex-)?(.*)/,O+"box-pack:$3"+P+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+O+t+t;case 4095:case 3583:case 4068:case 2532:return a(t,/(.+)-inline(.+)/,O+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(h(t)-1-r>6)switch(l(t,r+1)){case 109:if(45!==l(t,r+4))break;case 102:return a(t,/(.+:)(.+)-([^]+)/,"$1"+O+"$2-$3$1"+x+(108==l(t,r+3)?"$3":"$2-$3"))+t;case 115:return~u(t,"stretch")?e(a(t,"stretch","fill-available"),r)+t:t}break;case 4949:if(115!==l(t,r+1))break;case 6444:switch(l(t,h(t)-3-(~u(t,"!important")&&10))){case 107:return a(t,":",":"+O)+t;case 101:return a(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+O+(45===l(t,14)?"inline-":"")+"box$3$1"+O+"$2$3$1"+P+"$2box$3")+t}break;case 5936:switch(l(t,r+11)){case 114:return O+t+P+a(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return O+t+P+a(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return O+t+P+a(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return O+t+P+t+t}return t}(e.value,e.length);break;case M:return N([w(e,{value:a(e.value,"@","@"+O)})],n);case R:if(e.length)return e.props.map(function(t){var r;switch(r=t,(r=/(::plac\w+|:read-\w+)/.exec(r))?r[0]:r){case":read-only":case":read-write":return N([w(e,{props:[a(t,/:(read-\w+)/,":"+x+"$1")]})],n);case"::placeholder":return N([w(e,{props:[a(t,/:(plac\w+)/,":"+O+"input-$1")]}),w(e,{props:[a(t,/:(plac\w+)/,":"+x+"$1")]}),w(e,{props:[a(t,/:(plac\w+)/,P+"input-$1")]})],n)}return""}).join("")}}],G=function(e){var t,r,i,s,m,w=e.key;if("css"===w){var P=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(P,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var x=e.stylisPlugins||K,O={},R=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+w+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r2||S(y)>3?"":" "}(I);break;case 92:z+=function(e,t){for(var r;--t&&A()&&!(y<48)&&!(y>102)&&(!(y>57)||!(y<65))&&(!(y>70)||!(y<97)););return r=g+(t<6&&32==E()&&32==A()),c(v,e,r)}(g-1,7);continue;case 47:switch(E()){case 42:case 47:f(b(x=function(e,t){for(;A();)if(e+y===57)break;else if(e+y===84&&47===E())break;return"/*"+c(v,t,g-1)+"*"+o(47===e?e:A())}(A(),g),r,n,_,o(y),c(x,2,-2),0),P);break;default:z+="/"}break;case 123*F:k[O++]=h(z)*U;case 125*F:case 59:case 0:switch(j){case 0:case 125:D=0;case 59+R:-1==U&&(z=a(z,/\f/g,"")),N>0&&h(z)-T&&f(N>32?B(z+";",i,n,T-1):B(a(z," ","")+";",i,n,T-2),P);break;case 59:z+=";";default:if(f(G=L(z,r,n,O,R,s,k,q,H=[],K=[],T),m),123===j){if(0===R)e(z,r,G,G,H,m,T,k,K);else switch(99===M&&110===l(z,3)?100:M){case 100:case 108:case 109:case 115:e(t,G,G,i&&f(L(t,G,G,0,0,s,k,q,s,H=[],T),K),s,K,T,k,i?H:K);break;default:e(z,G,G,G,[""],K,0,k,K)}}}O=R=N=0,F=U=1,q=z="",T=w;break;case 58:T=1+h(z),N=I;default:if(F<1){if(123==j)--F;else if(125==j&&0==F++&&125==(y=g>0?l(v,--g):0,p--,10===y&&(p=1,d--),y))continue}switch(z+=o(j),j*F){case 38:U=R>0?1:(z+="\f",-1);break;case 44:k[O++]=(h(z)-1)*U,U=1;break;case 64:45===E()&&(z+=C(A())),M=E(),R=T=h(q=z+=function(e){for(;!S(E());)A();return c(v,e,g)}(g)),j++;break;case 45:45===I&&2==h(z)&&(F=0)}}return m}("",null,null,null,[""],t=k(t=e),0,[0],t),v="",r),T)},F={key:w,sheet:new n({key:w,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:O,registered:{},insert:function(e,t,r,n){m=r,M(e?e+"{"+t.styles+"}":t.styles),n&&(F.inserted[t.name]=!0)}};return F.sheet.hydrate(R),F}},45042:function(e,t,r){"use strict";function n(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}r.d(t,{Z:function(){return n}})},75260:function(e,t,r){"use strict";r.d(t,{E:function(){return m},T:function(){return h},c:function(){return d},h:function(){return u},w:function(){return c}});var n=r(67294),i=r(8417),o=r(70444),s=r(48137),a=r(27278),u={}.hasOwnProperty,l=n.createContext("undefined"!=typeof HTMLElement?(0,i.Z)({key:"css"}):null);l.Provider;var c=function(e){return(0,n.forwardRef)(function(t,r){return e(t,(0,n.useContext)(l),r)})},h=n.createContext({}),f="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",d=function(e,t){var r={};for(var n in t)u.call(t,n)&&(r[n]=t[n]);return r[f]=e,r},p=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,o.hC)(t,r,n),(0,a.L)(function(){return(0,o.My)(t,r,n)}),null},m=c(function(e,t,r){var i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var a=e[f],l=[i],c="";"string"==typeof e.className?c=(0,o.fp)(t.registered,l,e.className):null!=e.className&&(c=e.className+" ");var d=(0,s.O)(l,void 0,n.useContext(h));c+=t.key+"-"+d.name;var m={};for(var g in e)u.call(e,g)&&"css"!==g&&g!==f&&(m[g]=e[g]);return m.ref=r,m.className=c,n.createElement(n.Fragment,null,n.createElement(p,{cache:t,serialized:d,isStringTag:"string"==typeof a}),n.createElement(a,m))})},35944:function(e,t,r){"use strict";r.d(t,{BX:function(){return a},HY:function(){return o},tZ:function(){return s}});var n=r(85893),i=r(75260);r(67294),r(8417),r(8679),r(48137),r(27278);var o=n.Fragment;function s(e,t,r){return i.h.call(t,"css")?n.jsx(i.E,(0,i.c)(e,t),r):n.jsx(e,t,r)}function a(e,t,r){return i.h.call(t,"css")?n.jsxs(i.E,(0,i.c)(e,t),r):n.jsxs(e,t,r)}},48137:function(e,t,r){"use strict";r.d(t,{O:function(){return p}});var n,i={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},o=r(45042),s=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,u=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},c=(0,o.Z)(function(e){return u(e)?e:e.replace(s,"-$&").toLowerCase()}),h=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(a,function(e,t,r){return n={name:t,styles:r,next:n},t})}return 1===i[e]||u(e)||"number"!=typeof t||0===t?t:t+"px"};function f(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return n={name:r.name,styles:r.styles,next:n},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)n={name:i.name,styles:i.styles,next:n},i=i.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i=4;++n,i-=4)t=(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))*1540483477+((t>>>16)*59797<<16),t^=t>>>24,r=(65535&t)*1540483477+((t>>>16)*59797<<16)^(65535&r)*1540483477+((r>>>16)*59797<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r^=255&e.charCodeAt(n),r=(65535&r)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,(((r=(65535&r)*1540483477+((r>>>16)*59797<<16))^r>>>15)>>>0).toString(36)}(s)+l,styles:s,next:n}}},27278:function(e,t,r){"use strict";r.d(t,{L:function(){return s}});var n,i=r(67294),o=!!(n||(n=r.t(i,2))).useInsertionEffect&&(n||(n=r.t(i,2))).useInsertionEffect,s=o||function(e){return e()};o||i.useLayoutEffect},70444:function(e,t,r){"use strict";function n(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "}),n}r.d(t,{My:function(){return o},fp:function(){return n},hC:function(){return i}});var i=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},o=function(e,t,r){i(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next;while(void 0!==o)}}},95851:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="abi/5.7.0"},84243:function(e,t,r){"use strict";r.d(t,{R:function(){return R},$:function(){return T}});var n=r(16441),i=r(6881),o=r(1581),s=r(95851),a=r(61184),u=r(19485);class l extends a.XI{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=(0,u.getAddress)(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}decode(e){return(0,u.getAddress)((0,n.hexZeroPad)(e.readValue().toHexString(),20))}}class c extends a.XI{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}let h=new o.Logger(s.i);function f(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let i={};n=t.map(e=>{let t=e.localName;return t||h.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&h.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]})}else h.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&h.throwArgumentError("types/value length mismatch","tuple",r);let s=new a.QV(e.wordSize),u=new a.QV(e.wordSize),l=[];return t.forEach((e,t)=>{let r=n[t];if(e.dynamic){let i=u.length;e.encode(u,r);let o=s.writeUpdatableValue();l.push(e=>{o(e+i)})}else e.encode(s,r)}),l.forEach(e=>{e(s.length)}),e.appendWriter(s)+e.appendWriter(u)}function d(e,t){let r=[],n=e.subReader(0);t.forEach(t=>{let i=null;if(t.dynamic){let s=e.readValue(),a=n.subReader(s.toNumber());try{i=t.decode(a)}catch(u){if(u.code===o.Logger.errors.BUFFER_OVERRUN)throw u;(i=u).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(l){if(l.code===o.Logger.errors.BUFFER_OVERRUN)throw l;(i=l).baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&r.push(i)});let i=t.reduce((e,t)=>{let r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});t.forEach((e,t)=>{let n=e.localName;if(!n||1!==i[n]||("length"===n&&(n="_length"),null!=r[n]))return;let o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get(){throw o}}):r[n]=o});for(let s=0;s=0?t:"")+"]",i=-1===t||e.dynamic;super("array",n,r,i),this.coder=e,this.length=t}defaultValue(){let e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&h.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});let r=[];for(let n=0;n{e.dynamic&&(r=!0),n.push(e.type)});let i="tuple("+n.join(",")+")";super("tuple",i,t,r),this.coders=e}defaultValue(){let e=[];this.coders.forEach(t=>{e.push(t.defaultValue())});let t=this.coders.reduce((e,t)=>{let r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))}),Object.freeze(e)}encode(e,t){return f(e,this.coders,t)}decode(e){return e.coerce(this.name,d(e,this.coders))}}var P=r(11388);let x=new o.Logger(s.i),O=RegExp(/^bytes([0-9]*)$/),_=RegExp(/^(u?int)([0-9]*)$/);class R{constructor(e){(0,i.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new l(e.name);case"bool":return new m(e.name);case"string":return new k(e.name);case"bytes":return new y(e.name);case"array":return new p(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new C((e.components||[]).map(e=>this._getCoder(e)),e.name);case"":return new b(e.name)}let t=e.type.match(_);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&x.throwArgumentError("invalid "+t[1]+" bit length","param",e),new E(r/8,"int"===t[1],e.name)}if(t=e.type.match(O)){let n=parseInt(t[1]);return(0===n||n>32)&&x.throwArgumentError("invalid bytes length","param",e),new v(n,e.name)}return x.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new a.Ej(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(e){let t=e.map(e=>this._getCoder(P._R.from(e))),r=new C(t,"_");return r.defaultValue()}encode(e,t){e.length!==t.length&&x.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});let r=e.map(e=>this._getCoder(P._R.from(e))),n=new C(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){let i=e.map(e=>this._getCoder(P._R.from(e))),o=new C(i,"_");return o.decode(this._getReader((0,n.arrayify)(t),r))}}let T=new R},61184:function(e,t,r){"use strict";r.d(t,{BR:function(){return l},Ej:function(){return f},QV:function(){return h},XI:function(){return c}});var n=r(16441),i=r(2593),o=r(6881),s=r(1581),a=r(95851);let u=new s.Logger(a.i);function l(e){let t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){let o=e.slice();o.push(i);try{r(o,n[i])}catch(s){t.push({path:o,error:s})}}};return r([],e),t}class c{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){u.throwArgumentError(e,this.localName,t)}}class h{constructor(e){(0,o.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,n.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,n.concat)(e._data))}writeBytes(e){let t=(0,n.arrayify)(e),r=t.length%this.wordSize;return r&&(t=(0,n.concat)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,n.arrayify)(i.O$.from(e));return t.length>this.wordSize&&u.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,n.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){let e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class f{constructor(e,t,r,i){(0,o.defineReadOnly)(this,"_data",(0,n.arrayify)(e)),(0,o.defineReadOnly)(this,"wordSize",t||32),(0,o.defineReadOnly)(this,"_coerceFunc",r),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,n.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&48>=parseInt(r[1])&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):f.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:u.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new f(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}},11388:function(e,t,r){"use strict";r.d(t,{HY:function(){return y},IC:function(){return C},QV:function(){return v},Xg:function(){return E},YW:function(){return S},_R:function(){return m},pc:function(){return d}});var n=r(2593),i=r(6881),o=r(1581),s=r(95851);let a=new o.Logger(s.i),u={},l={calldata:!0,memory:!0,storage:!0},c={calldata:!0,memory:!0};function h(e,t){if("bytes"===e||"string"===e){if(l[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&c[t])return!0;return(l[t]||"payable"===t)&&a.throwArgumentError("invalid modifier","name",t),!1}function f(e,t){for(let r in t)(0,i.defineReadOnly)(e,r,t[r])}let d=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=RegExp(/^(.*)\[([0-9]*)\]$/);class m{constructor(e,t){e!==u&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,t);let r=this.type.match(p);r?f(this,{arrayLength:parseInt(r[2]||"-1"),arrayChildren:m.fromObject({type:r[1],components:this.components}),baseType:"array"}):f(this,{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(t)}let r="";return"array"===this.baseType?r+=this.arrayChildren.format(e)+"["+(this.arrayLength<0?"":String(this.arrayLength))+"]":"tuple"===this.baseType?(e!==d.sighash&&(r+=this.type),r+="("+this.components.map(t=>t.format(e)).join(e===d.full?", ":",")+")"):r+=this.type,e!==d.sighash&&(!0===this.indexed&&(r+=" indexed"),e===d.full&&this.name&&(r+=" "+this.name)),r}static from(e,t){return"string"==typeof e?m.fromString(e,t):m.fromObject(e)}static fromObject(e){return m.isParamType(e)?e:new m(u,{name:e.name||null,type:P(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(m.fromObject):null})}static fromString(e,t){var r;return r=function(e,t){let r=e;function n(t){a.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let u=0;um.fromString(e,t))}class y{constructor(e,t){e!==u&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return y.isFragment(e)?e:"string"==typeof e?y.fromString(e):y.fromObject(e)}static fromObject(e){if(y.isFragment(e))return e;switch(e.type){case"function":return S.fromObject(e);case"event":return v.fromObject(e);case"constructor":return E.fromObject(e);case"error":return C.fromObject(e);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?v.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?S.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?E.fromString(e.trim()):"error"===e.split(" ")[0]?C.fromString(e.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class v extends y{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==d.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===d.full?", ":",")+") ",e!==d.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?v.fromString(e):v.fromObject(e)}static fromObject(e){if(v.isEventFragment(e))return e;"event"!==e.type&&a.throwArgumentError("invalid event object","value",e);let t={name:O(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(m.fromObject):[],type:"event"};return new v(u,t)}static fromString(e){let t=e.match(_);t||a.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach(e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+e)}}),v.fromObject({name:t[1].trim(),anonymous:r,inputs:g(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function b(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.O$.from(r[1]),r[0]):e}function w(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}})}function A(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&a.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&a.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||a.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&a.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&a.throwArgumentError("unable to determine stateMutability","value",e),t}class E extends y{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});e===d.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map(t=>t.format(e)).join(e===d.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?E.fromString(e):E.fromObject(e)}static fromObject(e){if(E.isConstructorFragment(e))return e;"constructor"!==e.type&&a.throwArgumentError("invalid constructor object","value",e);let t=A(e);t.constant&&a.throwArgumentError("constructor cannot be constant","value",e);let r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.O$.from(e.gas):null};return new E(u,r)}static fromString(e){let t={type:"constructor"},r=(e=b(e,t)).match(_);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",e),t.inputs=g(r[2].trim(),!1),w(r[3].trim(),t),E.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class S extends E{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),outputs:this.outputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==d.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===d.full?", ":",")+") ",e!==d.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(t=>t.format(e)).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?S.fromString(e):S.fromObject(e)}static fromObject(e){if(S.isFunctionFragment(e))return e;"function"!==e.type&&a.throwArgumentError("invalid function object","value",e);let t=A(e),r={type:e.type,name:O(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(m.fromObject):[],outputs:e.outputs?e.outputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.O$.from(e.gas):null};return new S(u,r)}static fromString(e){let t={type:"function"},r=(e=b(e,t)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",e);let n=r[0].match(_);if(n||a.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&O(t.name),t.inputs=g(n[2],!1),w(n[3].trim(),t),r.length>1){let i=r[1].match(_);(""!=i[1].trim()||""!=i[3].trim())&&a.throwArgumentError("unexpected tokens","value",e),t.outputs=g(i[2],!1)}else t.outputs=[];return S.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function k(e){let t=e.format();return("Error(string)"===t||"Panic(uint256)"===t)&&a.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class C extends y{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==d.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===d.full?", ":",")+") ").trim()}static from(e){return"string"==typeof e?C.fromString(e):C.fromObject(e)}static fromObject(e){if(C.isErrorFragment(e))return e;"error"!==e.type&&a.throwArgumentError("invalid error object","value",e);let t={type:e.type,name:O(e.name),inputs:e.inputs?e.inputs.map(m.fromObject):[]};return k(new C(u,t))}static fromString(e){let t={type:"error"},r=e.match(_);return r||a.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&O(t.name),t.inputs=g(r[2],!1),k(C.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function P(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}let x=RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function O(e){return e&&e.match(x)||a.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}let _=RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},83893:function(e,t,r){"use strict";r.r(t),r.d(t,{AbiCoder:function(){return i.R},ConstructorFragment:function(){return n.Xg},ErrorFragment:function(){return n.IC},EventFragment:function(){return n.QV},FormatTypes:function(){return n.pc},Fragment:function(){return n.HY},FunctionFragment:function(){return n.YW},Indexed:function(){return o.Hk},Interface:function(){return o.vU},LogDescription:function(){return o.CC},ParamType:function(){return n._R},TransactionDescription:function(){return o.vk},checkResultErrors:function(){return s.BR},defaultAbiCoder:function(){return i.$}});var n=r(11388),i=r(84243),o=r(8198),s=r(61184)},8198:function(e,t,r){"use strict";r.d(t,{CC:function(){return p},Hk:function(){return y},vU:function(){return w},vk:function(){return m}});var n=r(19485),i=r(2593),o=r(16441),s=r(32046),a=r(38197),u=r(6881),l=r(84243),c=r(11388),h=r(1581),f=r(95851);let d=new h.Logger(f.i);class p extends u.Description{}class m extends u.Description{}class g extends u.Description{}class y extends u.Description{static isIndexed(e){return!!(e&&e._isIndexed)}}let v={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function b(e,t){let r=Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class w{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,(0,u.defineReadOnly)(this,"fragments",t.map(e=>c.HY.from(e)).filter(e=>null!=e)),(0,u.defineReadOnly)(this,"_abiCoder",(0,u.getStatic)(new.target,"getAbiCoder")()),(0,u.defineReadOnly)(this,"functions",{}),(0,u.defineReadOnly)(this,"errors",{}),(0,u.defineReadOnly)(this,"events",{}),(0,u.defineReadOnly)(this,"structs",{}),this.fragments.forEach(e=>{let t=null;switch(e.type){case"constructor":if(this.deploy){d.warn("duplicate definition - constructor");return}(0,u.defineReadOnly)(this,"deploy",e);return;case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();if(t[r]){d.warn("duplicate definition - "+r);return}t[r]=e}),this.deploy||(0,u.defineReadOnly)(this,"deploy",c.Xg.from({payable:!1,type:"constructor"})),(0,u.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=c.pc.full),e===c.pc.sighash&&d.throwArgumentError("interface does not support formatting sighash","format",e);let t=this.fragments.map(t=>t.format(e));return e===c.pc.json?JSON.stringify(t.map(e=>JSON.parse(e))):t}static getAbiCoder(){return l.$}static getAddress(e){return(0,n.getAddress)(e)}static getSighash(e){return(0,o.hexDataSlice)((0,s.id)(e.format()),0,4)}static getEventTopic(e){return(0,s.id)(e.format())}getFunction(e){if((0,o.isHexString)(e)){for(let t in this.functions)if(e===this.getSighash(t))return this.functions[t];d.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){let r=e.trim(),n=Object.keys(this.functions).filter(e=>e.split("(")[0]===r);return 0===n.length?d.throwArgumentError("no matching function","name",r):n.length>1&&d.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}let i=this.functions[c.YW.fromString(e).format()];return i||d.throwArgumentError("no matching function","signature",e),i}getEvent(e){if((0,o.isHexString)(e)){let t=e.toLowerCase();for(let r in this.events)if(t===this.getEventTopic(r))return this.events[r];d.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){let n=e.trim(),i=Object.keys(this.events).filter(e=>e.split("(")[0]===n);return 0===i.length?d.throwArgumentError("no matching event","name",n):i.length>1&&d.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}let s=this.events[c.QV.fromString(e).format()];return s||d.throwArgumentError("no matching event","signature",e),s}getError(e){if((0,o.isHexString)(e)){let t=(0,u.getStatic)(this.constructor,"getSighash");for(let r in this.errors){let n=this.errors[r];if(e===t(n))return this.errors[r]}d.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){let i=e.trim(),s=Object.keys(this.errors).filter(e=>e.split("(")[0]===i);return 0===s.length?d.throwArgumentError("no matching error","name",i):s.length>1&&d.throwArgumentError("multiple matching errors","name",i),this.errors[s[0]]}let a=this.errors[c.YW.fromString(e).format()];return a||d.throwArgumentError("no matching error","signature",e),a}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch(t){throw r}}return(0,u.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),(0,u.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));let r=(0,o.arrayify)(t);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(e)&&d.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,o.arrayify)(t);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(e)&&d.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,o.arrayify)(t),n=null,i="",s=null,a=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(l){}break;case 4:{let c=(0,o.hexlify)(r.slice(0,4)),f=v[c];if(f)s=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,u=f.signature,f.reason&&(n=s[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{let p=this.getError(c);s=this._abiCoder.decode(p.inputs,r.slice(4)),a=p.name,u=p.format()}catch(m){}}}return d.throwError("call revert exception"+i,h.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,o.hexlify)(t),errorArgs:s,errorName:a,errorSignature:u,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,o.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&d.throwError("too many arguments for "+e.format(),h.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));let n=(e,t)=>"string"===e.type?(0,s.id)(t):"bytes"===e.type?(0,a.keccak256)((0,o.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=i.O$.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,o.hexZeroPad)((0,o.hexlify)(t),32));for(t.forEach((t,i)=>{let o=e.inputs[i];if(!o.indexed){null!=t&&d.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t);return}null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?d.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map(e=>n(o,e))):r.push(n(o,t))});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));let r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&d.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((e,o)=>{let u=t[o];if(e.indexed){if("string"===e.type)r.push((0,s.id)(u));else if("bytes"===e.type)r.push((0,a.keccak256)(u));else if("tuple"===e.baseType||"array"===e.baseType)throw Error("not implemented");else r.push(this._abiCoder.encode([e.type],[u]))}else n.push(e),i.push(u)}),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let n=this.getEventTopic(e);(0,o.isHexString)(r[0],32)&&r[0].toLowerCase()===n||d.throwError("fragment/topic mismatch",h.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}let i=[],s=[],a=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(c._R.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(s.push(e),a.push(!1))});let u=null!=r?this._abiCoder.decode(i,(0,o.concat)(r)):null,l=this._abiCoder.decode(s,t,!0),f=[],p=0,m=0;e.inputs.forEach((e,t)=>{if(e.indexed){if(null==u)f[t]=new y({_isIndexed:!0,hash:null});else if(a[t])f[t]=new y({_isIndexed:!0,hash:u[m++]});else try{f[t]=u[m++]}catch(r){f[t]=r}}else try{f[t]=l[p++]}catch(n){f[t]=n}if(e.name&&null==f[e.name]){let i=f[t];i instanceof Error?Object.defineProperty(f,e.name,{enumerable:!0,get(){throw b(`property ${JSON.stringify(e.name)}`,i)}}):f[e.name]=i}});for(let g=0;gnull)}),r=null,o=null,s=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,s=n.O$.from("1500000000"),o=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:r,maxFeePerGas:o,maxPriorityFeePerGas:s,gasPrice:t}},new(r||(r=Promise))(function(n,i){function s(e){try{u(o.next(e))}catch(t){i(t)}}function a(e){try{u(o.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((o=o.apply(e,t||[])).next())})}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!!(e&&e._isProvider)}}},48088:function(e,t,r){"use strict";r.r(t),r.d(t,{Signer:function(){return l},VoidSigner:function(){return c}});var n=r(6881),i=r(1581),o=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let s=new i.Logger("abstract-signer/5.7.0"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],u=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class l{constructor(){s.checkAbstract(new.target,l),(0,n.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return o(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return o(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return o(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let t=yield(0,n.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return o(this,void 0,void 0,function*(){this._checkProvider("call");let r=yield(0,n.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return o(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return o(this,void 0,void 0,function*(){this._checkProvider("getChainId");let e=yield this.provider.getNetwork();return e.chainId})}getGasPrice(){return o(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return o(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return o(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(let t in e)-1===a.indexOf(t)&&s.throwArgumentError("invalid transaction key: "+t,"transaction",e);let r=(0,n.shallowCopy)(e);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",e),t[0])),r}populateTransaction(e){return o(this,void 0,void 0,function*(){let t=yield(0,n.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then(e=>o(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.resolveName(e);return null==t&&s.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})),t.to.catch(e=>{}));let r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null!=t.gasPrice&&(2===t.type||r)?s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(0===t.type||1===t.type)&&r&&s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(2===t.type||null==t.type)&&null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)t.type=2;else if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{let a=yield this.getFeeData();if(null==t.type){if(null!=a.maxFeePerGas&&null!=a.maxPriorityFeePerGas){if(t.type=2,null!=t.gasPrice){let l=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=l,t.maxPriorityFeePerGas=l}else null==t.maxFeePerGas&&(t.maxFeePerGas=a.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=a.maxPriorityFeePerGas)}else null!=a.gasPrice?(r&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=a.gasPrice),t.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"})}else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=a.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch(e=>{if(u.indexOf(e.code)>=0)throw e;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})})),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(t=>(0!==t[1]&&t[0]!==t[1]&&s.throwArgumentError("chainId address mismatch","transaction",e),t[0])),yield(0,n.resolveProperties)(t)})}_checkProvider(e){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class c extends l{constructor(e,t){super(),(0,n.defineReadOnly)(this,"address",e),(0,n.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then(()=>{s.throwError(e,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new c(this.address,e)}}},19485:function(e,t,r){"use strict";r.r(t),r.d(t,{getAddress:function(){return m},getContractAddress:function(){return v},getCreate2Address:function(){return b},getIcapAddress:function(){return y},isAddress:function(){return g}});var n=r(16441),i=r(2593),o=r(38197),s=r(59052),a=r(1581);let u=new a.Logger("address/5.7.0");function l(e){(0,n.isHexString)(e,20)||u.throwArgumentError("invalid address","address",e),e=e.toLowerCase();let t=e.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=t[i].charCodeAt(0);let s=(0,n.arrayify)((0,o.keccak256)(r));for(let a=0;a<40;a+=2)s[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(15&s[a>>1])>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}let c={};for(let h=0;h<10;h++)c[String(h)]=String(h);for(let f=0;f<26;f++)c[String.fromCharCode(65+f)]=String(10+f);let d=Math.floor(Math.log10?Math.log10(9007199254740991):Math.log(9007199254740991)/Math.LN10);function p(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>c[e]).join("");for(;t.length>=d;){let r=t.substring(0,d);t=parseInt(r,10)%97+t.substring(r.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}function m(e){let t=null;if("string"!=typeof e&&u.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=l(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=l("0x"+t)}else u.throwArgumentError("invalid address","address",e);return t}function g(e){try{return m(e),!0}catch(t){}return!1}function y(e){let t=(0,i.t2)(m(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t}function v(e){let t=null;try{t=m(e.from)}catch(r){u.throwArgumentError("missing from address","transaction",e)}let a=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(e.nonce).toHexString()));return m((0,n.hexDataSlice)((0,o.keccak256)((0,s.encode)([t,a])),12))}function b(e,t,r){return 32!==(0,n.hexDataLength)(t)&&u.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,n.hexDataLength)(r)&&u.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),m((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",m(e),t,r])),12))}},59567:function(e,t,r){"use strict";r.d(t,{J:function(){return i},c:function(){return o}});var n=r(16441);function i(e){e=atob(e);let t=[];for(let r=0;r0;)r.push(o%this.base),o=o/this.base|0}let a="";for(let u=0;0===t[u]&&u=0;--l)a+=this.alphabet[r[l]];return a}decode(e){if("string"!=typeof e)throw TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;o>0;)t.push(255&o),o>>=8}for(let a=0;e[a]===this._leader&&a0&&(10===arguments[0]?f||(f=!0,l.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?l.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):l.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof d)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new d(c,p(e)):e.match(/^-?[0-9]+$/)?new d(c,p(new u(e))):l.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&y("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&y("overflow","BigNumber.from",e),d.from(String(e));if("bigint"==typeof e)return d.from(e.toString());if((0,o.isBytes)(e))return d.from((0,o.hexlify)(e));if(e){if(e.toHexString){let t=e.toHexString();if("string"==typeof t)return d.from(t)}else{let r=e._hex;if(null==r&&"BigNumber"===e.type&&(r=e.hex),"string"==typeof r&&((0,o.isHexString)(r)||"-"===r[0]&&(0,o.isHexString)(r.substring(1))))return d.from(r)}}return l.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function p(e){if("string"!=typeof e)return p(e.toString(16));if("-"===e[0])return("-"===(e=e.substring(1))[0]&&l.throwArgumentError("invalid hex","value",e),"0x00"===(e=p(e)))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function m(e){return d.from(p(e))}function g(e){let t=d.from(e).toHexString();return"-"===t[0]?new u("-"+t.substring(3),16):new u(t.substring(2),16)}function y(e,t,r){let n={fault:e,operation:t};return null!=r&&(n.value=r),l.throwError(e,s.Logger.errors.NUMERIC_FAULT,n)}function v(e){return new u(e,36).toString(16)}function b(e){return new u(e,16).toString(36)}},20335:function(e,t,r){"use strict";r.d(t,{Ox:function(){return m},S5:function(){return p},xO:function(){return g},xs:function(){return y}});var n=r(16441),i=r(1581),o=r(48794),s=r(2593);let a=new i.Logger(o.i),u={},l=s.O$.from(0),c=s.O$.from(-1);function h(e,t,r,n){let o={fault:t,operation:r};return void 0!==n&&(o.value=n),a.throwError(e,i.Logger.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function d(e){if("number"!=typeof e)try{e=s.O$.from(e).toNumber()}catch(t){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+f.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function p(e,t){null==t&&(t=0);let r=d(t);e=s.O$.from(e);let n=e.lt(l);n&&(e=e.mul(c));let i=e.mod(r).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",e);let o=i[0],u=i[1];for(o||(o="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>r.length-1&&h("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.lengthnull==e[t]?n:(typeof e[t]!==r&&a.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=o("signed","boolean",t),r=o("width","number",r),n=o("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new g(u,t,r,n)}}class y{constructor(e,t,r,n){e!==u&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);let t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return y.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);let t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return y.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);let t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return y.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);let t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format),r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(v.toFormat(t.format))),t}ceiling(){let e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format),r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(v.toFormat(t.format))),t}round(e){null==e&&(e=0);let t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;let r=y.from("1"+f.substring(0,e),this.format),n=b.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);let t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,n.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,s.Zm)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),y.fromString(p(e,t),g.from(r))}static fromString(e,t){null==t&&(t="fixed");let r=g.from(t),i=m(e,r.decimals);!r.signed&&i.lt(l)&&h("unsigned value cannot be negative","overflow","value",e);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,n.hexZeroPad)(o,r.width/8));let s=p(i,r.decimals);return new y(u,o,s,r)}static fromBytes(e,t){null==t&&(t="fixed");let r=g.from(t);if((0,n.arrayify)(e).length>r.width/8)throw Error("overflow");let i=s.O$.from(e);r.signed&&(i=i.fromTwos(r.width));let o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=p(i,r.decimals);return new y(u,o,a,r)}static from(e,t){if("string"==typeof e)return y.fromString(e,t);if((0,n.isBytes)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(r){if(r.code!==i.Logger.errors.INVALID_ARGUMENT)throw r}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}let v=y.from(1),b=y.from("0.5")},833:function(e,t,r){"use strict";r.r(t),r.d(t,{BigNumber:function(){return n.O$},FixedFormat:function(){return i.xO},FixedNumber:function(){return i.xs},_base16To36:function(){return n.t2},_base36To16:function(){return n.g$},formatFixed:function(){return i.S5},parseFixed:function(){return i.Ox}});var n=r(2593),i=r(20335)},16441:function(e,t,r){"use strict";r.r(t),r.d(t,{arrayify:function(){return c},concat:function(){return h},hexConcat:function(){return b},hexDataLength:function(){return y},hexDataSlice:function(){return v},hexStripZeros:function(){return A},hexValue:function(){return w},hexZeroPad:function(){return E},hexlify:function(){return g},isBytes:function(){return l},isBytesLike:function(){return a},isHexString:function(){return p},joinSignature:function(){return k},splitSignature:function(){return S},stripZeros:function(){return f},zeroPad:function(){return d}});var n=r(1581);let i=new n.Logger("bytes/5.7.0");function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){let t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return p(e)&&!(e.length%2)||l(e)}function u(e){return"number"==typeof e&&e==e&&e%1==0}function l(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e||!u(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"==typeof e){i.checkSafeUint53(e,"invalid arrayify value");let r=[];for(;e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),s(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e)&&(e=e.toHexString()),p(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":i.throwArgumentError("hex data is odd-length","value",e));let a=[];for(let u=0;uc(e)),r=t.reduce((e,t)=>e+t.length,0),n=new Uint8Array(r);return t.reduce((e,t)=>(n.set(t,e),e+t.length),0),s(n)}function f(e){let t=c(e);if(0===t.length)return t;let r=0;for(;rt&&i.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),s(r)}function p(e,t){return"string"==typeof e&&!!e.match(/^0x[0-9A-Fa-f]*$/)&&(!t||e.length===2+2*t)}let m="0123456789abcdef";function g(e,t){if(t||(t={}),"number"==typeof e){i.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=m[15&e]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":i.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(l(e)){let n="0x";for(let s=0;s>4]+m[15&a]}return n}return i.throwArgumentError("invalid hexlify value","value",e)}function y(e){if("string"!=typeof e)e=g(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function v(e,t,r){return("string"!=typeof e?e=g(e):(!p(e)||e.length%2)&&i.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r)?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function b(e){let t="0x";return e.forEach(e=>{t+=g(e).substring(2)}),t}function w(e){let t=A(g(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function A(e){"string"!=typeof e&&(e=g(e)),p(e)||i.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&i.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function S(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){let r=c(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=g(r.slice(0,32)),t.s=g(r.slice(32,64))):65===r.length?(t.r=g(r.slice(0,32)),t.s=g(r.slice(32,64)),t.v=r[64]):i.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:i.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=g(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){let n=d(c(t._vs),32);t._vs=g(n);let o=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&i.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;let s=g(n);null==t.s?t.s=s:t.s!==s&&i.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?i.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{let u=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==u&&i.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=E(t.r,32):i.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=E(t.s,32):i.throwArgumentError("signature missing or invalid s","signature",e);let l=c(t.s);l[0]>=128&&i.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128);let h=g(l);t._vs&&(p(t._vs)||i.throwArgumentError("signature invalid _vs","signature",e),t._vs=E(t._vs,32)),null==t._vs?t._vs=h:t._vs!==h&&i.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function k(e){return g(h([(e=S(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},9279:function(e,t,r){"use strict";r.d(t,{d:function(){return n}});let n="0x0000000000000000000000000000000000000000"},21046:function(e,t,r){"use strict";r.d(t,{$B:function(){return c},Bz:function(){return l},Ce:function(){return u},PS:function(){return h},Py:function(){return a},_Y:function(){return o},fh:function(){return s},tL:function(){return i}});var n=r(2593);let i=n.O$.from(-1),o=n.O$.from(0),s=n.O$.from(1),a=n.O$.from(2),u=n.O$.from("1000000000000000000"),l=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),c=n.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),h=n.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},57218:function(e,t,r){"use strict";r.d(t,{R:function(){return n}});let n="0x0000000000000000000000000000000000000000000000000000000000000000"},21815:function(e,t,r){"use strict";r.r(t),r.d(t,{AddressZero:function(){return n.d},EtherSymbol:function(){return s},HashZero:function(){return o.R},MaxInt256:function(){return i.PS},MaxUint256:function(){return i.Bz},MinInt256:function(){return i.$B},NegativeOne:function(){return i.tL},One:function(){return i.fh},Two:function(){return i.Py},WeiPerEther:function(){return i.Ce},Zero:function(){return i._Y}});var n=r(9279),i=r(21046),o=r(57218);let s="Ξ"},64146:function(e,t,r){"use strict";r.r(t),r.d(t,{BaseContract:function(){return x},Contract:function(){return O},ContractFactory:function(){return _}});var n=r(61184),i=r(8198),o=r(81556),s=r(48088),a=r(19485),u=r(2593),l=r(16441),c=r(6881),h=r(83875),f=r(1581),d=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let p=new f.Logger("contracts/5.7.0"),m={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function g(e,t){return d(this,void 0,void 0,function*(){let r=yield t;"string"!=typeof r&&p.throwArgumentError("invalid address or ENS name","name",r);try{return(0,a.getAddress)(r)}catch(n){}e||p.throwError("a provider or signer is needed to resolve ENS names",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});let i=yield e.resolveName(r);return null==i&&p.throwArgumentError("resolver or addr is not configured for ENS name","name",r),i})}function y(e,t,r){return d(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((r,n)=>y(e,Array.isArray(t)?t[n]:t[r.name],r))):"address"===r.type?yield g(e,t):"tuple"===r.type?yield y(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map(t=>y(e,t,r.arrayChildren))):Promise.reject(p.makeError("invalid value for array",f.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t})}function v(e,t,r){return d(this,void 0,void 0,function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,c.shallowCopy)(r.pop())),p.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=(0,c.resolveProperties)({override:g(e.signer,n.from),signer:e.signer.getAddress()}).then(e=>d(this,void 0,void 0,function*(){return(0,a.getAddress)(e.signer)!==e.override&&p.throwError("Contract with a Signer cannot override from",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})):n.from=e.signer.getAddress():n.from&&(n.from=g(e.provider,n.from));let i=yield(0,c.resolveProperties)({args:y(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,c.resolveProperties)(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),s={data:o,to:i.address},m=i.overrides;if(null!=m.nonce&&(s.nonce=u.O$.from(m.nonce).toNumber()),null!=m.gasLimit&&(s.gasLimit=u.O$.from(m.gasLimit)),null!=m.gasPrice&&(s.gasPrice=u.O$.from(m.gasPrice)),null!=m.maxFeePerGas&&(s.maxFeePerGas=u.O$.from(m.maxFeePerGas)),null!=m.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=u.O$.from(m.maxPriorityFeePerGas)),null!=m.from&&(s.from=m.from),null!=m.type&&(s.type=m.type),null!=m.accessList&&(s.accessList=(0,h.accessListify)(m.accessList)),null==s.gasLimit&&null!=t.gas){let v=21e3,b=(0,l.arrayify)(o);for(let w=0;wnull!=n[e]);return E.length&&p.throwError(`cannot override ${E.map(e=>JSON.stringify(e)).join(",")}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:E}),s})}function b(e,t){let r=t.wait.bind(t);t.wait=t=>r(t).then(t=>(t.events=t.logs.map(r=>{let n=(0,c.deepCopy)(r),i=null;try{i=e.interface.parseLog(r)}catch(o){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n}),t))}function w(e,t,r){let n=e.signer||e.provider;return function(...i){return d(this,void 0,void 0,function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){let s=(0,c.shallowCopy)(i.pop());null!=s.blockTag&&(o=yield s.blockTag),delete s.blockTag,i.push(s)}null!=e.deployTransaction&&(yield e._deployed(o));let a=yield v(e,t,i),u=yield n.call(a,o);try{let l=e.interface.decodeFunctionResult(t,u);return r&&1===t.outputs.length&&(l=l[0]),l}catch(h){throw h.code===f.Logger.errors.CALL_EXCEPTION&&(h.address=e.address,h.args=i,h.transaction=a),h}})}}function A(e,t,r){return t.constant?w(e,t,r):function(...r){return d(this,void 0,void 0,function*(){e.signer||p.throwError("sending a transaction requires a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());let n=yield v(e,t,r),i=yield e.signer.sendTransaction(n);return b(e,i),i})}}function E(e){return e.address&&(null==e.topics||0===e.topics.length)?"*":(e.address||"*")+"@"+(e.topics?e.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class S{constructor(e,t){(0,c.defineReadOnly)(this,"tag",e),(0,c.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter(r=>!!t||r.listener!==e||(t=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){let t=this.listenerCount();return this._listeners=this._listeners.filter(t=>{let r=e.slice();return setTimeout(()=>{t.listener.apply(this,r)},0),!t.once}),t}prepareEvent(e){}getEmit(e){return[e]}}class k extends S{constructor(){super("error",null)}}class C extends S{constructor(e,t,r,n){let i={address:e},o=t.getEventTopic(r);n?(o!==n[0]&&p.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(E(i),i),(0,c.defineReadOnly)(this,"address",e),(0,c.defineReadOnly)(this,"interface",t),(0,c.defineReadOnly)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){let t=(0,n.BR)(e.args);if(t.length)throw t[0].error;let r=(e.args||[]).slice();return r.push(e),r}}class P extends S{constructor(e,t){super("*",{address:e}),(0,c.defineReadOnly)(this,"address",e),(0,c.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{let t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(r){}}}class x{constructor(e,t,r){(0,c.defineReadOnly)(this,"interface",(0,c.getStatic)(new.target,"getInterface")(t)),null==r?((0,c.defineReadOnly)(this,"provider",null),(0,c.defineReadOnly)(this,"signer",null)):s.Signer.isSigner(r)?((0,c.defineReadOnly)(this,"provider",r.provider||null),(0,c.defineReadOnly)(this,"signer",r)):o.zt.isProvider(r)?((0,c.defineReadOnly)(this,"provider",r),(0,c.defineReadOnly)(this,"signer",null)):p.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,c.defineReadOnly)(this,"callStatic",{}),(0,c.defineReadOnly)(this,"estimateGas",{}),(0,c.defineReadOnly)(this,"functions",{}),(0,c.defineReadOnly)(this,"populateTransaction",{}),(0,c.defineReadOnly)(this,"filters",{});{let n={};Object.keys(this.interface.events).forEach(e=>{let t=this.interface.events[e];(0,c.defineReadOnly)(this.filters,e,(...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(t,e)})),n[t.name]||(n[t.name]=[]),n[t.name].push(e)}),Object.keys(n).forEach(e=>{let t=n[e];1===t.length?(0,c.defineReadOnly)(this.filters,e,this.filters[t[0]]):p.warn(`Duplicate definition of ${e} (${t.join(", ")})`)})}if((0,c.defineReadOnly)(this,"_runningEvents",{}),(0,c.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&p.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,c.defineReadOnly)(this,"address",e),this.provider)(0,c.defineReadOnly)(this,"resolvedAddress",g(this.provider,e));else try{(0,c.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,a.getAddress)(e)))}catch(i){p.throwError("provider is required to use ENS name as contract address",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(e=>{});let u={},l={};Object.keys(this.interface.functions).forEach(e=>{let t=this.interface.functions[e];if(l[e]){p.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);return}l[e]=!0;{let r=t.name;u[`%${r}`]||(u[`%${r}`]=[]),u[`%${r}`].push(e)}if(null==this[e]&&(0,c.defineReadOnly)(this,e,A(this,t,!0)),null==this.functions[e]&&(0,c.defineReadOnly)(this.functions,e,A(this,t,!1)),null==this.callStatic[e]&&(0,c.defineReadOnly)(this.callStatic,e,w(this,t,!0)),null==this.populateTransaction[e]){var n;(0,c.defineReadOnly)(this.populateTransaction,e,(n=this,function(...e){return v(n,t,e)}))}null==this.estimateGas[e]&&(0,c.defineReadOnly)(this.estimateGas,e,function(e,t){let r=e.signer||e.provider;return function(...n){return d(this,void 0,void 0,function*(){r||p.throwError("estimate require a provider or signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});let i=yield v(e,t,n);return yield r.estimateGas(i)})}}(this,t))}),Object.keys(u).forEach(e=>{let t=u[e];if(t.length>1)return;e=e.substring(1);let r=t[0];try{null==this[e]&&(0,c.defineReadOnly)(this,e,this[r])}catch(n){}null==this.functions[e]&&(0,c.defineReadOnly)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,c.defineReadOnly)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,c.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,c.defineReadOnly)(this.estimateGas,e,this.estimateGas[r])})}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getInterface(e){return i.vU.isInterface(e)?e:new i.vU(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(e=>("0x"===e&&p.throwError("contract not deployed",f.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||p.throwError("sending a transactions require a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});let t=(0,c.shallowCopy)(e||{});return["from","to"].forEach(function(e){null!=t[e]&&p.throwError("cannot override "+e,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})}),t.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(t))}connect(e){"string"==typeof e&&(e=new s.VoidSigner(e,this.provider));let t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,c.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return i.Hk.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new k);if("event"===e)return this._normalizeRunningEvent(new S("event",null));if("*"===e)return this._normalizeRunningEvent(new P(this.address,this.interface));let t=this.interface.getEvent(e);return this._normalizeRunningEvent(new C(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{let r=e.topics[0];if("string"!=typeof r)throw Error("invalid topic");let n=this.interface.getEvent(r);return this._normalizeRunningEvent(new C(this.address,this.interface,n,e.topics))}catch(i){}let o={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new S(E(o),o))}return this._normalizeRunningEvent(new P(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];let t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){let n=(0,c.deepCopy)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||p.throwError("events require a provider or a signer with a provider",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){let n=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{let i=e.getEmit(n);this.emit(e.filter,...i)}catch(o){n.decodeError=o.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=n,null!=e.filter&&this.provider.on(e.filter,n)}}queryFilter(e,t,r){let n=this._getRunningEvent(e),i=(0,c.shallowCopy)(n.filter);return"string"==typeof t&&(0,l.isHexString)(t,32)?(null!=r&&p.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then(e=>e.map(e=>this._wrapEvent(n,e,null)))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;let r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce((e,t)=>e+this._runningEvents[t].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){let t=[];for(let r in this._runningEvents)this._runningEvents[r].listeners().forEach(e=>{t.push(e)});return t}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(let t in this._runningEvents){let r=this._runningEvents[t];r.removeAllListeners(),this._checkRunningEvents(r)}return this}let n=this._getRunningEvent(e);return n.removeAllListeners(),this._checkRunningEvents(n),this}off(e,t){if(!this.provider)return this;let r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class O extends x{}class _{constructor(e,t,r){let n=null;"0x"!==(n="string"==typeof t?t:(0,l.isBytes)(t)?(0,l.hexlify)(t):t&&"string"==typeof t.object?t.object:"!").substring(0,2)&&(n="0x"+n),(!(0,l.isHexString)(n)||n.length%2)&&p.throwArgumentError("invalid bytecode","bytecode",t),r&&!s.Signer.isSigner(r)&&p.throwArgumentError("invalid signer","signer",r),(0,c.defineReadOnly)(this,"bytecode",n),(0,c.defineReadOnly)(this,"interface",(0,c.getStatic)(new.target,"getInterface")(e)),(0,c.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){for(let r in t=(0,c.shallowCopy)(e.pop()))if(!m[r])throw Error("unknown transaction override "+r)}if(["data","from","to"].forEach(e=>{null!=t[e]&&p.throwError("cannot override "+e,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})}),t.value){let n=u.O$.from(t.value);n.isZero()||this.interface.deploy.payable||p.throwError("non-payable constructor cannot override value",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return p.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=(0,l.hexlify)((0,l.concat)([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return d(this,void 0,void 0,function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),p.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");let r=yield y(this.signer,e,this.interface.deploy.inputs);r.push(t);let n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=(0,c.getStatic)(this.constructor,"getContractAddress")(i),s=(0,c.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return b(s,i),(0,c.defineReadOnly)(s,"deployTransaction",i),s})}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&p.throwError("missing compiler output",f.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));let r=e.abi,n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return O.getInterface(e)}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getContract(e,t,r){return new O(e,t,r)}}},35644:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="hash/5.7.0"},32046:function(e,t,r){"use strict";r.d(t,{id:function(){return o}});var n=r(38197),i=r(29251);function o(e){return(0,n.keccak256)((0,i.Y0)(e))}},75931:function(e,t,r){"use strict";r.r(t),r.d(t,{_TypedDataEncoder:function(){return s.E},dnsEncode:function(){return i.Kn},ensNormalize:function(){return i.w3},hashMessage:function(){return o.r},id:function(){return n.id},isValidName:function(){return i.r1},messagePrefix:function(){return o.B},namehash:function(){return i.VM}});var n=r(32046),i=r(27586),o=r(93684),s=r(67827)},93684:function(e,t,r){"use strict";r.d(t,{B:function(){return s},r:function(){return a}});var n=r(16441),i=r(38197),o=r(29251);let s="\x19Ethereum Signed Message:\n";function a(e){return"string"==typeof e&&(e=(0,o.Y0)(e)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(s),(0,o.Y0)(String(e.length)),e]))}},27586:function(e,t,r){"use strict";let n,i;r.d(t,{Kn:function(){return R},w3:function(){return x},r1:function(){return O},VM:function(){return _}});var o,s=r(16441),a=r(29251),u=r(38197),l=r(1581),c=r(35644),h=r(59567);function f(e,t){null==t&&(t=1);let r=[],n=r.forEach,i=function(e,t){n.call(e,function(e){t>0&&Array.isArray(e)?i(e,t-1):r.push(e)})};return i(e,t),r}function d(e,t){let r=Array(e);for(let n=0,i=-1;nt[e]):r}function m(e,t,r){let n=Array(e).fill(void 0).map(()=>[]);for(let i=0;i>1:o>>1}return r})(e,r).forEach((e,t)=>n[t].push(e));return n}let g=(o=function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let s=1;s>--l&1}let f=0;for(let d=0;d<31;d++)f=f<<1|h();let p=[],m=0,g=2147483648;for(;;){let y=Math.floor(((f-m+1)*i-1)/g),v=0,b=n;for(;b-v>1;){let w=v+b>>>1;y{switch(t-S){case 3:return S+65792+(e[u++]<<16|e[u++]<<8|e[u++]);case 2:return S+256+(e[u++]<<8|e[u++]);case 1:return S+e[u++];default:return t-1}})}((0,h.J)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),i=0,()=>o[i++]),y=new Set(p(g)),v=new Set(p(g)),b=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(function(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return f(m(i.length,1+e,t).map((e,t)=>{let o=e[0],s=e.slice(1);return Array(i[t]).fill(void 0).map((e,t)=>{let i=t*n;return[o+t*r,s.map(e=>e+i)]})}))}(r,e))}for(;;){let n=e()-1;if(n<0)break;t.push(m(1+e(),1+n,e).map(e=>[e[0],e.slice(1)]))}return function(e){let t={};for(let r=0;re-t),function e(){let t=[];for(;;){let r=p(g,n);if(0==r.length)break;t.push({set:new Set(r),node:e()})}t.sort((e,t)=>t.set.size-e.set.size);let i=g(),o=i%3,s=!!(1&(i=i/3|0)),a=1==(i>>=1),u=2==i;return{branches:t,valid:o,fe0f:s,save:a,check:u}}());function A(e){return e.filter(e=>65039!=e)}function E(e){for(let t of e.split(".")){var r;let n=(r=t,(0,a.XL)(r));try{for(let i=n.lastIndexOf(95)-1;i>=0;i--)if(95!==n[i])throw Error("underscore only allowed at start");if(n.length>=4&&n.every(e=>e<128)&&45===n[2]&&45===n[3])throw Error("invalid label extension")}catch(o){throw Error(`Invalid label "${t}": ${o.message}`)}}return e}let S=new l.Logger(c.i),k=new Uint8Array(32);function C(e){if(0===e.length)throw Error("invalid ENS name; empty component");return e}function P(e){let t=(0,a.Y0)(E(function(e,t){let r=(0,a.XL)(e).reverse(),n=[];for(;r.length;){let i=function(e,t){var r;let n,i;let o=w,s=[],a=e.length;for(t&&(t.length=0);a;){let u=e[--a];if(!(o=null===(r=o.branches.find(e=>e.set.has(u)))||void 0===r?void 0:r.node))break;if(o.save)i=u;else if(o.check&&u===i)break;s.push(u),o.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),o.valid&&(n=s.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return n}(r);if(i){n.push(...t(i));continue}let o=r.pop();if(y.has(o)){n.push(o);continue}if(v.has(o))continue;let s=b[o];if(s){n.push(...s);continue}throw Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`)}return E(String.fromCodePoint(...n).normalize("NFC"))}(e,A))),r=[];if(0===e.length)return r;let n=0;for(let i=0;i=t.length)throw Error("invalid ENS name; empty component");return r.push(C(t.slice(n))),r}function x(e){return P(e).map(e=>(0,a.ZN)(e)).join(".")}function O(e){try{return 0!==P(e).length}catch(t){}return!1}function _(e){"string"!=typeof e&&S.throwArgumentError("invalid ENS name; not a string","name",e);let t=k,r=P(e);for(;r.length;)t=(0,u.keccak256)((0,s.concat)([t,(0,u.keccak256)(r.pop())]));return(0,s.hexlify)(t)}function R(e){return(0,s.hexlify)((0,s.concat)(P(e).map(e=>{if(e.length>63)throw Error("invalid DNS encoded entry; length exceeds 63 bytes");let t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"}k.fill(0)},67827:function(e,t,r){"use strict";r.d(t,{E:function(){return C}});var n=r(19485),i=r(2593),o=r(16441),s=r(38197),a=r(6881),u=r(1581),l=r(35644),c=r(32046);let h=new u.Logger(l.i),f=new Uint8Array(32);f.fill(0);let d=i.O$.from(-1),p=i.O$.from(0),m=i.O$.from(1),g=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),y=(0,o.hexZeroPad)(m.toHexString(),32),v=(0,o.hexZeroPad)(p.toHexString(),32),b={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},w=["name","version","chainId","verifyingContract","salt"];function A(e){return function(t){return"string"!=typeof t&&h.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}let E={name:A("name"),version:A("version"),chainId:function(e){try{return i.O$.from(e).toString()}catch(t){}return h.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,n.getAddress)(e).toLowerCase()}catch(t){}return h.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{let t=(0,o.arrayify)(e);if(32!==t.length)throw Error("bad length");return(0,o.hexlify)(t)}catch(r){}return h.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function S(e){{let t=e.match(/^(u?)int(\d*)$/);if(t){let r=""===t[1],a=parseInt(t[2]||"256");(a%8!=0||a>256||t[2]&&t[2]!==String(a))&&h.throwArgumentError("invalid numeric width","type",e);let u=g.mask(r?a-1:a),l=r?u.add(m).mul(d):p;return function(t){let r=i.O$.from(t);return(r.lt(l)||r.gt(u))&&h.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,o.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{let b=e.match(/^bytes(\d+)$/);if(b){let w=parseInt(b[1]);return(0===w||w>32||b[1]!==String(w))&&h.throwArgumentError("invalid bytes width","type",e),function(t){let r=(0,o.arrayify)(t);return r.length!==w&&h.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){let t=(0,o.arrayify)(e),r=t.length%32;return r?(0,o.hexConcat)([t,f.slice(r)]):(0,o.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,o.hexZeroPad)((0,n.getAddress)(e),32)};case"bool":return function(e){return e?y:v};case"bytes":return function(e){return(0,s.keccak256)(e)};case"string":return function(e){return(0,c.id)(e)}}return null}function k(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}class C{constructor(e){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(e))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});let t={},r={},n={};for(let i in Object.keys(e).forEach(e=>{t[e]={},r[e]=[],n[e]={}}),e){let o={};e[i].forEach(n=>{o[n.name]&&h.throwArgumentError(`duplicate variable name ${JSON.stringify(n.name)} in ${JSON.stringify(i)}`,"types",e),o[n.name]=!0;let s=n.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===i&&h.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);let a=S(s);a||(r[s]||h.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(i),t[i][s]=!0)})}let s=Object.keys(r).filter(e=>0===r[e].length);for(let u in 0===s.length?h.throwArgumentError("missing primary type","types",e):s.length>1&&h.throwArgumentError(`ambiguous primary types or unused types: ${s.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),(0,a.defineReadOnly)(this,"primaryType",s[0]),!function i(o,s){s[o]&&h.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),s[o]=!0,Object.keys(t[o]).forEach(e=>{r[e]&&(i(e,s),Object.keys(s).forEach(t=>{n[t][e]=!0}))}),delete s[o]}(this.primaryType,{}),n){let l=Object.keys(n[u]);l.sort(),this._types[u]=k(u,e[u])+l.map(t=>k(t,e[t])).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{let t=S(e);if(t)return t}let r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){let n=r[1],i=this.getEncoder(n),a=parseInt(r[3]);return e=>{a>=0&&e.length!==a&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let t=e.map(i);return this._types[n]&&(t=t.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(t))}}let u=this.types[e];if(u){let l=(0,c.id)(this._types[e]);return e=>{let t=u.map(({name:t,type:r})=>{let n=this.getEncoder(r)(e[t]);return this._types[r]?(0,s.keccak256)(n):n});return t.unshift(l),(0,o.hexConcat)(t)}}return h.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let t=this._types[e];return t||h.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,s.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){{let n=S(e);if(n)return r(e,t)}let i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){let o=i[1],s=parseInt(i[3]);return s>=0&&t.length!==s&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map(e=>this._visit(o,e,r))}let a=this.types[e];return a?a.reduce((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e),{}):h.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new C(e)}static getPrimaryType(e){return C.from(e).primaryType}static hashStruct(e,t,r){return C.from(t).hashStruct(e,r)}static hashDomain(e){let t=[];for(let r in e){let n=b[r];n||h.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort((e,t)=>w.indexOf(e.name)-w.indexOf(t.name)),C.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,o.hexConcat)(["0x1901",C.hashDomain(e),C.from(t).hash(r)])}static hash(e,t,r){return(0,s.keccak256)(C.encode(e,t,r))}static resolveNames(e,t,r,n){var i,s,u,l;return i=this,s=void 0,u=void 0,l=function*(){e=(0,a.shallowCopy)(e);let i={};e.verifyingContract&&!(0,o.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let s=C.from(t);for(let u in s.visit(r,(e,t)=>("address"!==e||(0,o.isHexString)(t,20)||(i[t]="0x"),t)),i)i[u]=yield n(u);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=s.visit(r,(e,t)=>"address"===e&&i[t]?i[t]:t),{domain:e,value:r}},new(u||(u=Promise))(function(e,t){function r(e){try{o(l.next(e))}catch(r){t(r)}}function n(e){try{o(l.throw(e))}catch(r){t(r)}}function o(t){var i;t.done?e(t.value):((i=t.value)instanceof u?i:new u(function(e){e(i)})).then(r,n)}o((l=l.apply(i,s||[])).next())})}static getPayload(e,t,r){C.hashDomain(e);let n={},s=[];w.forEach(t=>{let r=e[t];null!=r&&(n[t]=E[t](r),s.push({name:t,type:b[t]}))});let u=C.from(t),l=(0,a.shallowCopy)(t);return l.EIP712Domain?h.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):l.EIP712Domain=s,u.encode(r),{types:l,domain:n,primaryType:u.primaryType,message:u.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(t));if(e.match(/^u?int/))return i.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&h.throwArgumentError("invalid string","value",t),t}return h.throwArgumentError("unsupported type","type",e)})}}}},84178:function(e,t,r){"use strict";r.r(t),r.d(t,{HDNode:function(){return k},defaultPath:function(){return S},entropyToMnemonic:function(){return x},getAccountPath:function(){return _},isValidMnemonic:function(){return O},mnemonicToEntropy:function(){return P},mnemonicToSeed:function(){return C}});var n=r(57727),i=r(16441),o=r(2593),s=r(29251),a=r(85306),u=r(6881),l=r(67669),c=r(2006),h=r(21261),f=r(83875),d=r(10234),p=r(1581);let m=new p.Logger("hdnode/5.7.0"),g=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=(0,s.Y0)("Bitcoin seed");function v(e){return(1<=256)throw Error("Depth too large!");return w((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new k(E,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));let r=new Uint8Array(37);if(2147483648&e){if(!this.privateKey)throw Error("cannot derive child of neutered node");r.set((0,i.arrayify)(this.privateKey),1),t&&(t+="'")}else r.set((0,i.arrayify)(this.publicKey));for(let n=24;n>=0;n-=8)r[33+(n>>3)]=e>>24-n&255;let s=(0,i.arrayify)((0,c.Gy)(h.p.sha512,this.chainCode,r)),a=s.slice(0,32),u=s.slice(32),f=null,d=null;if(this.privateKey)f=b(o.O$.from(a).add(this.privateKey).mod(g));else{let p=new l.SigningKey((0,i.hexlify)(a));d=p._addPoint(this.publicKey)}let m=t,y=this.mnemonic;return y&&(m=Object.freeze({phrase:y.phrase,path:t,locale:y.locale||"en"})),new k(E,f,d,this.fingerprint,b(u),e,this.depth+1,m)}derivePath(e){let t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let n=0;n=2147483648)throw Error("invalid path index - "+i);r=r._derive(2147483648+o)}else if(i.match(/^[0-9]+$/)){let s=parseInt(i);if(s>=2147483648)throw Error("invalid path index - "+i);r=r._derive(s)}else throw Error("invalid path component - "+i)}return r}static _fromSeed(e,t){let r=(0,i.arrayify)(e);if(r.length<16||r.length>64)throw Error("invalid seed");let n=(0,i.arrayify)((0,c.Gy)(h.p.sha512,y,r));return new k(E,b(n.slice(0,32)),null,"0x00000000",b(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=x(P(e,r=A(r)),r),k._fromSeed(C(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return k._fromSeed(e,null)}static fromExtendedKey(e){let t=n.Base58.decode(e);(82!==t.length||w(t.slice(0,78))!==e)&&m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let r=t[4],o=(0,i.hexlify)(t.slice(5,9)),s=parseInt((0,i.hexlify)(t.slice(9,13)).substring(2),16),a=(0,i.hexlify)(t.slice(13,45)),u=t.slice(45,78);switch((0,i.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new k(E,null,(0,i.hexlify)(u),o,a,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new k(E,(0,i.hexlify)(u.slice(1)),null,o,a,s,r,null)}return m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function C(e,t){t||(t="");let r=(0,s.Y0)("mnemonic"+t,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(e,s.Uj.NFKD),r,2048,64,"sha512")}function P(e,t){t=A(t),m.checkNormalize();let r=t.split(e);if(r.length%3!=0)throw Error("invalid mnemonic");let n=(0,i.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),o=0;for(let s=0;s>3]|=1<<7-o%8),o++}let l=32*r.length/3,h=r.length/3,f=v(h),d=(0,i.arrayify)((0,c.JQ)(n.slice(0,l/8)))[0]&f;if(d!==(n[n.length-1]&f))throw Error("invalid checksum");return(0,i.hexlify)(n.slice(0,l/8))}function x(e,t){if(t=A(t),(e=(0,i.arrayify)(e)).length%4!=0||e.length<16||e.length>32)throw Error("invalid entropy");let r=[0],n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=e[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[o]>>8-n,r.push(e[o]&(1<<8-n)-1),n+=3);let s=e.length/4,a=(0,i.arrayify)((0,c.JQ)(e))[0]&v(s);return r[r.length-1]<<=s,r[r.length-1]|=a>>8-s,t.join(r.map(e=>t.getWord(e)))}function O(e,t){try{return P(e,t),!0}catch(r){}return!1}function _(e){return("number"!=typeof e||e<0||e>=2147483648||e%1)&&m.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}},29816:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="json-wallets/5.7.0"},45659:function(e,t,r){"use strict";r.r(t),r.d(t,{decryptCrowdsale:function(){return g},decryptJsonWallet:function(){return A},decryptJsonWalletSync:function(){return E},decryptKeystore:function(){return w.pe},decryptKeystoreSync:function(){return w.hb},encryptKeystore:function(){return w.HI},getJsonWalletAddress:function(){return b},isCrowdsaleWallet:function(){return y},isKeystoreWallet:function(){return v}});var n=r(78826),i=r.n(n),o=r(19485),s=r(16441),a=r(38197),u=r(85306),l=r(29251),c=r(6881),h=r(1581),f=r(29816),d=r(97013);let p=new h.Logger(f.i);class m extends c.Description{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}}function g(e,t){let r=JSON.parse(e);t=(0,d.Ij)(t);let n=(0,o.getAddress)((0,d.gx)(r,"ethaddr")),c=(0,d.p3)((0,d.gx)(r,"encseed"));c&&c.length%16==0||p.throwArgumentError("invalid encseed","json",e);let h=(0,s.arrayify)((0,u.n)(t,t,2e3,32,"sha256")).slice(0,16),f=c.slice(0,16),g=c.slice(16),y=new(i()).ModeOfOperation.cbc(h,f),v=i().padding.pkcs7.strip((0,s.arrayify)(y.decrypt(g))),b="";for(let w=0;w{t=(0,u.arrayify)(t);let r=t.slice(0,16),n=t.slice(16,32),o=t.slice(32,64),s=new(i()).Counter(C),a=new(i()).ModeOfOperation.ctr(r,s),l=(0,u.arrayify)(a.encrypt(g)),h=(0,c.keccak256)((0,u.concat)([n,l])),d={address:e.address.substring(2).toLowerCase(),id:(0,m.EH)(P),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,u.hexlify)(C).substring(2)},ciphertext:(0,u.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,u.hexlify)(k).substring(2),n:x,dklen:32,p:_,r:O},mac:h.substring(2)}};if(v){let p=(0,f.O)(16),y=new(i()).Counter(p),b=new(i()).ModeOfOperation.ctr(o,y),E=(0,u.arrayify)(b.encrypt(v)),R=new Date,T=R.getUTCFullYear()+"-"+(0,m.VP)(R.getUTCMonth()+1,2)+"-"+(0,m.VP)(R.getUTCDate(),2)+"T"+(0,m.VP)(R.getUTCHours(),2)+"-"+(0,m.VP)(R.getUTCMinutes(),2)+"-"+(0,m.VP)(R.getUTCSeconds(),2)+".0Z";d["x-ethers"]={client:S,gethFilename:"UTC--"+T+"--"+d.address,mnemonicCounter:(0,u.hexlify)(p).substring(2),mnemonicCiphertext:(0,u.hexlify)(E).substring(2),path:w,locale:A,version:"0.1"}}return JSON.stringify(d)})}},97013:function(e,t,r){"use strict";r.d(t,{EH:function(){return l},Ij:function(){return a},VP:function(){return s},gx:function(){return u},p3:function(){return o}});var n=r(16441),i=r(29251);function o(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,n.arrayify)(e)}function s(e,t){for(e=String(e);e.length{try{if("test"!=="test".normalize(t))throw Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(t){return t.message}return null}();(o=n||(n={})).DEBUG="DEBUG",o.INFO="INFO",o.WARNING="WARNING",o.ERROR="ERROR",o.OFF="OFF",(s=i||(i={})).UNKNOWN_ERROR="UNKNOWN_ERROR",s.NOT_IMPLEMENTED="NOT_IMPLEMENTED",s.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",s.NETWORK_ERROR="NETWORK_ERROR",s.SERVER_ERROR="SERVER_ERROR",s.TIMEOUT="TIMEOUT",s.BUFFER_OVERRUN="BUFFER_OVERRUN",s.NUMERIC_FAULT="NUMERIC_FAULT",s.MISSING_NEW="MISSING_NEW",s.INVALID_ARGUMENT="INVALID_ARGUMENT",s.MISSING_ARGUMENT="MISSING_ARGUMENT",s.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",s.CALL_EXCEPTION="CALL_EXCEPTION",s.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",s.NONCE_EXPIRED="NONCE_EXPIRED",s.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",s.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",s.TRANSACTION_REPLACED="TRANSACTION_REPLACED",s.ACTION_REJECTED="ACTION_REJECTED";let d="0123456789abcdef";class p{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let r=e.toLowerCase();null==l[r]&&this.throwArgumentError("invalid log level name","logLevel",e),c>l[r]||console.log.apply(console,t)}debug(...e){this._log(p.levels.DEBUG,e)}info(...e){this._log(p.levels.INFO,e)}warn(...e){this._log(p.levels.WARNING,e)}makeError(e,t,r){if(u)return this.makeError("censored error",t,{});t||(t=p.errors.UNKNOWN_ERROR),r||(r={});let n=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let i="";for(let o=0;o>4]+d[15&t[o]];n.push(e+"=Uint8Array(0x"+i+")")}else n.push(e+"="+JSON.stringify(t))}catch(s){n.push(e+"="+JSON.stringify(r[e].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);let o=e,s="";switch(t){case i.NUMERIC_FAULT:{s="NUMERIC_FAULT";let a=e;switch(a){case"overflow":case"underflow":case"division-by-zero":s+="-"+a;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case i.CALL_EXCEPTION:case i.INSUFFICIENT_FUNDS:case i.MISSING_NEW:case i.NONCE_EXPIRED:case i.REPLACEMENT_UNDERPRICED:case i.TRANSACTION_REPLACED:case i.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(e+=" ("+n.join(", ")+")");let l=Error(e);return l.reason=o,l.code=t,Object.keys(r).forEach(function(e){l[e]=r[e]}),l}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,p.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",p.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,p.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||null==e)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",p.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||null==e)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return h||(h=new p("logger/5.7.0")),h}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a){if(!e)return;this.globalLogger().throwError("error censorship permanent",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!e,a=!!t}static setLogLevel(e){let t=l[e.toLowerCase()];if(null==t){p.globalLogger().warn("invalid log level - "+e);return}c=t}static from(e){return new p(e)}}p.errors=i,p.levels=n},85306:function(e,t,r){"use strict";r.d(t,{n:function(){return o}});var n=r(16441),i=r(2006);function o(e,t,r,o,s){let a,u,l;e=(0,n.arrayify)(e),t=(0,n.arrayify)(t);let c=1,h=new Uint8Array(o),f=new Uint8Array(t.length+4);f.set(t);for(let d=1;d<=c;d++){f[t.length]=d>>24&255,f[t.length+1]=d>>16&255,f[t.length+2]=d>>8&255,f[t.length+3]=255&d;let p=(0,n.arrayify)((0,i.Gy)(s,e,f));a||(a=p.length,l=new Uint8Array(a),c=Math.ceil(o/a),u=o-(c-1)*a),l.set(p);for(let m=1;m{let r=e[t];return Promise.resolve(r).then(e=>({key:t,value:e}))}),r=yield Promise.all(t);return r.reduce((e,t)=>(e[t.key]=t.value,e),{})},new(n||(n=Promise))(function(e,o){function s(e){try{u(i.next(e))}catch(t){o(t)}}function a(e){try{u(i.throw(e))}catch(t){o(t)}}function u(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(s,a)}u((i=i.apply(t,r||[])).next())})}function u(e,t){e&&"object"==typeof e||i.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||i.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}function l(e){let t={};for(let r in e)t[r]=e[r];return t}let c={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function h(e){return function(e){if(function e(t){if(null==t||c[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;let r=Object.keys(t);for(let n=0;nh(e)));if("object"==typeof e){let t={};for(let r in e){let n=e[r];void 0!==n&&o(t,r,h(n))}return t}return i.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}(e)}class f{constructor(e){for(let t in e)this[t]=h(e[t])}}},8605:function(e,t,r){"use strict";r.r(t),r.d(t,{AlchemyProvider:function(){return eM},AlchemyWebSocketProvider:function(){return eT},AnkrProvider:function(){return eL},BaseProvider:function(){return en},CloudflareProvider:function(){return eF},EtherscanProvider:function(){return ez},FallbackProvider:function(){return e4},Formatter:function(){return R},InfuraProvider:function(){return te},InfuraWebSocketProvider:function(){return e9},IpcProvider:function(){return e5},JsonRpcBatchProvider:function(){return tt},JsonRpcProvider:function(){return ev},JsonRpcSigner:function(){return em},NodesmithProvider:function(){return tn},PocketProvider:function(){return ts},Provider:function(){return n.zt},Resolver:function(){return ee},StaticJsonRpcProvider:function(){return ex},UrlJsonRpcProvider:function(){return eO},Web3Provider:function(){return tc},WebSocketProvider:function(){return eC},getDefaultProvider:function(){return tf},getNetwork:function(){return f},isCommunityResourcable:function(){return T},isCommunityResource:function(){return M},showThrottleMessage:function(){return I}});var n=r(81556),i=r(1581);let o=new i.Logger("networks/5.7.1");function s(e){let t=function(t,r){null==r&&(r={});let n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(i){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(o){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(s){}if(t.PocketProvider&&"-"!==r.pocket)try{let a=new t.PocketProvider(e,r.pocket);a.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(a.network.name)&&n.push(a)}catch(u){}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(l){}if(t.AnkrProvider&&"-"!==r.ankr)try{let c=new t.AnkrProvider(e,r.ankr);c.network&&-1===["ropsten"].indexOf(c.network.name)&&n.push(c)}catch(h){}if(0===n.length)return null;if(t.FallbackProvider){let f=1;return null!=r.quorum?f=r.quorum:"homestead"===e&&(f=2),new t.FallbackProvider(n,f)}return n[0]};return t.renetwork=function(e){return s(e)},t}function a(e,t){let r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return a(e,t)},r}let u={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:s("homestead")},l={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:s("ropsten")},c={chainId:63,name:"classicMordor",_defaultProvider:a("https://www.ethercluster.com/mordor","classicMordor")},h={unspecified:{chainId:0,name:"unspecified"},homestead:u,mainnet:u,morden:{chainId:2,name:"morden"},ropsten:l,testnet:l,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:s("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:s("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:s("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:s("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:a("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:c,classicTestnet:c,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:a("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:s("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:s("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function f(e){if(null==e)return null;if("number"==typeof e){for(let t in h){let r=h[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){let n=h[e];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}let i=h[e.name];if(!i)return"number"!=typeof e.chainId&&o.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==i.chainId&&o.throwArgumentError("network chainId mismatch","network",e);let s=e._defaultProvider||null;if(null==s&&i._defaultProvider){var a;s=(a=i._defaultProvider)&&"function"==typeof a.renetwork?i._defaultProvider.renetwork(e):i._defaultProvider}return{name:e.name,chainId:i.chainId,ensAddress:e.ensAddress||i.ensAddress||null,_defaultProvider:s}}var d=r(59567),p=r(57727),m=r(2593),g=r(16441),y=r(57218),v=r(27586),b=r(6881),w=r(2006),A=r(29251),E=r(37707),S=r(92882),k=r.n(S);let C="providers/5.7.2";var P=r(19485),x=r(9279),O=r(83875);let _=new i.Logger(C);class R{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),u=this.type.bind(this),l=e=>this.data(e,!0);return e.transaction={hash:o,type:u,accessList:R.allowNull(this.accessList.bind(this),null),blockHash:R.allowNull(o,null),blockNumber:R.allowNull(a,null),transactionIndex:R.allowNull(a,null),confirmations:R.allowNull(a,null),from:t,gasPrice:R.allowNull(r),maxPriorityFeePerGas:R.allowNull(r),maxFeePerGas:R.allowNull(r),gasLimit:r,to:R.allowNull(t,null),value:r,nonce:a,data:i,r:R.allowNull(this.uint256),s:R.allowNull(this.uint256),v:R.allowNull(a),creates:R.allowNull(t,null),raw:R.allowNull(i)},e.transactionRequest={from:R.allowNull(t),nonce:R.allowNull(a),gasLimit:R.allowNull(r),gasPrice:R.allowNull(r),maxPriorityFeePerGas:R.allowNull(r),maxFeePerGas:R.allowNull(r),to:R.allowNull(t),value:R.allowNull(r),data:R.allowNull(l),type:R.allowNull(a),accessList:R.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:t,topics:R.arrayOf(o),data:i,logIndex:a,blockHash:o},e.receipt={to:R.allowNull(this.address,null),from:R.allowNull(this.address,null),contractAddress:R.allowNull(t,null),transactionIndex:a,root:R.allowNull(s),gasUsed:r,logsBloom:R.allowNull(i),blockHash:o,transactionHash:o,logs:R.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:R.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:R.allowNull(r),status:R.allowNull(a),type:u},e.block={hash:R.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:R.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:R.allowNull(t),extraData:i,transactions:R.allowNull(R.arrayOf(o)),baseFeePerGas:R.allowNull(r)},e.blockWithTransactions=(0,b.shallowCopy)(e.block),e.blockWithTransactions.transactions=R.allowNull(R.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:R.allowNull(n,void 0),toBlock:R.allowNull(n,void 0),blockHash:R.allowNull(o,void 0),address:R.allowNull(t,void 0),topics:R.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:R.allowNull(a),blockHash:R.allowNull(o),transactionIndex:a,removed:R.allowNull(this.boolean.bind(this)),address:t,data:R.allowFalsish(i,"0x"),topics:R.arrayOf(o),transactionHash:o,logIndex:a},e}accessList(e){return(0,O.accessListify)(e||[])}number(e){return"0x"===e?0:m.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:m.O$.from(e).toNumber()}bigNumber(e){return m.O$.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,g.isHexString)(e))?e.toLowerCase():_.throwArgumentError("invalid hash","value",e)}data(e,t){let r=this.hex(e,t);if(r.length%2!=0)throw Error("invalid data; odd-length - "+e);return r}address(e){return(0,P.getAddress)(e)}callAddress(e){if(!(0,g.isHexString)(e,32))return null;let t=(0,P.getAddress)((0,g.hexDataSlice)(e,12));return t===x.d?null:t}contractAddress(e){return(0,P.getContractAddress)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||(0,g.isHexString)(e))return(0,g.hexValue)(e);throw Error("invalid blockTag")}hash(e,t){let r=this.hex(e,t);return 32!==(0,g.hexDataLength)(r)?_.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;let t=m.O$.from(e);try{return t.toNumber()}catch(r){}return null}uint256(e){if(!(0,g.isHexString)(e))throw Error("invalid uint256");return(0,g.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);let r=null!=e._difficulty?e._difficulty:e.difficulty,n=R.check(t,e);return n._difficulty=null==r?null:m.O$.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return R.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&m.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),(1===e.type||2===e.type)&&null==e.accessList&&(e.accessList=[]);let t=R.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,g.isHexString)(r)&&(r=m.O$.from(r).toNumber()),t.chainId=r}else{let n=e.networkId;null==n&&null==t.v&&(n=e.chainId),(0,g.isHexString)(n)&&(n=m.O$.from(n).toNumber()),"number"!=typeof n&&null!=t.v&&((n=(t.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),t.chainId=n}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,O.parse)(e)}receiptLog(e){return R.check(this.formats.receiptLog,e)}receipt(e){let t=R.check(this.formats.receipt,e);if(null!=t.root){if(t.root.length<=4){let r=m.O$.from(t.root).toNumber();0===r||1===r?(null!=t.status&&t.status!==r&&_.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=r,delete t.root):_.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&_.throwArgumentError("invalid root hash","value.root",t.root)}return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map(e=>this.topics(e)):null!=e?this.hash(e,!0):null}filter(e){return R.check(this.formats.filter,e)}filterLog(e){return R.check(this.formats.filterLog,e)}static check(e,t){let r={};for(let n in e)try{let i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(o){throw o.checkKey=n,o.checkValue=t[n],o}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw Error("not an array");let r=[];return t.forEach(function(t){r.push(e(t))}),r}}}function T(e){return e&&"function"==typeof e.isCommunityResource}function M(e){return T(e)&&e.isCommunityResource()}let N=!1;function I(){N||(N=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var L=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let B=new i.Logger(C);function F(e){return null==e?"null":(32!==(0,g.hexDataLength)(e)&&B.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function D(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map(e=>{if(!Array.isArray(e))return F(e);{let t={};e.forEach(e=>{t[F(e)]=!0});let r=Object.keys(t);return r.sort(),r.join("|")}}).join("&")}function U(e){if("string"==typeof e){if(e=e.toLowerCase(),32===(0,g.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else if(Array.isArray(e))return"filter:*:"+D(e);else if(n.Sg.isForkEvent(e))throw B.warn("not implemented"),Error("not implemented");else if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+D(e.topics||[]);throw Error("invalid event - "+e)}function j(){return new Date().getTime()}function q(e){return new Promise(t=>{setTimeout(t,e)})}let H=["block","network","pending","poll"];class K{constructor(e,t,r){(0,b.defineReadOnly)(this,"tag",e),(0,b.defineReadOnly)(this,"listener",t),(0,b.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){let e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){var e;let t=this.tag.split(":");if("filter"!==t[0])return null;let r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map(e=>{if(""===e)return[];let t=e.split("|").map(e=>"null"===e?null:e);return 1===t.length?t[0]:t}),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||H.indexOf(this.tag)>=0}}let G={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function z(e){return(0,g.hexZeroPad)(m.O$.from(e).toHexString(),32)}function W(e){return p.Base58.encode((0,g.concat)([e,(0,g.hexDataSlice)((0,w.JQ)((0,w.JQ)(e)),0,4)]))}let Q=RegExp("^(ipfs)://(.*)$","i"),J=[RegExp("^(https)://(.*)$","i"),RegExp("^(data):(.*)$","i"),Q,RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function V(e,t){try{return(0,A.ZN)(Y(e,t))}catch(r){}return null}function Y(e,t){if("0x"===e)return null;let r=m.O$.from((0,g.hexDataSlice)(e,t,t+32)).toNumber(),n=m.O$.from((0,g.hexDataSlice)(e,r,r+32)).toNumber();return(0,g.hexDataSlice)(e,r+32,r+32+n)}function $(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):B.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Z(e){let t=(0,g.arrayify)(e);if(t.length>32)throw Error("internal; should not happen");let r=new Uint8Array(32);return r.set(t,32-t.length),r}function X(e){let t=[],r=0;for(let n=0;nm.O$.from(e).eq(1)).catch(e=>{if(e.code===i.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,t){return L(this,void 0,void 0,function*(){let r={to:this.address,ccipReadEnabled:!0,data:(0,g.hexConcat)([e,(0,v.VM)(this.name),t||"0x"])},n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,g.hexConcat)(["0x9061b923",X([(0,v.Kn)(this.name),r.data])]));try{let o=yield this.provider.call(r);return(0,g.arrayify)(o).length%32==4&&B.throwError("resolver threw error",i.Logger.errors.CALL_EXCEPTION,{transaction:r,data:o}),n&&(o=Y(o,0)),o}catch(s){if(s.code===i.Logger.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,t){return L(this,void 0,void 0,function*(){let r=yield this._fetch(e,t);return null!=r?Y(r,0):null})}_getAddress(e,t){let r=G[String(e)];if(null==r&&B.throwError(`unsupported coin type: ${e}`,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);let n=(0,g.arrayify)(t);if(null!=r.p2pkh){let o=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){let s=parseInt(o[1],16);if(o[2].length===2*s&&s>=1&&s<=75)return W((0,g.concat)([[r.p2pkh],"0x"+o[2]]))}}if(null!=r.p2sh){let a=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){let u=parseInt(a[1],16);if(a[2].length===2*u&&u>=1&&u<=75)return W((0,g.concat)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){let l=n[1],c=n[0];if(0===c?20!==l&&32!==l&&(c=-1):c=-1,c>=0&&n.length===2+l&&l>=1&&l<=75){let h=k().toWords(n.slice(2));return h.unshift(c),k().encode(r.prefix,h)}}return null}getAddress(e){return L(this,void 0,void 0,function*(){if(null==e&&(e=60),60===e)try{let t=yield this._fetch("0x3b3b57de");if("0x"===t||t===y.R)return null;return this.provider.formatter.callAddress(t)}catch(r){if(r.code===i.Logger.errors.CALL_EXCEPTION)return null;throw r}let n=yield this._fetchBytes("0xf1cb7e06",z(e));if(null==n||"0x"===n)return null;let o=this._getAddress(e,n);return null==o&&B.throwError("invalid or unsupported coin data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:n}),o})}getAvatar(){return L(this,void 0,void 0,function*(){let e=[{type:"name",content:this.name}];try{let t=yield this.getText("avatar");if(null==t)return null;for(let r=0;ru[e]);return"sia://"+l}return B.throwError("invalid or unsupported content hash data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return L(this,void 0,void 0,function*(){let t=(0,A.Y0)(e);(t=(0,g.concat)([z(64),z(t.length),t])).length%32!=0&&(t=(0,g.concat)([t,(0,g.hexZeroPad)("0x",32-e.length%32)]));let r=yield this._fetchBytes("0x59d1d43c",(0,g.hexlify)(t));return null==r||"0x"===r?null:(0,A.ZN)(r)})}}let et=null,er=1;class en extends n.zt{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,b.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(e=>{}),this._ready().catch(e=>{});else{let t=(0,b.getStatic)(new.target,"getNetwork")(e);t?((0,b.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):B.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return L(this,void 0,void 0,function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(t){}null==e&&(e=yield this.detectNetwork()),e||B.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:(0,b.defineReadOnly)(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return(0,E.poll)(()=>this._ready().then(e=>e,e=>{if(e.code!==i.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}static getFormatter(){return null==et&&(et=new R),et}static getNetwork(e){return f(null==e?"homestead":e)}ccipReadFetch(e,t,r){return L(this,void 0,void 0,function*(){if(this.disableCcipRead||0===r.length)return null;let n=e.to.toLowerCase(),o=t.toLowerCase(),s=[];for(let a=0;a=0?null:JSON.stringify({data:o,sender:n}),h=yield(0,E.fetchJson)({url:l,errorPassThrough:!0},c,(e,t)=>(e.status=t.statusCode,e));if(h.data)return h.data;let f=h.message||"unknown error";if(h.status>=400&&h.status<500)return B.throwError(`response not found during CCIP fetch: ${f}`,i.Logger.errors.SERVER_ERROR,{url:u,errorMessage:f});s.push(f)}return B.throwError(`error encountered during CCIP fetch: ${s.map(e=>JSON.stringify(e)).join(", ")}`,i.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:s})})}_getInternalBlockNumber(e){return L(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){let t=this._internalBlockNumber;try{let r=yield t;if(j()-r.respTime<=e)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===t)break}}let i=j(),o=(0,b.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(e=>null,e=>e)}).then(({blockNumber:e,networkError:t})=>{if(t)throw this._internalBlockNumber===o&&(this._internalBlockNumber=null),t;let r=j();return(e=m.O$.from(e).toNumber()){this._internalBlockNumber===o&&(this._internalBlockNumber=null)}),(yield o).blockNumber})}poll(){return L(this,void 0,void 0,function*(){let e=er++,t=[],r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){this.emit("error",n);return}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r===this._lastBlockNumber){this.emit("didPoll",e);return}if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)B.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",B.makeError("network block skew detected",i.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let o=this._emitted.block+1;o<=r;o++)this.emit("block",o);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(e=>{if("block"===e)return;let t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]})),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach(e=>{switch(e.type){case"tx":{let n=e.hash,i=this.getTransactionReceipt(n).then(e=>(e&&null!=e.blockNumber&&(this._emitted["t:"+n]=e.blockNumber,this.emit(n,e)),null)).catch(e=>{this.emit("error",e)});t.push(i);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);let o=e.filter;o.fromBlock=e._lastBlockNumber+1,o.toBlock=r;let s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);let a=this.getLogs(o).then(t=>{e._inflight=!1,0!==t.length&&t.forEach(t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(o,t)})}).catch(t=>{this.emit("error",t),e._inflight=!1});t.push(a)}}}),this._lastBlockNumber=r,Promise.all(t).then(()=>{this.emit("didPoll",e)}).catch(e=>{this.emit("error",e)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return L(this,void 0,void 0,function*(){return B.throwError("provider does not support network detection",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return L(this,void 0,void 0,function*(){let e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield q(0),this._network;let r=B.makeError("underlying network changed",i.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let e=j();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){(null==this._fastBlockNumber||!(ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return L(this,void 0,void 0,function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)})}_waitForTransaction(e,t,r,n){return L(this,void 0,void 0,function*(){let o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise((o,s)=>{let a=[],u=!1,l=function(){return!!u||(u=!0,a.forEach(e=>{e()}),!1)},c=e=>{e.confirmations{this.removeListener(e,c)}),n){let h=n.startBlock,f=null,d=r=>L(this,void 0,void 0,function*(){u||(yield q(1e3),this.getTransactionCount(n.from).then(o=>L(this,void 0,void 0,function*(){if(!u){if(o<=n.nonce)h=r;else{{let a=yield this.getTransaction(e);if(a&&null!=a.blockNumber)return}for(null==f&&(f=h-3){u||this.once("block",d)}))});if(u)return;this.once("block",d),a.push(()=>{this.removeListener("block",d)})}if("number"==typeof r&&r>0){let p=setTimeout(()=>{l()||s(B.makeError("timeout exceeded",i.Logger.errors.TIMEOUT,{timeout:r}))},r);p.unref&&p.unref(),a.push(()=>{clearTimeout(p)})}})})}getBlockNumber(){return L(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return L(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield this.perform("getGasPrice",{});try{return m.O$.from(e)}catch(t){return B.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}})}getBalance(e,t){return L(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,b.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return m.O$.from(n)}catch(o){return B.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:o})}})}getTransactionCount(e,t){return L(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,b.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return m.O$.from(n).toNumber()}catch(o){return B.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:o})}})}getCode(e,t){return L(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,b.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,g.hexlify)(n)}catch(o){return B.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:o})}})}getStorageAt(e,t,r){return L(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield(0,b.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then(e=>(0,g.hexValue)(e))}),o=yield this.perform("getStorageAt",n);try{return(0,g.hexlify)(o)}catch(s){return B.throwError("bad result from backend",i.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:s})}})}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,g.hexDataLength)(t))throw Error("invalid response - sendTransaction");let n=e;return null!=t&&e.hash!==t&&B.throwError("Transaction hash mismatch from Provider.sendTransaction.",i.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>L(this,void 0,void 0,function*(){let o;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});let s=yield this._waitForTransaction(e.hash,t,n,o);return null==s&&0===t?null:(this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&B.throwError("transaction failed",i.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),s)}),n}sendTransaction(e){return L(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield Promise.resolve(e).then(e=>(0,g.hexlify)(e)),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let i=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,i,n)}catch(o){throw o.transaction=r,o.transactionHash=r.hash,o}})}_getTransactionRequest(e){return L(this,void 0,void 0,function*(){let t=yield e,r={};return["from","to"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?this._getAddress(e):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?m.O$.from(e):null))}),["type"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>null!=e?e:null))}),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?(0,g.hexlify)(e):null))}),this.formatter.transactionRequest((yield(0,b.resolveProperties)(r)))})}_getFilter(e){return L(this,void 0,void 0,function*(){e=yield e;let t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(r=>{null!=e[r]&&(t[r]=e[r])}),["fromBlock","toBlock"].forEach(r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))}),this.formatter.filter((yield(0,b.resolveProperties)(t)))})}_call(e,t,r){return L(this,void 0,void 0,function*(){r>=10&&B.throwError("CCIP read exceeded maximum redirections",i.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e});let n=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===o.substring(0,10)&&(0,g.hexDataLength)(o)%32==4)try{let s=(0,g.hexDataSlice)(o,4),a=(0,g.hexDataSlice)(s,0,32);m.O$.from(a).eq(n)||B.throwError("CCIP Read sender did not match",i.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});let u=[],l=m.O$.from((0,g.hexDataSlice)(s,32,64)).toNumber(),c=m.O$.from((0,g.hexDataSlice)(s,l,l+32)).toNumber(),h=(0,g.hexDataSlice)(s,l+32);for(let f=0;fL(this,void 0,void 0,function*(){let e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let i=null;for(let o=0;othis._wrapTransaction(e)),u}return this.formatter.block(e)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return L(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return(0,E.poll)(()=>L(this,void 0,void 0,function*(){let r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;let n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let i=yield this._getInternalBlockNumber(100+2*this.pollingInterval),o=i-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(e){return L(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return(0,E.poll)(()=>L(this,void 0,void 0,function*(){let r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;let n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let i=yield this._getInternalBlockNumber(100+2*this.pollingInterval),o=i-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return n}),{oncePoll:this})})}getLogs(e){return L(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield(0,b.resolveProperties)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach(e=>{null==e.removed&&(e.removed=!1)}),R.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return L(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return L(this,void 0,void 0,function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&B.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return(t+=e)<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)})}getResolver(e){return L(this,void 0,void 0,function*(){let t=e;for(;;){if(""===t||"."===t||"eth"!==e&&"eth"===t)return null;let r=yield this._getResolver(t,"getResolver");if(null!=r){let n=new ee(this,r,e);if(t!==e&&!(yield n.supportsWildcard()))return null;return n}t=t.split(".").slice(1).join(".")}})}_getResolver(e,t){return L(this,void 0,void 0,function*(){null==t&&(t="ENS");let r=yield this.getNetwork();r.ensAddress||B.throwError("network does not support ENS",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{let n=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,v.VM)(e).substring(2)});return this.formatter.callAddress(n)}catch(o){}return null})}resolveName(e){return L(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if((0,g.isHexString)(e))throw t}"string"!=typeof e&&B.throwArgumentError("invalid ENS name","name",e);let r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return L(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);let t=e.substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;let n=V((yield this.call({to:r,data:"0x691f3431"+(0,v.VM)(t).substring(2)})),0),i=yield this.resolveName(n);return i!=e?null:n})}getAvatar(e){return L(this,void 0,void 0,function*(){let t=null;if((0,g.isHexString)(e)){let r=this.formatter.address(e),n=r.substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(n,"getAvatar");if(!o)return null;t=new ee(this,o,n);try{let s=yield t.getAvatar();if(s)return s.url}catch(a){if(a.code!==i.Logger.errors.CALL_EXCEPTION)throw a}try{let u=V((yield this.call({to:o,data:"0x691f3431"+(0,v.VM)(n).substring(2)})),0);t=yield this.getResolver(u)}catch(l){if(l.code!==i.Logger.errors.CALL_EXCEPTION)throw l;return null}}else if(!(t=yield this.getResolver(e)))return null;let c=yield t.getAvatar();return null==c?null:c.url})}perform(e,t){return B.throwError(e+" not implemented",i.Logger.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(e,t,r){let n=new K(U(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=U(e);return this._events=this._events.filter(e=>e.tag!==i||(setTimeout(()=>{e.listener.apply(this,t)},0),r=!0,!e.once||(n.push(e),!1))),n.forEach(e=>{this._stopEvent(e)}),r}listenerCount(e){if(!e)return this._events.length;let t=U(e);return this._events.filter(e=>e.tag===t).length}listeners(e){if(null==e)return this._events.map(e=>e.listener);let t=U(e);return this._events.filter(e=>e.tag===t).map(e=>e.listener)}off(e,t){if(null==t)return this.removeAllListeners(e);let r=[],n=!1,i=U(e);return this._events=this._events.filter(e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1)),r.forEach(e=>{this._stopEvent(e)}),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{let r=U(e);this._events=this._events.filter(e=>e.tag!==r||(t.push(e),!1))}return t.forEach(e=>{this._stopEvent(e)}),this}}var ei=r(48088),eo=r(67827),es=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let ea=new i.Logger(C),eu=["call","estimateGas"];function el(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){let r=(0,g.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(let n in e){let i=el(e[n],t);if(i)return i}return null}if("string"==typeof e)try{return el(JSON.parse(e),t)}catch(o){}return null}function ec(e,t,r){let n=r.transaction||r.signedTransaction;if("call"===e){let o=el(t,!0);if(o)return o.data;ea.throwError("missing revert data in call exception; Transaction reverted without a reason string",i.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let s=el(t.body,!1);null==s&&(s=el(t,!1)),s&&ea.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:e,transaction:n,error:t})}let a=t.message;throw t.code===i.Logger.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?a=t.error.message:"string"==typeof t.body?a=t.body:"string"==typeof t.responseText&&(a=t.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ea.throwError("insufficient funds for intrinsic transaction cost",i.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),a.match(/nonce (is )?too low/i)&&ea.throwError("nonce has already been used",i.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ea.throwError("replacement fee too low",i.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),a.match(/only replay-protected/i)&&ea.throwError("legacy pre-eip-155 transactions not supported",i.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),eu.indexOf(e)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ea.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function eh(e){return new Promise(function(t){setTimeout(t,e)})}function ef(e){if(e.error){let t=Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function ed(e){return e?e.toLowerCase():e}let ep={};class em extends ei.Signer{constructor(e,t,r){if(super(),e!==ep)throw Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,b.defineReadOnly)(this,"provider",t),null==r&&(r=0),"string"==typeof r?((0,b.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,b.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,b.defineReadOnly)(this,"_index",r),(0,b.defineReadOnly)(this,"_address",null)):ea.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return ea.throwError("cannot alter JSON-RPC Signer connection",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new eg(ep,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&ea.throwError("unknown account #"+this._index,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=(0,b.shallowCopy)(e);let t=this.getAddress().then(e=>(e&&(e=e.toLowerCase()),e));if(null==e.gasLimit){let r=(0,b.shallowCopy)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then(e=>es(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.provider.resolveName(e);return null==t&&ea.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))),(0,b.resolveProperties)({tx:(0,b.resolveProperties)(e),sender:t}).then(({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&ea.throwArgumentError("from address mismatch","transaction",e):t.from=r;let n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then(e=>e,e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&ea.throwError("user rejected transaction",i.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),ec("sendTransaction",e,n)))})}signTransaction(e){return ea.throwError("signing transactions is unsupported",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return es(this,void 0,void 0,function*(){let t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield(0,E.poll)(()=>es(this,void 0,void 0,function*(){let e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}})}signMessage(e){return es(this,void 0,void 0,function*(){let t="string"==typeof e?(0,A.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,g.hexlify)(t),r.toLowerCase()])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&ea.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),n}})}_legacySignMessage(e){return es(this,void 0,void 0,function*(){let t="string"==typeof e?(0,A.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,g.hexlify)(t)])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&ea.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),n}})}_signTypedData(e,t,r){return es(this,void 0,void 0,function*(){let n=yield eo.E.resolveNames(e,t,r,e=>this.provider.resolveName(e)),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(eo.E.getPayload(n.domain,t,n.value))])}catch(s){throw"string"==typeof s.message&&s.message.match(/user denied/i)&&ea.throwError("user rejected signing",i.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:t,value:n.value}}),s}})}unlock(e){return es(this,void 0,void 0,function*(){let t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])})}}class eg extends em{sendTransaction(e){return this.sendUncheckedTransaction(e).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)}))}}let ey={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class ev extends en{constructor(e,t){let r=t;null==r&&(r=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(t=>{e(t)},e=>{t(e)})},0)})),super(r),e||(e=(0,b.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof e?(0,b.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,b.defineReadOnly)(this,"connection",Object.freeze((0,b.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return es(this,void 0,void 0,function*(){yield eh(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(r){try{e=yield this.send("net_version",[])}catch(t){}}if(null!=e){let n=(0,b.getStatic)(this.constructor,"getNetwork");try{return n(m.O$.from(e).toNumber())}catch(o){return ea.throwError("could not detect network",i.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:o})}}return ea.throwError("could not detect network",i.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new em(ep,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(e=>this.formatter.address(e)))}send(e,t){let r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,b.deepCopy)(r),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];let i=(0,E.fetchJson)(this.connection,JSON.stringify(r),ef).then(e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e});return n&&(this._cache[e]=i,setTimeout(()=>{this._cache[e]=null},0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[ed(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[ed(t.address),t.blockTag]];case"getCode":return["eth_getCode",[ed(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[ed(t.address),(0,g.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":if(t.blockTag)return["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]];if(t.blockHash)return["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]];break;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":{let r=(0,b.getStatic)(this.constructor,"hexlifyTransaction");return["eth_call",[r(t.transaction,{from:!0}),t.blockTag]]}case"estimateGas":{let n=(0,b.getStatic)(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[n(t.transaction,{from:!0})]]}case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=ed(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return es(this,void 0,void 0,function*(){if("call"===e||"estimateGas"===e){let r=t.transaction;if(r&&null!=r.type&&m.O$.from(r.type).isZero()&&null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas){let n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=(0,b.shallowCopy)(t)).transaction=(0,b.shallowCopy)(r),delete t.transaction.type)}}let o=this.prepareRequest(e,t);null==o&&ea.throwError(e+" not implemented",i.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(o[0],o[1])}catch(s){return ec(e,s,t)}})}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;let e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(r){return function n(){e.send("eth_getFilterChanges",[r]).then(function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach(function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then(function(){return e.getTransaction(t).then(function(t){return e.emit("pending",t),null})})}),n.then(function(){return eh(1e3)})}).then(function(){if(e._pendingFilter!=t){e.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){n()},0),null}).catch(e=>{})}(),r}).catch(e=>{})}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){let r=(0,b.shallowCopy)(ey);if(t)for(let n in t)t[n]&&(r[n]=!0);(0,b.checkProperties)(e,r);let i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(t){if(null==e[t])return;let r=(0,g.hexValue)(m.O$.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r}),["from","to","data"].forEach(function(t){null!=e[t]&&(i[t]=(0,g.hexlify)(e[t]))}),e.accessList&&(i.accessList=(0,O.accessListify)(e.accessList)),i}}let eb=null;try{if(eb=WebSocket,null==eb)throw Error("inject please")}catch(eA){let ew=new i.Logger(C);eb=function(){ew.throwError("WebSockets not supported in this environment",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var eE=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let eS=new i.Logger(C),ek=1;class eC extends ev{constructor(e,t){"any"===t&&eS.throwError("WebSocketProvider does not support 'any' network yet",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),"string"==typeof e?super(e,t):super("_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof e?(0,b.defineReadOnly)(this,"_websocket",new eb(this.connection.url)):(0,b.defineReadOnly)(this,"_websocket",e),(0,b.defineReadOnly)(this,"_requests",{}),(0,b.defineReadOnly)(this,"_subs",{}),(0,b.defineReadOnly)(this,"_subIds",{}),(0,b.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(e=>{this.websocket.send(this._requests[e].payload)})},this.websocket.onmessage=e=>{let t=e.data,r=JSON.parse(t);if(null!=r.id){let n=String(r.id),i=this._requests[n];if(delete this._requests[n],void 0!==r.result)i.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(i.payload),response:r.result,provider:this});else{let o=null;r.error?(o=Error(r.error.message||"unknown error"),(0,b.defineReadOnly)(o,"code",r.error.code||null),(0,b.defineReadOnly)(o,"response",t)):o=Error("unknown error"),i.callback(o,void 0),this.emit("debug",{action:"response",error:o,request:JSON.parse(i.payload),provider:this})}}else if("eth_subscription"===r.method){let s=this._subs[r.params.subscription];s&&s.processFunc(r.params.result)}else console.warn("this should not happen")};let r=setInterval(()=>{this.emit("poll")},1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){eS.throwError("cannot reset events block on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){eS.throwError("cannot set polling interval on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return eE(this,void 0,void 0,function*(){return null})}set polling(e){e&&eS.throwError("cannot set polling on WebSocketProvider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){let r=ek++;return new Promise((n,i)=>{let o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:o},this._wsReady&&this.websocket.send(o)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return eE(this,void 0,void 0,function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then(e=>this.send("eth_subscribe",e)),this._subIds[e]=n);let i=yield n;this._subs[i]={tag:e,processFunc:r}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],e=>{let t=m.O$.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],e=>{this.emit("pending",e)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))});break;case"tx":{let t=e=>{let t=e.hash;this.getTransactionReceipt(t).then(e=>{e&&this.emit(t,e)})};t(e),this._subscribe("tx",["newHeads"],e=>{this._events.filter(e=>"tx"===e.type).forEach(t)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter(e=>"tx"===e.type).length)return;t="tx"}else if(this.listenerCount(e.event))return;let r=this._subIds[t];r&&(delete this._subIds[t],r.then(e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))}))}destroy(){return eE(this,void 0,void 0,function*(){this.websocket.readyState===eb.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}}let eP=new i.Logger(C);class ex extends ev{detectNetwork(){var e,t,r,n;let o=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return e=this,t=void 0,r=void 0,n=function*(){let e=this.network;return null==e&&((e=yield o.detectNetwork.call(this))||eP.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,b.defineReadOnly)(this,"_network",e),this.emit("network",e,null))),e},new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})}}class eO extends ex{constructor(e,t){eP.checkAbstract(new.target,eO),e=(0,b.getStatic)(new.target,"getNetwork")(e),t=(0,b.getStatic)(new.target,"getApiKey")(t);let r=(0,b.getStatic)(new.target,"getUrl")(e,t);super(r,e),"string"==typeof t?(0,b.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach(e=>{(0,b.defineReadOnly)(this,e,t[e])})}_startPending(){eP.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return eP.throwError("API provider does not support signing",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return eP.throwError("not implemented; sub-classes must override getUrl",i.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}let e_=new i.Logger(C),eR="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class eT extends eC{constructor(e,t){let r=new eM(e,t),n=r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(n,r.network),(0,b.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===eR}}class eM extends eO{static getWebSocketProvider(e,t){return new eT(e,t)}static getApiKey(e){return null==e?eR:(e&&"string"!=typeof e&&e_.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:e_.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===eR&&I(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===eR}}let eN=new i.Logger(C),eI="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class eL extends eO{isCommunityResource(){return this.apiKey===eI}static getApiKey(e){return null==e?eI:e}static getUrl(e,t){null==t&&(t=eI);let r={allowGzip:!0,url:"https://"+function(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return eN.throwArgumentError("unsupported network","name",e)}(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===eI&&I(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}let eB=new i.Logger(C);class eF extends eO{static getApiKey(e){return null!=e&&eB.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;return"homestead"===e.name?r="https://cloudflare-eth.com/":eB.throwArgumentError("unsupported network","network",arguments[0]),r}perform(e,t){var r,n,i,o;let s=Object.create(null,{perform:{get:()=>super.perform}});return r=this,n=void 0,i=void 0,o=function*(){if("getBlockNumber"===e){let r=yield s.perform.call(this,"getBlock",{blockTag:"latest"});return r.number}return s.perform.call(this,e,t)},new(i||(i=Promise))(function(e,t){function s(e){try{u(o.next(e))}catch(r){t(r)}}function a(e){try{u(o.throw(e))}catch(r){t(r)}}function u(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(s,a)}u((o=o.apply(r,n||[])).next())})}}var eD=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let eU=new i.Logger(C);function ej(e){let t={};for(let r in e){if(null==e[r])continue;let n=e[r];("type"!==r||0!==n)&&(n=({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0})[r]?(0,g.hexValue)((0,g.hexlify)(n)):"accessList"===r?"["+(0,O.accessListify)(n).map(e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`).join(",")+"]":(0,g.hexlify)(n),t[r]=n)}return t}function eq(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){let t=Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function eH(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){let t=Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){let r=Error("invalid response");throw r.result=JSON.stringify(e),r}if(e.error){let n=Error(e.error.message||"unknown error");throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function eK(e){if("pending"===e)throw Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function eG(e,t,r){if("call"===e&&t.code===i.Logger.errors.SERVER_ERROR){let n=t.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){let o=n.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),(0,g.isHexString)(o))return o;eU.throwError("missing revert data in call exception",i.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let s=t.message;throw t.code===i.Logger.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?s=t.error.message:"string"==typeof t.body?s=t.body:"string"==typeof t.responseText&&(s=t.responseText)),(s=(s||"").toLowerCase()).match(/insufficient funds/)&&eU.throwError("insufficient funds for intrinsic transaction cost",i.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),s.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&eU.throwError("nonce has already been used",i.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),s.match(/another transaction with same nonce/)&&eU.throwError("replacement fee too low",i.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),s.match(/execution failed due to an exception|execution reverted/)&&eU.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class ez extends en{constructor(e,t){super(e),(0,b.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,b.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return eU.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){let r=Object.keys(t).reduce((e,r)=>{let n=t[r];return null!=n&&(e+=`&${r}=${n}`),e},""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return eD(this,void 0,void 0,function*(){let n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null;this.emit("debug",{action:"request",request:n,provider:this});let o={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&I(),Promise.resolve(!0))},s=null;i&&(o.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map(e=>`${e}=${i[e]}`).join("&"));let a=yield(0,E.fetchJson)(o,s,("proxy"===e?eH:eq)||eH);return this.emit("debug",{action:"response",request:n,response:(0,b.deepCopy)(a),provider:this}),a})}detectNetwork(){return eD(this,void 0,void 0,function*(){return this.network})}perform(e,t){let r=Object.create(null,{perform:{get:()=>super.perform}});return eD(this,void 0,void 0,function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch(e=>eG("sendTransaction",e,t.signedTransaction));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw Error("EtherscanProvider does not support blockTag for call");let n=ej(t.transaction);n.module="proxy",n.action="eth_call";try{return yield this.fetch("proxy",n,!0)}catch(o){return eG("call",o,t.transaction)}}case"estimateGas":{let s=ej(t.transaction);s.module="proxy",s.action="eth_estimateGas";try{return yield this.fetch("proxy",s,!0)}catch(a){return eG("estimateGas",a,t.transaction)}}case"getLogs":{let u={action:"getLogs"};if(t.filter.fromBlock&&(u.fromBlock=eK(t.filter.fromBlock)),t.filter.toBlock&&(u.toBlock=eK(t.filter.toBlock)),t.filter.address&&(u.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&eU.throwError("unsupported topic count",i.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){let l=t.filter.topics[0];("string"!=typeof l||66!==l.length)&&eU.throwError("unsupported topic format",i.Logger.errors.UNSUPPORTED_OPERATION,{topic0:l}),u.topic0=l}let c=yield this.fetch("logs",u),h={};for(let f=0;f{["contractAddress","to"].forEach(function(t){""==e[t]&&delete e[t]}),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);let t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t})})}isCommunityResource(){return null==this.apiKey}}var eW=r(52472),eQ=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let eJ=new i.Logger(C);function eV(){return new Date().getTime()}function eY(e){let t=null;for(let r=0;rt?null:(n+i)/2}function eZ(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(m.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map(e=>eZ(e)));if("object"==typeof e){let t=Object.keys(e);return t.sort(),"{"+t.map(t=>{let r=e[t];return r="function"==typeof r?"[function]":eZ(r),JSON.stringify(t)+":"+r}).join(",")+"}"}throw Error("unknown value type: "+typeof e)}let eX=1;function e0(e){let t=null,r=null,n=new Promise(n=>{r=setTimeout(t=function(){r&&(clearTimeout(r),r=null),n()},e)}),i=e=>n=n.then(e);return{cancel:t,getPromise:function(){return n},wait:i}}let e1=[i.Logger.errors.CALL_EXCEPTION,i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED,i.Logger.errors.UNPREDICTABLE_GAS_LIMIT],e2=["address","args","errorArgs","errorSignature","method","transaction"];function e3(e,t){let r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function e6(e,t){return eQ(this,void 0,void 0,function*(){let r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:(0,E.poll)(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}class e4 extends en{constructor(e,t){0===e.length&&eJ.throwArgumentError("missing providers","providers",e);let r=e.map((e,t)=>{if(n.zt.isProvider(e)){let r=M(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}let i=(0,b.shallowCopy)(e);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=M(e)?2e3:750),null==i.weight&&(i.weight=1);let o=i.weight;return(o%1||o>512||o<1)&&eJ.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,o),Object.freeze(i)}),i=r.reduce((e,t)=>e+t.weight,0);null==t?t=i/2:t>i&&eJ.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let o=eY(r.map(e=>e.provider.network));null==o&&(o=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(e,t)},0)})),super(o),(0,b.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,b.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return eQ(this,void 0,void 0,function*(){let e=yield Promise.all(this.providerConfigs.map(e=>e.provider.getNetwork()));return eY(e)})}perform(e,t){return eQ(this,void 0,void 0,function*(){if("sendTransaction"===e){let r=yield Promise.all(this.providerConfigs.map(e=>e.provider.sendTransaction(t.signedTransaction).then(e=>e.hash,e=>e)));for(let n=0;ne.result),n=e$(t.map(e=>e.result),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){let t=e.map(e=>e.result);return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return e$(e.map(e=>e.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":o=function(e){return null==e?null:((e=(0,b.shallowCopy)(e)).confirmations=-1,eZ(e))};break;case"getBlock":o=r.includeTransactions?function(e){return null==e?null:((e=(0,b.shallowCopy)(e)).transactions=e.transactions.map(e=>((e=(0,b.shallowCopy)(e)).confirmations=-1,e)),eZ(e))}:function(e){return null==e?null:eZ(e)};break;default:throw Error("unknown method: "+t)}return n=o,i=e.quorum,function(e){let t={};e.forEach(e=>{let r=n(e.result);t[r]||(t[r]={count:0,result:e.result}),t[r].count++});let r=Object.keys(t);for(let o=0;o=i)return s.result}}}(this,e,t),a=(0,eW.y)(this.providerConfigs.map(b.shallowCopy));a.sort((e,t)=>e.priority-t.priority);let u=this._highestBlockNumber,l=0,c=!0;for(;;){let h=eV(),f=a.filter(e=>e.runner&&h-e.starte+t.weight,0);for(;f{d.staller=null}),d.runner=(function(e,t,r,n){return eQ(this,void 0,void 0,function*(){let o=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return o[r]();case"getEtherPrice":if(o.getEtherPrice)return o.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,g.isHexString)(n.blockTag)&&(o=yield e6(e,t)),o[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,g.isHexString)(n.blockTag)&&(o=yield e6(e,t)),o.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,g.isHexString)(n.blockTag)&&(o=yield e6(e,t)),o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":if(n.blockTag&&(0,g.isHexString)(n.blockTag)&&(o=yield e6(e,t)),"call"===r&&n.blockTag)return o[r](n.transaction,n.blockTag);return o[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return o[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&(0,g.isHexString)(s.fromBlock)||s.toBlock&&(0,g.isHexString)(s.toBlock))&&(o=yield e6(e,t)),o.getLogs(s)}}return eJ.throwError("unknown method error",i.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})})})(d,u,e,t).then(r=>{d.done=!0,d.result=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:e3(d,eV()),request:{method:e,params:(0,b.deepCopy)(t)},provider:this})},r=>{d.done=!0,d.error=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:e3(d,eV()),request:{method:e,params:(0,b.deepCopy)(t)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:e3(d,null),request:{method:e,params:(0,b.deepCopy)(t)},provider:this}),f+=d.weight}let m=[];a.forEach(e=>{!e.done&&e.runner&&(m.push(e.runner),e.staller&&m.push(e.staller.getPromise()))}),m.length&&(yield Promise.race(m));let y=a.filter(e=>e.done&&null==e.error);if(y.length>=this.quorum){let v=s(y);if(void 0!==v)return a.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}),v;c||(yield e0(100).getPromise()),c=!1}let w=a.reduce((e,t)=>{if(!t.done||null==t.error)return e;let r=t.error.code;return e1.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e},{});if(Object.keys(w).forEach(e=>{let t=w[e];if(t.weight{e.staller&&e.staller.cancel(),e.cancelled=!0});let r=t.error,n={};e2.forEach(e=>{null!=r[e]&&(n[e]=r[e])}),eJ.throwError(r.reason||r.message,e,n)}),0===a.filter(e=>!e.done).length)break}return a.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}),eJ.throwError("failed to meet quorum",i.Logger.errors.SERVER_ERROR,{method:e,params:t,results:a.map(e=>e3(e)),provider:this})})}}let e5=null,e8=new i.Logger(C),e7="84842078b09946638c03157f83405213";class e9 extends eC{constructor(e,t){let r=new te(e,t),n=r.connection;n.password&&e8.throwError("INFURA WebSocket project secrets unsupported",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});let o=n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(o,e),(0,b.defineReadOnly)(this,"apiKey",r.projectId),(0,b.defineReadOnly)(this,"projectId",r.projectId),(0,b.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===e7}}class te extends eO{static getWebSocketProvider(e,t){return new e9(e,t)}static getApiKey(e){let t={apiKey:e7,projectId:e7,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(e8.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),e8.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:e8.throwError("unsupported network",i.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===e7&&I(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===e7}}class tt extends ev{send(e,t){let r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);let n={request:r,resolve:null,reject:null},i=new Promise((e,t)=>{n.resolve=e,n.reject=t});return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{let e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;let t=e.map(e=>e.request);return this.emit("debug",{action:"requestBatch",request:(0,b.deepCopy)(t),provider:this}),(0,E.fetchJson)(this.connection,JSON.stringify(t)).then(r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach((e,t)=>{let n=r[t];if(n.error){let i=Error(n.error.message);i.code=n.error.code,i.data=n.error.data,e.reject(i)}else e.resolve(n.result)})},r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach(e=>{e.reject(r)})})},10)),i}}let tr=new i.Logger(C);class tn extends eO{static getApiKey(e){return e&&"string"!=typeof e&&tr.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){tr.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:tr.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}let ti=new i.Logger(C),to="62e1ad51b37b8e00394bda3b";class ts extends eO{static getApiKey(e){let t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=to:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:ti.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:ti.throwError("unsupported network",i.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n=`https://${r}/v1/lb/${t.applicationId}`,o={headers:{},url:n};return null!=t.applicationSecretKey&&(o.user="",o.password=t.applicationSecretKey),o}isCommunityResource(){return this.applicationId===to}}let ta=new i.Logger(C),tu=1;function tl(e,t){let r="Web3LegacyFetcher";return function(e,n){let i={method:e,params:n,id:tu++,jsonrpc:"2.0"};return new Promise((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,b.deepCopy)(i),provider:this}),t(i,(t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:i,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:o,provider:this}),o.error){let s=Error(o.error.message);return s.code=o.error.code,s.data=o.error.data,n(s)}e(o.result)})})}}class tc extends ev{constructor(e,t){null==e&&ta.throwArgumentError("missing provider","provider",e);let r=null,n=null,i=null;"function"==typeof e?(r="unknown:",n=e):(((r=e.host||e.path||"")||!e.isMetaMask||(r="metamask"),i=e,e.request)?(""===r&&(r="eip-1193:"),n=function(t,r){null==r&&(r=[]);let n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,b.deepCopy)(n),provider:this}),e.request(n).then(e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e})}):e.sendAsync?n=tl(e,e.sendAsync.bind(e)):e.send?n=tl(e,e.send.bind(e)):ta.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,b.defineReadOnly)(this,"jsonRpcFetchFunc",n),(0,b.defineReadOnly)(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}let th=new i.Logger(C);function tf(e,t){if(null==e&&(e="homestead"),"string"==typeof e){let r=e.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new ev(e);case"ws":case"wss":return new eC(e);default:th.throwArgumentError("unsupported URL scheme","network",e)}}let n=f(e);return n&&n._defaultProvider||th.throwError("unsupported getDefaultProvider network",i.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),n._defaultProvider({FallbackProvider:e4,AlchemyProvider:eM,AnkrProvider:eL,CloudflareProvider:eF,EtherscanProvider:ez,InfuraProvider:te,JsonRpcProvider:ev,NodesmithProvider:tn,PocketProvider:ts,Web3Provider:tc,IpcProvider:e5},t)}},22118:function(e,t,r){"use strict";r.r(t),r.d(t,{randomBytes:function(){return n.O},shuffled:function(){return i.y}});var n=r(5634),i=r(52472)},5634:function(e,t,r){"use strict";r.d(t,{O:function(){return u}});var n=r(16441),i=r(1581);let o=new i.Logger("random/5.7.0"),s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error("unable to locate global object")}(),a=s.crypto||s.msCrypto;function u(e){(e<=0||e>1024||e%1||e!=e)&&o.throwArgumentError("invalid length","length",e);let t=new Uint8Array(e);return a.getRandomValues(t),(0,n.arrayify)(t)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(e){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},52472:function(e,t,r){"use strict";function n(e){e=e.slice();for(let t=e.length-1;t>0;t--){let r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}r.d(t,{y:function(){return n}})},59052:function(e,t,r){"use strict";r.r(t),r.d(t,{decode:function(){return h},encode:function(){return u}});var n=r(16441),i=r(1581);let o=new i.Logger("rlp/5.7.0");function s(e){let t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function a(e,t,r){let n=0;for(let i=0;it+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function c(e,t){if(0===e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){let r=e[t]-247;t+1+r>e.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});let s=a(e,t+1,r);return t+1+r+s>e.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+r,r+s)}if(e[t]>=192){let u=e[t]-192;return t+1+u>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,u)}if(e[t]>=184){let c=e[t]-183;t+1+c>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});let h=a(e,t+1,c);t+1+c+h>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});let f=(0,n.hexlify)(e.slice(t+1+c,t+1+c+h));return{consumed:1+c+h,result:f}}if(e[t]>=128){let d=e[t]-128;t+1+d>e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{});let p=(0,n.hexlify)(e.slice(t+1,t+1+d));return{consumed:1+d,result:p}}return{consumed:1,result:(0,n.hexlify)(e[t])}}function h(e){let t=(0,n.arrayify)(e),r=c(t,0);return r.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),r.result}},91278:function(e,t,r){"use strict";r.r(t),r.d(t,{SupportedAlgorithm:function(){return i.p},computeHmac:function(){return n.Gy},ripemd160:function(){return n.bP},sha256:function(){return n.JQ},sha512:function(){return n.o}});var n=r(2006),i=r(21261)},2006:function(e,t,r){"use strict";r.d(t,{Gy:function(){return f},bP:function(){return l},JQ:function(){return c},o:function(){return h}});var n=r(33715),i=r.n(n),o=r(16441),s=r(21261),a=r(1581);let u=new a.Logger("sha2/5.7.0");function l(e){return"0x"+i().ripemd160().update((0,o.arrayify)(e)).digest("hex")}function c(e){return"0x"+i().sha256().update((0,o.arrayify)(e)).digest("hex")}function h(e){return"0x"+i().sha512().update((0,o.arrayify)(e)).digest("hex")}function f(e,t,r){return s.p[e]||u.throwError("unsupported algorithm "+e,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+i().hmac(i()[e],(0,o.arrayify)(t)).update((0,o.arrayify)(r)).digest("hex")}},21261:function(e,t,r){"use strict";var n,i;r.d(t,{p:function(){return n}}),(i=n||(n={})).sha256="sha256",i.sha512="sha512"},67669:function(e,t,r){"use strict";r.r(t),r.d(t,{SigningKey:function(){return K},computePublicKey:function(){return z},recoverPublicKey:function(){return G}});var n=r(13550),i=r.n(n),o=r(33715),s=r.n(o);function a(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e,null==t?r.path:t)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var u=l;function l(e,t){if(!e)throw Error(t||"Assertion failed")}l.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var c=a(function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}}),h=a(function(e,t){var r=t;r.assert=u,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function(e,t,r){var n=Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,s,a,u=e.andln(3)+n&3,l=t.andln(3)+i&3;3===u&&(u=-1),3===l&&(l=-1),s=(1&u)==0?0:(3==(o=e.andln(7)+n&7)||5===o)&&2===l?-u:u,r[0].push(s),a=(1&l)==0?0:(3==(o=t.andln(7)+i&7)||5===o)&&2===u?-l:l,r[1].push(a),2*n===s+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(i())(e,"hex","le")}}),f=h.getNAF,d=h.getJSF,p=h.assert;function m(e,t){this.type=e,this.p=new(i())(t.p,16),this.red=t.prime?i().red(t.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=t.n&&new(i())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function g(e,t){this.curve=e,this.type=t,this.precomputed=null}m.prototype.point=function(){throw Error("Not implemented")},m.prototype.validate=function(){throw Error("Not implemented")},m.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r,n,i=e._getDoubles(),o=f(t,1,this._bitLength),s=(1<=r;u--)n=(n<<1)+o[u];a.push(n)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=s;h>0;h--){for(r=0;r=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var l=o[a];p(0!==l),s="affine"===e.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},m.prototype._wnafMulAdd=function(e,t,r,n,i){var o,s,a,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,h=0;for(o=0;o=1;o-=2){var m=o-1,g=o;if(1!==u[m]||1!==u[g]){c[m]=f(r[m],u[m],this._bitLength),c[g]=f(r[g],u[g],this._bitLength),h=Math.max(c[m].length,h),h=Math.max(c[g].length,h);continue}var y=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(y[1]=t[m].add(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].add(t[g].neg())):(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[m],r[g]);for(s=0,h=Math.max(b[0].length,h),c[m]=Array(h),c[g]=Array(h);s=0;o--){for(var k=0;o>=0;){var C=!0;for(s=0;s=0&&k++,E=E.dblp(k),o<0)break;for(s=0;s0?a=l[s][P-1>>1]:P<0&&(a=l[s][-P-1>>1].neg()),E="affine"===a.type?E.mixedAdd(a):E.add(a))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},g.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;io[0].cmp(o[1])?o[0]:o[1]).toRed(this.red)}if(e.lambda)r=new(i())(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],v(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return n=e.basis?e.basis.map(function(e){return{a:new(i())(e.a,16),b:new(i())(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:n}}},b.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i().mont(e),r=new(i())(2).toRed(t).redInvm(),n=r.redNeg(),o=new(i())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},b.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,u,l,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),p=new(i())(1),m=new(i())(0),g=new(i())(0),y=new(i())(1),v=0;0!==f.cmpn(0);){var b=d.div(f);l=d.sub(b.mul(f)),c=g.sub(b.mul(p));var w=y.sub(b.mul(m));if(!n&&0>l.cmp(h))t=u.neg(),r=p,n=l.neg(),o=c;else if(n&&2==++v)break;u=l,d=f,f=l,g=p,p=c,y=m,m=w}s=l.neg(),a=c;var A=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(A)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},b.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(l).neg()}},b.prototype.pointFromX=function(e,t){(e=new(i())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},b.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},b.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},w.prototype.isInfinity=function(){return this.inf},w.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},w.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},w.prototype.getX=function(){return this.x.fromRed()},w.prototype.getY=function(){return this.y.fromRed()},w.prototype.mul=function(e){return(e=new(i())(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},w.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},w.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},w.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},w.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},w.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(A,m.BasePoint),b.prototype.jpoint=function(e,t,r){return new A(this,e,t,r)},A.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},A.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},A.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),c=l.redMul(a),h=n.redMul(l),f=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,d,p)},A.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),c=r.redMul(u),h=a.redSqr().redIAdd(l).redISub(c).redISub(c),f=a.redMul(c.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(s);return this.curve.jpoint(h,f,d)},A.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},A.prototype.inspect=function(){return this.isInfinity()?"":""},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var E=a(function(e,t){var r=t;r.base=m,r.short=b,r.mont=null,r.edwards=null}),S=a(function(e,t){var r,n=t,i=h.assert;function o(e){"short"===e.type?this.curve=new E.short(e):"edwards"===e.type?this.curve=new E.edwards(e):this.curve=new E.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(u){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function k(e){if(!(this instanceof k))return new k(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=c.toArray(e.entropy,e.entropyEnc||"hex"),r=c.toArray(e.nonce,e.nonceEnc||"hex"),n=c.toArray(e.pers,e.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}k.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},k.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=c.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var x=h.assert;function O(e,t){if(e instanceof O)return e;this._importDER(e,t)||(x(e.r&&e.s,"Signature without r or s"),this.r=new(i())(e.r,16),this.s=new(i())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function _(){this.place=0}function R(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o>>=0;return!(i<=127)&&(t.place=s,i)}function T(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}O.prototype._importDER=function(e,t){e=h.toArray(e,t);var r=new _;if(48!==e[r.place++])return!1;var n=R(e,r);if(!1===n||n+r.place!==e.length||2!==e[r.place++])return!1;var o=R(e,r);if(!1===o)return!1;var s=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var a=R(e,r);if(!1===a||e.length!==a+r.place)return!1;var u=e.slice(r.place,a+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new(i())(s),this.s=new(i())(u),this.recoveryParam=null,!0},O.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=T(t),r=T(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];M(n,t.length),(n=n.concat(t)).push(2),M(n,r.length);var i=n.concat(r),o=[48];return M(o,i.length),o=o.concat(i),h.encode(o,e)};var N=function(){throw Error("unsupported")},I=h.assert;function L(e){if(!(this instanceof L))return new L(e);"string"==typeof e&&(I(Object.prototype.hasOwnProperty.call(S,e),"Unknown curve "+e),e=S[e]),e instanceof S.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}L.prototype.keyPair=function(e){return new P(this,e)},L.prototype.keyFromPrivate=function(e,t){return P.fromPrivate(this,e,t)},L.prototype.keyFromPublic=function(e,t){return P.fromPublic(this,e,t)},L.prototype.genKeyPair=function(e){e||(e={});for(var t=new k({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||N(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(i())(2));;){var o=new(i())(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},L.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return(r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},L.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(i())(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),a=e.toArray("be",o),u=new k({hash:this.hash,entropy:s,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new(i())(1)),c=0;;c++){var h=n.k?n.k(c):new(i())(u.generate(this.n.byteLength()));if(!(0>=(h=this._truncateToN(h,!0)).cmpn(1)||h.cmp(l)>=0)){var f=this.g.mul(h);if(!f.isInfinity()){var d=f.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var m=h.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new O({r:p,s:m,recoveryParam:g})}}}}}},L.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(i())(e,16)),r=this.keyFromPublic(r,n);var o,s=(t=new O(t,"hex")).r,a=t.s;if(0>s.cmpn(1)||s.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var u=a.invm(this.n),l=u.mul(e).umod(this.n),c=u.mul(s).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&o.eqXToP(s):!(o=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===o.getX().umod(this.n).cmp(s)},L.prototype.recoverPubKey=function(e,t,r,n){I((3&r)===r,"The recovery param is more than two bits"),t=new O(t,n);var o=this.n,s=new(i())(e),a=t.r,u=t.s,l=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var h=t.r.invm(o),f=o.sub(s).mul(h).umod(o),d=u.mul(h).umod(o);return this.g.mulAdd(f,a,d)},L.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new O(t,n)).recoveryParam)return t.recoveryParam;for(var i,o=0;o<4;o++){try{i=this.recoverPubKey(e,t,o)}catch(s){continue}if(i.eq(r))return o}throw Error("Unable to find valid recovery factor")};var B=a(function(e,t){var r=t;r.version="6.5.4",r.utils=h,r.rand=function(){throw Error("unsupported")},r.curve=E,r.curves=S,r.ec=L,r.eddsa=null}).ec,F=r(16441),D=r(6881),U=r(1581);let j=new U.Logger("signing-key/5.7.0"),q=null;function H(){return q||(q=new B("secp256k1")),q}class K{constructor(e){(0,D.defineReadOnly)(this,"curve","secp256k1"),(0,D.defineReadOnly)(this,"privateKey",(0,F.hexlify)(e)),32!==(0,F.hexDataLength)(this.privateKey)&&j.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=H().keyFromPrivate((0,F.arrayify)(this.privateKey));(0,D.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,D.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,D.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){let t=H().keyFromPublic((0,F.arrayify)(this.publicKey)),r=H().keyFromPublic((0,F.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){let t=H().keyFromPrivate((0,F.arrayify)(this.privateKey)),r=(0,F.arrayify)(e);32!==r.length&&j.throwArgumentError("bad digest length","digest",e);let n=t.sign(r,{canonical:!0});return(0,F.splitSignature)({recoveryParam:n.recoveryParam,r:(0,F.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,F.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let t=H().keyFromPrivate((0,F.arrayify)(this.privateKey)),r=H().keyFromPublic((0,F.arrayify)(z(e)));return(0,F.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function G(e,t){let r=(0,F.splitSignature)(t),n={r:(0,F.arrayify)(r.r),s:(0,F.arrayify)(r.s)};return"0x"+H().recoverPubKey((0,F.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function z(e,t){let r=(0,F.arrayify)(e);if(32===r.length){let n=new K(r);return t?"0x"+H().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?(0,F.hexlify)(r):"0x"+H().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+H().keyFromPublic(r).getPublic(!0,"hex"):(0,F.hexlify)(r):j.throwArgumentError("invalid public or private key","key","[REDACTED]")}},31886:function(e,t,r){"use strict";r.r(t),r.d(t,{keccak256:function(){return p},pack:function(){return d},sha256:function(){return m}});var n=r(2593),i=r(16441),o=r(38197),s=r(2006),a=r(29251),u=r(1581);let l=RegExp("^bytes([0-9]+)$"),c=RegExp("^(u?int)([0-9]*)$"),h=RegExp("^(.*)\\[([0-9]*)\\]$"),f=new u.Logger("solidity/5.7.0");function d(e,t){e.length!=t.length&&f.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);let r=[];return e.forEach(function(e,o){r.push(function e(t,r,o){switch(t){case"address":if(o)return(0,i.zeroPad)(r,32);return(0,i.arrayify)(r);case"string":return(0,a.Y0)(r);case"bytes":return(0,i.arrayify)(r);case"bool":if(r=r?"0x01":"0x00",o)return(0,i.zeroPad)(r,32);return(0,i.arrayify)(r)}let s=t.match(c);if(s){let u=parseInt(s[2]||"256");return(s[2]&&String(u)!==s[2]||u%8!=0||0===u||u>256)&&f.throwArgumentError("invalid number type","type",t),o&&(u=256),r=n.O$.from(r).toTwos(u),(0,i.zeroPad)(r,u/8)}if(s=t.match(l)){let d=parseInt(s[1]);return((String(d)!==s[1]||0===d||d>32)&&f.throwArgumentError("invalid bytes type","type",t),(0,i.arrayify)(r).byteLength!==d&&f.throwArgumentError(`invalid value for ${t}`,"value",r),o)?(0,i.arrayify)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((s=t.match(h))&&Array.isArray(r)){let p=s[1],m=parseInt(s[2]||String(r.length));m!=r.length&&f.throwArgumentError(`invalid array length for ${t}`,"value",r);let g=[];return r.forEach(function(t){g.push(e(p,t,!0))}),(0,i.concat)(g)}return f.throwArgumentError("invalid type","type",t)}(e,t[o]))}),(0,i.hexlify)((0,i.concat)(r))}function p(e,t){return(0,o.keccak256)(d(e,t))}function m(e,t){return(0,s.JQ)(d(e,t))}},22384:function(e,t,r){"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:function(){return o.Uj},Utf8ErrorFuncs:function(){return o.te},Utf8ErrorReason:function(){return o.Uw},_toEscapedUtf8String:function(){return o.U$},formatBytes32String:function(){return s},nameprep:function(){return v},parseBytes32String:function(){return a},toUtf8Bytes:function(){return o.Y0},toUtf8CodePoints:function(){return o.XL},toUtf8String:function(){return o.ZN}});var n=r(57218),i=r(16441),o=r(29251);function s(e){let t=(0,o.Y0)(e);if(t.length>31)throw Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,n.R]).slice(0,32))}function a(e){let t=(0,i.arrayify)(e);if(32!==t.length)throw Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,o.ZN)(t.slice(0,r))}function u(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach(e=>{let i=e.split(":");n[r+=parseInt(i[0],16)]=t(i[1])}),n}function l(e){let t=0;return e.split(",").map(e=>{let r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}})}function c(e,t){let r=0;for(let n=0;n=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}let h=l("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),f="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(e=>parseInt(e,16)),d=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],p=u("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),m=u("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),g=u("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(e){if(e.length%4!=0)throw Error("bad data");let t=[];for(let r=0;rf.indexOf(e)>=0||e>=65024&&e<=65039?[]:function(e){let t=c(e,d);if(t)return[e+t.s];let r=p[e];if(r)return r;let n=m[e];return n?[e+n[0]]:g[e]||null}(e)||[e]).reduce((e,t)=>(t.forEach(t=>{e.push(t)}),e),[]),(t=(0,o.XL)((0,o.uu)(t),o.Uj.NFKC)).forEach(e=>{if(c(e,y))throw Error("STRINGPREP_CONTAINS_PROHIBITED")}),t.forEach(e=>{if(c(e,h))throw Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=(0,o.uu)(t);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw Error("invalid hyphen");return r}},29251:function(e,t,r){"use strict";r.d(t,{Uj:function(){return o},te:function(){return h},Uw:function(){return s},U$:function(){return m},uu:function(){return g},Y0:function(){return d},XL:function(){return v},ZN:function(){return y}});var n,i,o,s,a=r(16441),u=r(1581);let l=new u.Logger("strings/5.7.0");function c(e,t,r,n,i){if(e===s.BAD_PREFIX||e===s.UNEXPECTED_CONTINUE){let o=0;for(let a=t+1;a>6==2;a++)o++;return o}return e===s.OVERRUN?r.length-t-1:0}(n=o||(o={})).current="",n.NFC="NFC",n.NFD="NFD",n.NFKC="NFKC",n.NFKD="NFKD",(i=s||(s={})).UNEXPECTED_CONTINUE="unexpected continuation byte",i.BAD_PREFIX="bad codepoint prefix",i.OVERRUN="string overrun",i.MISSING_CONTINUE="missing continuation byte",i.OUT_OF_RANGE="out of UTF-8 range",i.UTF16_SURROGATE="UTF-16 surrogate",i.OVERLONG="overlong representation";let h=Object.freeze({error:function(e,t,r,n,i){return l.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:c,replace:function(e,t,r,n,i){return e===s.OVERLONG?(n.push(i),0):(n.push(65533),c(e,t,r,n,i))}});function f(e,t){null==t&&(t=h.error),e=(0,a.arrayify)(e);let r=[],n=0;for(;n>7==0){r.push(i);continue}let o=null,u=null;if((224&i)==192)o=1,u=127;else if((240&i)==224)o=2,u=2047;else if((248&i)==240)o=3,u=65535;else{(192&i)==128?n+=t(s.UNEXPECTED_CONTINUE,n-1,e,r):n+=t(s.BAD_PREFIX,n-1,e,r);continue}if(n-1+o>=e.length){n+=t(s.OVERRUN,n-1,e,r);continue}let l=i&(1<<8-o-1)-1;for(let c=0;c1114111){n+=t(s.OUT_OF_RANGE,n-1-o,e,r,l);continue}if(l>=55296&&l<=57343){n+=t(s.UTF16_SURROGATE,n-1-o,e,r,l);continue}if(l<=u){n+=t(s.OVERLONG,n-1-o,e,r,l);continue}r.push(l)}}return r}function d(e,t=o.current){t!=o.current&&(l.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n>6|192),r.push(63&i|128);else if((64512&i)==55296){n++;let s=e.charCodeAt(n);if(n>=e.length||(64512&s)!=56320)throw Error("invalid utf-8 string");let u=65536+((1023&i)<<10)+(1023&s);r.push(u>>18|240),r.push(u>>12&63|128),r.push(u>>6&63|128),r.push(63&u|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return(0,a.arrayify)(r)}function p(e){let t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function m(e,t){return'"'+f(e,t).map(e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?p(e):p(((e-=65536)>>10&1023)+55296)+p((1023&e)+56320)}).join("")+'"'}function g(e){return e.map(e=>e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10&1023)+55296,(1023&e)+56320)).join("")}function y(e,t){return g(f(e,t))}function v(e,t=o.current){return f(d(e,t))}},83875:function(e,t,r){"use strict";r.r(t),r.d(t,{TransactionTypes:function(){return i},accessListify:function(){return S},computeAddress:function(){return b},parse:function(){return _},recoverAddress:function(){return w},serialize:function(){return x}});var n,i,o=r(19485),s=r(2593),a=r(16441),u=r(21046),l=r(38197),c=r(6881),h=r(59052),f=r(67669),d=r(1581);let p=new d.Logger("transactions/5.7.0");function m(e){return"0x"===e?null:(0,o.getAddress)(e)}function g(e){return"0x"===e?u._Y:s.O$.from(e)}(n=i||(i={}))[n.legacy=0]="legacy",n[n.eip2930=1]="eip2930",n[n.eip1559=2]="eip1559";let y=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],v={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(e){let t=(0,f.computePublicKey)(e);return(0,o.getAddress)((0,a.hexDataSlice)((0,l.keccak256)((0,a.hexDataSlice)(t,1)),12))}function w(e,t){return b((0,f.recoverPublicKey)((0,a.arrayify)(e),t))}function A(e,t){let r=(0,a.stripZeros)(s.O$.from(e).toHexString());return r.length>32&&p.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function E(e,t){return{address:(0,o.getAddress)(e),storageKeys:(t||[]).map((t,r)=>(32!==(0,a.hexDataLength)(t)&&p.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase()))}}function S(e){if(Array.isArray(e))return e.map((e,t)=>Array.isArray(e)?(e.length>2&&p.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),E(e[0],e[1])):E(e.address,e.storageKeys));let t=Object.keys(e).map(t=>{let r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return E(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function k(e){return S(e).map(e=>[e.address,e.storageKeys])}function C(e,t){if(null!=e.gasPrice){let r=s.O$.from(e.gasPrice),n=s.O$.from(e.maxFeePerGas||0);r.eq(n)||p.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}let i=[A(e.chainId||0,"chainId"),A(e.nonce||0,"nonce"),A(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),A(e.maxFeePerGas||0,"maxFeePerGas"),A(e.gasLimit||0,"gasLimit"),null!=e.to?(0,o.getAddress)(e.to):"0x",A(e.value||0,"value"),e.data||"0x",k(e.accessList||[])];if(t){let u=(0,a.splitSignature)(t);i.push(A(u.recoveryParam,"recoveryParam")),i.push((0,a.stripZeros)(u.r)),i.push((0,a.stripZeros)(u.s))}return(0,a.hexConcat)(["0x02",h.encode(i)])}function P(e,t){let r=[A(e.chainId||0,"chainId"),A(e.nonce||0,"nonce"),A(e.gasPrice||0,"gasPrice"),A(e.gasLimit||0,"gasLimit"),null!=e.to?(0,o.getAddress)(e.to):"0x",A(e.value||0,"value"),e.data||"0x",k(e.accessList||[])];if(t){let n=(0,a.splitSignature)(t);r.push(A(n.recoveryParam,"recoveryParam")),r.push((0,a.stripZeros)(n.r)),r.push((0,a.stripZeros)(n.s))}return(0,a.hexConcat)(["0x01",h.encode(r)])}function x(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&p.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.checkProperties)(e,v);let r=[];y.forEach(function(t){let n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=(0,a.arrayify)((0,a.hexlify)(n,i)),t.length&&n.length!==t.length&&n.length>0&&p.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,a.stripZeros)(n)).length>t.maxLength&&p.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push((0,a.hexlify)(n))});let n=0;if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&p.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!(0,a.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,a.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return h.encode(r);let i=(0,a.splitSignature)(t),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,a.hexlify)(o)),r.push((0,a.stripZeros)((0,a.arrayify)(i.r))),r.push((0,a.stripZeros)((0,a.arrayify)(i.s))),h.encode(r)}(e,t);switch(e.type){case 1:return P(e,t);case 2:return C(e,t)}return p.throwError(`unsupported transaction type: ${e.type}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function O(e,t,r){try{let n=g(t[0]).toNumber();if(0!==n&&1!==n)throw Error("bad recid");e.v=n}catch(i){p.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,a.hexZeroPad)(t[1],32),e.s=(0,a.hexZeroPad)(t[2],32);try{let o=(0,l.keccak256)(r(e));e.from=w(o,{r:e.r,s:e.s,recoveryParam:e.v})}catch(s){}}function _(e){let t=(0,a.arrayify)(e);if(t[0]>127)return function(e){let t=h.decode(e);9!==t.length&&6!==t.length&&p.throwArgumentError("invalid raw transaction","rawTransaction",e);let r={nonce:g(t[0]).toNumber(),gasPrice:g(t[1]),gasLimit:g(t[2]),to:m(t[3]),value:g(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=s.O$.from(t[6]).toNumber()}catch(n){return r}if(r.r=(0,a.hexZeroPad)(t[7],32),r.s=(0,a.hexZeroPad)(t[8],32),s.O$.from(r.r).isZero()&&s.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let i=r.v-27,o=t.slice(0,6);0!==r.chainId&&(o.push((0,a.hexlify)(r.chainId)),o.push("0x"),o.push("0x"),i-=2*r.chainId+8);let u=(0,l.keccak256)(h.encode(o));try{r.from=w(u,{r:(0,a.hexlify)(r.r),s:(0,a.hexlify)(r.s),recoveryParam:i})}catch(c){}r.hash=(0,l.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){let t=h.decode(e.slice(1));8!==t.length&&11!==t.length&&p.throwArgumentError("invalid component count for transaction type: 1","payload",(0,a.hexlify)(e));let r={type:1,chainId:g(t[0]).toNumber(),nonce:g(t[1]).toNumber(),gasPrice:g(t[2]),gasLimit:g(t[3]),to:m(t[4]),value:g(t[5]),data:t[6],accessList:S(t[7])};return 8===t.length||(r.hash=(0,l.keccak256)(e),O(r,t.slice(8),P)),r}(t);case 2:return function(e){let t=h.decode(e.slice(1));9!==t.length&&12!==t.length&&p.throwArgumentError("invalid component count for transaction type: 2","payload",(0,a.hexlify)(e));let r=g(t[2]),n=g(t[3]),i={type:2,chainId:g(t[0]).toNumber(),nonce:g(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:g(t[4]),to:m(t[5]),value:g(t[6]),data:t[7],accessList:S(t[8])};return 9===t.length||(i.hash=(0,l.keccak256)(e),O(i,t.slice(9),C)),i}(t)}return p.throwError(`unsupported transaction type: ${t[0]}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},61744:function(e,t,r){"use strict";r.r(t),r.d(t,{commify:function(){return a},formatEther:function(){return c},formatUnits:function(){return u},parseEther:function(){return h},parseUnits:function(){return l}});var n=r(20335),i=r(1581);let o=new i.Logger("units/5.7.0"),s=["wei","kwei","mwei","gwei","szabo","finney","ether"];function a(e){let t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&o.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);let s=[];for(;r.length;){if(r.length<=3){s.unshift(r);break}{let a=r.length-3;s.unshift(r.substring(a)),r=r.substring(0,a)}}return n+s.join(",")+i}function u(e,t){if("string"==typeof t){let r=s.indexOf(t);-1!==r&&(t=3*r)}return(0,n.S5)(e,null!=t?t:18)}function l(e,t){if("string"!=typeof e&&o.throwArgumentError("value must be a string","value",e),"string"==typeof t){let r=s.indexOf(t);-1!==r&&(t=3*r)}return(0,n.Ox)(e,null!=t?t:18)}function c(e){return u(e,18)}function h(e){return l(e,18)}},79911:function(e,t,r){"use strict";r.r(t),r.d(t,{Wallet:function(){return w},verifyMessage:function(){return A},verifyTypedData:function(){return E}});var n=r(19485),i=r(81556),o=r(48088),s=r(16441),a=r(93684),u=r(67827),l=r(84178),c=r(38197),h=r(6881),f=r(5634),d=r(67669),p=r(81964),m=r(45659),g=r(83875),y=r(1581),v=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let b=new y.Logger("wallet/5.7.0");class w extends o.Signer{constructor(e,t){var r;if(super(),null!=(r=e)&&(0,s.isHexString)(r.privateKey,32)&&null!=r.address){let o=new d.SigningKey(e.privateKey);if((0,h.defineReadOnly)(this,"_signingKey",()=>o),(0,h.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(e.address)&&b.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){let t=e.mnemonic;return t&&t.phrase}(e)){let a=e.mnemonic;(0,h.defineReadOnly)(this,"_mnemonic",()=>({phrase:a.phrase,path:a.path||l.defaultPath,locale:a.locale||"en"}));let u=this.mnemonic,c=l.HDNode.fromMnemonic(u.phrase,null,u.locale).derivePath(u.path);(0,g.computeAddress)(c.privateKey)!==this.address&&b.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,h.defineReadOnly)(this,"_mnemonic",()=>null)}else{if(d.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&b.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,h.defineReadOnly)(this,"_signingKey",()=>e);else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);let f=new d.SigningKey(e);(0,h.defineReadOnly)(this,"_signingKey",()=>f)}(0,h.defineReadOnly)(this,"_mnemonic",()=>null),(0,h.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey))}t&&!i.zt.isProvider(t)&&b.throwArgumentError("invalid provider","provider",t),(0,h.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new w(this,e)}signTransaction(e){return(0,h.resolveProperties)(e).then(t=>{null!=t.from&&((0,n.getAddress)(t.from)!==this.address&&b.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);let r=this._signingKey().signDigest((0,c.keccak256)((0,g.serialize)(t)));return(0,g.serialize)(t,r)})}signMessage(e){return v(this,void 0,void 0,function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(e)))})}_signTypedData(e,t,r){return v(this,void 0,void 0,function*(){let n=yield u.E.resolveNames(e,t,r,e=>(null==this.provider&&b.throwError("cannot resolve ENS names without a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e)));return(0,s.joinSignature)(this._signingKey().signDigest(u.E.hash(n.domain,t,n.value)))})}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw Error("invalid callback");return t||(t={}),(0,p.HI)(this,e,t,r)}static createRandom(e){let t=(0,f.O)(16);e||(e={}),e.extraEntropy&&(t=(0,s.arrayify)((0,s.hexDataSlice)((0,c.keccak256)((0,s.concat)([t,e.extraEntropy])),0,16)));let r=(0,l.entropyToMnemonic)(t,e.locale);return w.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return(0,m.decryptJsonWallet)(e,t,r).then(e=>new w(e))}static fromEncryptedJsonSync(e,t){return new w((0,m.decryptJsonWalletSync)(e,t))}static fromMnemonic(e,t,r){return t||(t=l.defaultPath),new w(l.HDNode.fromMnemonic(e,null,r).derivePath(t))}}function A(e,t){return(0,g.recoverAddress)((0,a.r)(e),t)}function E(e,t,r,n){return(0,g.recoverAddress)(u.E.hash(e,t,r),n)}},37707:function(e,t,r){"use strict";r.r(t),r.d(t,{_fetchData:function(){return h},fetchJson:function(){return f},poll:function(){return d}});var n=r(59567),i=r(16441),o=r(6881),s=r(29251),a=r(1581);let u=new a.Logger("web/5.7.1");function l(e){return new Promise(t=>{setTimeout(t,e)})}function c(e,t){if(null==e)return null;if("string"==typeof e)return e;if((0,i.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,s.ZN)(e)}catch(r){}return(0,i.hexlify)(e)}return e}function h(e,t,r){let h="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;u.assertArgument(h>0&&h%1==0,"invalid connection throttle limit","connection.throttleLimit",h);let f="object"==typeof e?e.throttleCallback:null,d="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;u.assertArgument(d>0&&d%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",d);let p="object"==typeof e&&!!e.errorPassThrough,m={},g=null,y={method:"GET"},v=!1,b=12e4;if("string"==typeof e)g=e;else if("object"==typeof e){if((null==e||null==e.url)&&u.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"==typeof e.timeout&&e.timeout>0&&(b=e.timeout),e.headers)for(let w in e.headers)m[w.toLowerCase()]={key:w,value:String(e.headers[w])},["if-none-match","if-modified-since"].indexOf(w.toLowerCase())>=0&&(v=!0);if(y.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&u.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});let A=e.user+":"+e.password;m.authorization={key:"Authorization",value:"Basic "+(0,n.c)((0,s.Y0)(A))}}null!=e.skipFetchSetup&&(y.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(y.fetchOptions=(0,o.shallowCopy)(e.fetchOptions))}let E=RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),S=g?g.match(E):null;if(S)try{var k;let C={statusCode:200,statusMessage:"OK",headers:{"content-type":S[1]||"text/plain"},body:S[2]?(0,n.J)(S[3]):(k=S[3],(0,s.Y0)(k.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))))},P=C.body;return r&&(P=r(C.body,C)),Promise.resolve(P)}catch(x){u.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:c(S[1],S[2]),error:x,requestBody:null,requestMethod:"GET",url:g})}t&&(y.method="POST",y.body=t,null==m["content-type"]&&(m["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==m["content-length"]&&(m["content-length"]={key:"Content-Length",value:String(t.length)}));let O={};Object.keys(m).forEach(e=>{let t=m[e];O[t.key]=t.value}),y.headers=O;let _=function(){let e=null,t=new Promise(function(t,r){b&&(e=setTimeout(()=>{null!=e&&(e=null,r(u.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:c(y.body,O["content-type"]),requestMethod:y.method,timeout:b,url:g})))},b))});return{promise:t,cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),R=function(){var e,t,n,o;return e=this,t=void 0,n=void 0,o=function*(){for(let e=0;e{a[t.toLowerCase()]=e}):o.headers.keys().forEach(e=>{a[e.toLowerCase()]=o.headers.get(e)}),{headers:a,statusCode:o.status,statusMessage:o.statusText,body:(0,i.arrayify)(new Uint8Array(s))}},new(o||(o=Promise))(function(e,t){function i(e){try{u(s.next(e))}catch(r){t(r)}}function a(e){try{u(s.throw(e))}catch(r){t(r)}}function u(t){var r;t.done?e(t.value):((r=t.value)instanceof o?r:new o(function(e){e(r)})).then(i,a)}u((s=s.apply(r,n||[])).next())})}(g,y),e=300)&&(_.cancel(),u.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:c(b,t.headers?t.headers["content-type"]:null),requestBody:c(y.body,O["content-type"]),requestMethod:y.method,url:g})),r)try{let w=yield r(b,t);return _.cancel(),w}catch(S){if(S.throttleRetry&&e{let n=null;if(null!=e)try{n=JSON.parse((0,s.ZN)(e))}catch(i){u.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:e,error:i})}return r&&(n=r(n,t)),n},i=null;if(null!=t){i=(0,s.Y0)(t);let l="string"==typeof e?{url:e}:(0,o.shallowCopy)(e);if(l.headers){let c=0!==Object.keys(l.headers).filter(e=>"content-type"===e.toLowerCase()).length;c||(l.headers=(0,o.shallowCopy)(l.headers),l.headers["content-type"]="application/json")}else l.headers={"content-type":"application/json"};e=l}return h(e,i,n)}function d(e,t){return t||(t={}),null==(t=(0,o.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise(function(r,n){let i=null,o=!1,s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout(()=>{s()&&n(Error("timeout"))},t.timeout));let a=t.retryLimit,u=0;!function i(){return e().then(function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(++u>a){s()&&n(Error("retry limit reached"));return}let l=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));lt.ceiling&&(l=t.ceiling),setTimeout(i,l)}return null},function(e){s()&&n(e)})}()})}},78435:function(e,t,r){"use strict";r.r(t),r.d(t,{Wordlist:function(){return n.D},logger:function(){return n.k},wordlists:function(){return i.E}});var n=r(48812),i=r(10234)},48812:function(e,t,r){"use strict";r.d(t,{D:function(){return a},k:function(){return s}});var n=r(32046),i=r(6881),o=r(1581);let s=new o.Logger("wordlists/5.7.0");class a{constructor(e){s.checkAbstract(new.target,a),(0,i.defineReadOnly)(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){let t=[];for(let r=0;r<2048;r++){let i=e.getWord(r);if(r!==e.getWordIndex(i))return"0x";t.push(i)}return(0,n.id)(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}},10234:function(e,t,r){"use strict";r.d(t,{E:function(){return u}});var n=r(48812);let i=null;function o(e){if(null==i&&(i="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==n.D.check(e)))throw i=null,Error("BIP39 Wordlist for en (English) FAILED")}class s extends n.D{constructor(){super("en")}getWord(e){return o(this),i[e]}getWordIndex(e){return o(this),i.indexOf(e)}}let a=new s;n.D.register(a);let u={en:a}},82775:function(e,t,r){"use strict";r.d(t,{i:function(){return u}});var n=r(97231);r(26729);var i=new WeakMap,o=new WeakMap,s=new WeakSet,a=new WeakSet;class u extends n.I{constructor(){let{chains:e,options:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={name:"MetaMask",shimDisconnect:!0,shimChainChangedDisconnect:!0,...t};super({chains:e,options:r}),(0,n._)(this,a),(0,n._)(this,s),(0,n.t)(this,"id","metaMask"),(0,n.t)(this,"ready","undefined"!=typeof window&&!!(0,n.u)(this,a,c).call(this,window.ethereum)),(0,n.v)(this,i,{writable:!0,value:void 0}),(0,n.v)(this,o,{writable:!0,value:void 0}),(0,n.w)(this,o,r.UNSTABLE_shimOnConnectSelectAccount)}async connect(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,r,i,s;let a=await this.getProvider();if(!a)throw new n.d;if(a.on&&(a.on("accountsChanged",this.onAccountsChanged),a.on("chainChanged",this.onChainChanged),a.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"}),(0,n.x)(this,o)&&null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&!(null!==(r=(0,n.g)().storage)&&void 0!==r&&r.getItem(this.shimDisconnectKey))){let u=await a.request({method:"eth_accounts"}).catch(()=>[]),l=!!u[0];l&&await a.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]})}let c=await this.getAccount(),h=await this.getChainId(),f=this.isChainUnsupported(h);if(e&&h!==e){let d=await this.switchChain(e);h=d.id,f=this.isChainUnsupported(h)}return null!==(i=this.options)&&void 0!==i&&i.shimDisconnect&&(null===(s=(0,n.g)().storage)||void 0===s||s.setItem(this.shimDisconnectKey,!0)),{account:c,chain:{id:h,unsupported:f},provider:a}}catch(p){if(this.isUserRejectedRequestError(p))throw new n.U(p);if(-32002===p.code)throw new n.R(p);throw p}}async getProvider(){return"undefined"!=typeof window&&(0,n.w)(this,i,(0,n.u)(this,a,c).call(this,window.ethereum)),(0,n.x)(this,i)}}function l(e){let t=!!(null!=e&&e.isMetaMask);if(t&&(!e.isBraveWallet||e._events||e._state)&&!e.isAvalanche&&!e.isKuCoinWallet&&!e.isPortal&&!e.isTokenPocket&&!e.isTokenary)return e}function c(e){return null!=e&&e.providers?e.providers.find((0,n.u)(this,s,l)):(0,n.u)(this,s,l).call(this,e)}},81226:function(e,t,r){"use strict";r.d(t,{c:function(){return C},d:function(){return P}});let n={mainnet:"https://eth-mainnet.alchemyapi.io/v2",ropsten:"https://eth-ropsten.alchemyapi.io/v2",rinkeby:"https://eth-rinkeby.alchemyapi.io/v2",goerli:"https://eth-goerli.alchemyapi.io/v2",kovan:"https://eth-kovan.alchemyapi.io/v2",optimism:"https://opt-mainnet.g.alchemy.com/v2",optimismKovan:"https://opt-kovan.g.alchemy.com/v2",optimismGoerli:"https://opt-goerli.g.alchemy.com/v2",polygon:"https://polygon-mainnet.g.alchemy.com/v2",polygonMumbai:"https://polygon-mumbai.g.alchemy.com/v2",arbitrum:"https://arb-mainnet.g.alchemy.com/v2",arbitrumRinkeby:"https://arb-rinkeby.g.alchemy.com/v2",arbitrumGoerli:"https://arb-goerli.g.alchemy.com/v2"},i={mainnet:"https://mainnet.infura.io/v3",ropsten:"https://ropsten.infura.io/v3",rinkeby:"https://rinkeby.infura.io/v3",goerli:"https://goerli.infura.io/v3",kovan:"https://kovan.infura.io/v3",sepolia:"https://sepolia.infura.io/v3",optimism:"https://optimism-mainnet.infura.io/v3",optimismKovan:"https://optimism-kovan.infura.io/v3",optimismGoerli:"https://optimism-goerli.infura.io/v3",polygon:"https://polygon-mainnet.infura.io/v3",polygonMumbai:"https://polygon-mumbai.infura.io/v3",arbitrum:"https://arbitrum-mainnet.infura.io/v3",arbitrumRinkeby:"https://arbitrum-rinkeby.infura.io/v3",arbitrumGoerli:"https://arbitrum-goerli.infura.io/v3"},o={mainnet:"https://cloudflare-eth.com",ropsten:"https://rpc.ankr.com/eth_ropsten",rinkeby:"https://rpc.ankr.com/eth_rinkeby",goerli:"https://rpc.ankr.com/eth_goerli",kovan:`${i.kovan}/84842078b09946638c03157f83405213`,sepolia:"https://rpc.sepolia.org",optimism:"https://mainnet.optimism.io",optimismKovan:"https://kovan.optimism.io",optimismGoerli:"https://goerli.optimism.io",polygon:"https://polygon-rpc.com",polygonMumbai:"https://matic-mumbai.chainstacklabs.com",arbitrum:"https://arb1.arbitrum.io/rpc",arbitrumRinkeby:"https://rinkeby.arbitrum.io/rpc",arbitrumGoerli:"https://goerli-rollup.arbitrum.io/rpc"},s={mainnet:{name:"Etherscan",url:"https://etherscan.io"},ropsten:{name:"Etherscan",url:"https://ropsten.etherscan.io"},rinkeby:{name:"Etherscan",url:"https://rinkeby.etherscan.io"},goerli:{name:"Etherscan",url:"https://goerli.etherscan.io"},kovan:{name:"Etherscan",url:"https://kovan.etherscan.io"},sepolia:{name:"Etherscan",url:"https://sepolia.etherscan.io"},optimism:{name:"Etherscan",url:"https://optimistic.etherscan.io"},optimismKovan:{name:"Etherscan",url:"https://kovan-optimistic.etherscan.io"},optimismGoerli:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},polygon:{name:"PolygonScan",url:"https://polygonscan.com"},polygonMumbai:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},arbitrum:{name:"Arbiscan",url:"https://arbiscan.io"},arbitrumRinkeby:{name:"Arbiscan",url:"https://testnet.arbiscan.io"},arbitrumGoerli:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},a={mainnet:1,ropsten:3,rinkeby:4,goerli:5,kovan:42,sepolia:11155111,optimism:10,optimismKovan:69,optimismGoerli:420,polygon:137,polygonMumbai:80001,arbitrum:42161,arbitrumRinkeby:421611,arbitrumGoerli:421613,localhost:1337,hardhat:31337,foundry:31337},u={id:a.mainnet,name:"Ethereum",network:"homestead",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.mainnet,default:o.mainnet,infura:i.mainnet,public:o.mainnet},blockExplorers:{etherscan:s.mainnet,default:s.mainnet},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}},l={id:a.ropsten,name:"Ropsten",network:"ropsten",nativeCurrency:{name:"Ropsten Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.ropsten,default:o.ropsten,infura:i.ropsten,public:o.ropsten},blockExplorers:{etherscan:s.ropsten,default:s.ropsten},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:12063863},testnet:!0},c={id:a.rinkeby,name:"Rinkeby",network:"rinkeby",nativeCurrency:{name:"Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.rinkeby,default:o.rinkeby,infura:i.rinkeby,public:o.rinkeby},blockExplorers:{etherscan:s.rinkeby,default:s.rinkeby},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10299530},testnet:!0},h={id:a.goerli,name:"Goerli",network:"goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.goerli,default:o.goerli,infura:i.goerli,public:o.goerli},blockExplorers:{etherscan:s.goerli,default:s.goerli},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670},testnet:!0},f={id:a.kovan,name:"Kovan",network:"kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.kovan,default:o.kovan,infura:i.kovan,public:o.kovan},blockExplorers:{etherscan:s.kovan,default:s.kovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:30285908},testnet:!0},d={id:a.sepolia,name:"Sepolia",network:"sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:o.sepolia,infura:i.sepolia,public:o.sepolia},blockExplorers:{etherscan:s.sepolia,default:s.sepolia},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},testnet:!0},p={id:a.optimism,name:"Optimism",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimism,default:o.optimism,infura:i.optimism,public:o.optimism},blockExplorers:{etherscan:s.optimism,default:s.optimism},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}},m={id:a.optimismKovan,name:"Optimism Kovan",network:"optimism-kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimismKovan,default:o.optimismKovan,infura:i.optimismKovan,public:o.optimismKovan},blockExplorers:{etherscan:s.optimismKovan,default:s.optimismKovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1418387},testnet:!0},g={id:a.optimismGoerli,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimismGoerli,default:o.optimismGoerli,infura:i.optimismGoerli,public:o.optimismGoerli},blockExplorers:{etherscan:s.optimismGoerli,default:s.optimismGoerli},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},testnet:!0},y={id:a.polygon,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:n.polygon,default:o.polygon,infura:i.polygon,public:o.polygon},blockExplorers:{etherscan:s.polygon,default:s.polygon},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},v={id:a.polygonMumbai,name:"Polygon Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:n.polygonMumbai,default:o.polygonMumbai,infura:i.polygonMumbai,public:o.polygonMumbai},blockExplorers:{etherscan:s.polygonMumbai,default:s.polygonMumbai},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25444704},testnet:!0},b={id:a.arbitrum,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrum,default:o.arbitrum,infura:i.arbitrum,public:o.arbitrum},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://explorer.arbitrum.io"},etherscan:s.arbitrum,default:s.arbitrum},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}},w={id:a.arbitrumRinkeby,name:"Arbitrum Rinkeby",network:"arbitrum-rinkeby",nativeCurrency:{name:"Arbitrum Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrumRinkeby,default:o.arbitrumRinkeby,infura:i.arbitrumRinkeby,public:o.arbitrumRinkeby},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://rinkeby-explorer.arbitrum.io"},etherscan:s.arbitrumRinkeby,default:s.arbitrumRinkeby},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10228837},testnet:!0},A={id:a.arbitrumGoerli,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrumGoerli,default:o.arbitrumGoerli,infura:i.arbitrumGoerli,public:o.arbitrumGoerli},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://goerli-rollup-explorer.arbitrum.io"},etherscan:s.arbitrumGoerli,default:s.arbitrumGoerli},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114},testnet:!0},E={id:a.localhost,name:"Localhost",network:"localhost",rpcUrls:{default:"http://127.0.0.1:8545"}},S={id:a.hardhat,name:"Hardhat",network:"hardhat",rpcUrls:{default:"http://127.0.0.1:8545"}},k={id:a.foundry,name:"Foundry",network:"foundry",rpcUrls:{default:"http://127.0.0.1:8545"}},C={mainnet:u,ropsten:l,rinkeby:c,goerli:h,kovan:f,sepolia:d,optimism:p,optimismGoerli:g,optimismKovan:m,polygon:y,polygonMumbai:v,arbitrum:b,arbitrumGoerli:A,arbitrumRinkeby:w,localhost:E,hardhat:S,foundry:k},P=[u,l,c,h,f]},97231:function(e,t,r){"use strict";let n;r.d(t,{C:function(){return O},I:function(){return j},R:function(){return M},S:function(){return I},U:function(){return L},_:function(){return v},a:function(){return _},b:function(){return R},d:function(){return T},f:function(){return Y},g:function(){return V},k:function(){return J},n:function(){return B},t:function(){return w},u:function(){return S},v:function(){return b},w:function(){return k},x:function(){return E}});let i=e=>(t,r,n)=>{let i=n.subscribe;n.subscribe=(e,t,r)=>{let o=e;if(t){let s=(null==r?void 0:r.equalityFn)||Object.is,a=e(n.getState());o=r=>{let n=e(r);if(!s(a,n)){let i=a;t(a=n,i)}},(null==r?void 0:r.fireImmediately)&&t(a,a)}return i(o)};let o=e(t,r,n);return o},o=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>o(e)(r),catch(e){return this}}}catch(n){return{then(e){return this},catch:e=>o(e)(n)}}},s=(e,t)=>(r,n,i)=>{let s,a,u={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,c=new Set,h=new Set;try{s=u.getStorage()}catch(f){}if(!s)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),r(...e)},n,i);let d=o(u.serialize),p=()=>{let e;let t=u.partialize({...n()}),r=d({state:t,version:u.version}).then(e=>s.setItem(u.name,e)).catch(t=>{e=t});if(e)throw e;return r},m=i.setState;i.setState=(e,t)=>{m(e,t),p()};let g=e((...e)=>{r(...e),p()},n,i),y=()=>{var e;if(!s)return;l=!1,c.forEach(e=>e(n()));let t=(null==(e=u.onRehydrateStorage)?void 0:e.call(u,n()))||void 0;return o(s.getItem.bind(s))(u.name).then(e=>{if(e)return u.deserialize(e)}).then(e=>{if(e){if("number"!=typeof e.version||e.version===u.version)return e.state;if(u.migrate)return u.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return r(a=u.merge(e,null!=(t=n())?t:g),!0),p()}).then(()=>{null==t||t(a,void 0),l=!0,h.forEach(e=>e(a))}).catch(e=>{null==t||t(void 0,e)})};return i.persist={setOptions(e){u={...u,...e},e.getStorage&&(s=e.getStorage())},clearStorage(){null==s||s.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(h.add(e),()=>{h.delete(e)})},y(),a||g},a=(e,t)=>(r,n,i)=>{let s,a={storage:function(e,t){let r;try{r=e()}catch(n){return}return{getItem(e){var n;let i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(n=r.getItem(e))?n:null;return o instanceof Promise?o.then(i):i(o)},setItem:(e,n)=>r.setItem(e,JSON.stringify(n,null==t?void 0:t.replacer)),removeItem:e=>r.removeItem(e)}}(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},u=!1,l=new Set,c=new Set,h=a.storage;if(!h)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...e)},n,i);let f=()=>{let e=a.partialize({...n()});return h.setItem(a.name,{state:e,version:a.version})},d=i.setState;i.setState=(e,t)=>{d(e,t),f()};let p=e((...e)=>{r(...e),f()},n,i),m=()=>{var e,t;if(!h)return;u=!1,l.forEach(e=>{var t;return e(null!=(t=n())?t:p)});let i=(null==(t=a.onRehydrateStorage)?void 0:t.call(a,null!=(e=n())?e:p))||void 0;return o(h.getItem.bind(h))(a.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===a.version)return e.state;if(a.migrate)return a.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return r(s=a.merge(e,null!=(t=n())?t:p),!0),f()}).then(()=>{null==i||i(s,void 0),s=n(),u=!0,c.forEach(e=>e(s))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions(e){a={...a,...e},e.storage&&(h=e.storage)},clearStorage(){null==h||h.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>m(),hasHydrated:()=>u,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},a.skipHydration||m(),s||p},u=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),s(e,t)):a(e,t),l=e=>{let t;let r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let o=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(e=>e(t,o))}},i=()=>t,o=e=>(r.add(e),()=>r.delete(e)),s=()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()},a={setState:n,getState:i,subscribe:o,destroy:s};return t=e(n,i,a),a},c=e=>e?l(e):l;var h=e=>(console.warn("[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'."),c(e)),f=r(8605),d=r(56371),p=r(26729),m=r.n(p),g=r(81226);function y(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function v(e,t){y(e,t),t.add(e)}function b(e,t,r){y(e,t),t.set(e,r)}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function E(e,t){var r=A(e,t,"get");return r.get?r.get.call(e):r.value}function S(e,t,r){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return r}function k(e,t,r){var n=A(e,t,"set");return!function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=r}}(e,n,r),r}class C extends Error{constructor(e,t,r,n){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),w(this,"code",void 0),w(this,"data",void 0),w(this,"internal",void 0),this.code=e,this.data=n,this.internal=r}}class P extends C{constructor(e,t,r,n){if(!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r,n)}}class x extends Error{constructor(){super(...arguments),w(this,"name","AddChainError"),w(this,"message","Error adding chain")}}class O extends Error{constructor(e){let{activeChain:t,targetChain:r}=e;super(`Chain mismatch: Expected "${r}", received "${t}".`),w(this,"name","ChainMismatchError")}}class _ extends Error{constructor(e){let{chainId:t,connectorId:r}=e;super(`Chain "${t}" not configured for connector "${r}".`),w(this,"name","ChainNotConfigured")}}class R extends Error{constructor(){super(...arguments),w(this,"name","ConnectorAlreadyConnectedError"),w(this,"message","Connector already connected")}}class T extends Error{constructor(){super(...arguments),w(this,"name","ConnectorNotFoundError"),w(this,"message","Connector not found")}}class M extends C{constructor(e){super(-32002,"Resource unavailable",e),w(this,"name","ResourceUnavailable")}}class N extends P{constructor(e){super(4902,"Error switching chain",e),w(this,"name","SwitchChainError")}}class I extends Error{constructor(e){let{connector:t}=e;super(`"${t.name}" does not support programmatic chain switching.`),w(this,"name","SwitchChainNotSupportedError")}}class L extends P{constructor(e){super(4001,"User rejected request",e),w(this,"name","UserRejectedRequestError")}}function B(e){return"string"==typeof e?Number.parseInt(e,"0x"===e.trim().substring(0,2)?16:10):"bigint"==typeof e?Number(e):e}class F extends m(){constructor(e){let{chains:t=g.d,options:r}=e;super(),w(this,"id",void 0),w(this,"name",void 0),w(this,"chains",void 0),w(this,"options",void 0),w(this,"ready",void 0),this.chains=t,this.options=r}getBlockExplorerUrls(e){let{default:t,...r}=e.blockExplorers??{};if(t)return[t.url,...Object.values(r).map(e=>e.url)]}isChainUnsupported(e){return!this.chains.some(t=>t.id===e)}}var D=new WeakMap,U=new WeakMap;class j extends F{constructor(){let{chains:e,options:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={shimDisconnect:!0,shimChainChangedDisconnect:!0,...t};super({chains:e,options:r}),w(this,"id",void 0),w(this,"name",void 0),w(this,"ready","undefined"!=typeof window&&!!window.ethereum),b(this,D,{writable:!0,value:void 0}),b(this,U,{writable:!0,value:void 0}),w(this,"shimDisconnectKey","injected.shimDisconnect"),w(this,"onAccountsChanged",e=>{0===e.length?this.emit("disconnect"):this.emit("change",{account:(0,d.getAddress)(e[0])})}),w(this,"onChainChanged",e=>{let t=B(e),r=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:r}})}),w(this,"onDisconnect",()=>{var e,t,r;if(null!==(e=this.options)&&void 0!==e&&e.shimChainChangedDisconnect&&E(this,U)){k(this,U,!1);return}this.emit("disconnect"),null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&(null===(r=V().storage)||void 0===r||r.removeItem(this.shimDisconnectKey))});let n="Injected",i=r.name;if("string"==typeof i)n=i;else if("undefined"!=typeof window){let o=function(e){var t;if(!e)return"Injected";let r=e=>e.isAvalanche?"Core Wallet":e.isBitKeep?"BitKeep":e.isBraveWallet?"Brave Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isExodus?"Exodus":e.isFrame?"Frame":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOpera?"Opera":e.isPortal?"Ripio Portal":e.isTally?"Tally":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isMetaMask?"MetaMask":void 0;if(null!==(t=e.providers)&&void 0!==t&&t.length){let n=new Set,i=1;for(let o of e.providers){let s=r(o);s||(s=`Unknown Wallet #${i}`,i+=1),n.add(s)}let a=[...n];return a.length?a:a[0]??"Injected"}return r(e)??"Injected"}(window.ethereum);n=i?i(o):"string"==typeof o?o:o[0]}this.id="injected",this.name=n}async connect(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,r;let n=await this.getProvider();if(!n)throw new T;n.on&&(n.on("accountsChanged",this.onAccountsChanged),n.on("chainChanged",this.onChainChanged),n.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let i=await this.getAccount(),o=await this.getChainId(),s=this.isChainUnsupported(o);if(e&&o!==e){let a=await this.switchChain(e);o=a.id,s=this.isChainUnsupported(o)}return null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&(null===(r=V().storage)||void 0===r||r.setItem(this.shimDisconnectKey,!0)),{account:i,chain:{id:o,unsupported:s},provider:n}}catch(u){if(this.isUserRejectedRequestError(u))throw new L(u);if(-32002===u.code)throw new M(u);throw u}}async disconnect(){var e,t;let r=await this.getProvider();null!=r&&r.removeListener&&(r.removeListener("accountsChanged",this.onAccountsChanged),r.removeListener("chainChanged",this.onChainChanged),r.removeListener("disconnect",this.onDisconnect),null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&(null===(t=V().storage)||void 0===t||t.removeItem(this.shimDisconnectKey)))}async getAccount(){let e=await this.getProvider();if(!e)throw new T;let t=await e.request({method:"eth_requestAccounts"});return(0,d.getAddress)(t[0])}async getChainId(){let e=await this.getProvider();if(!e)throw new T;return e.request({method:"eth_chainId"}).then(B)}async getProvider(){return"undefined"!=typeof window&&window.ethereum&&k(this,D,window.ethereum),E(this,D)}async getSigner(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=await Promise.all([this.getProvider(),this.getAccount()]);return new f.Web3Provider(t,e).getSigner(r)}async isAuthorized(){try{var e,t;if(null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&!(null!==(t=V().storage)&&void 0!==t&&t.getItem(this.shimDisconnectKey)))return!1;let r=await this.getProvider();if(!r)throw new T;let n=await r.request({method:"eth_accounts"}),i=n[0];return!!i}catch{return!1}}async switchChain(e){var t,r,n;null!==(t=this.options)&&void 0!==t&&t.shimChainChangedDisconnect&&k(this,U,!0);let i=await this.getProvider();if(!i)throw new T;let o=(0,d.hexValue)(e);try{return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]}),this.chains.find(t=>t.id===e)??{id:e,name:`Chain ${o}`,network:`${o}`,rpcUrls:{default:""}}}catch(u){let s=this.chains.find(t=>t.id===e);if(!s)throw new _({chainId:e,connectorId:this.id});if(4902===u.code||(null==u?void 0:null===(r=u.data)||void 0===r?void 0:null===(n=r.originalError)||void 0===n?void 0:n.code)===4902)try{return await i.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[s.rpcUrls.public??s.rpcUrls.default],blockExplorerUrls:this.getBlockExplorerUrls(s)}]}),s}catch(a){if(this.isUserRejectedRequestError(a))throw new L(u);throw new x}if(this.isUserRejectedRequestError(u))throw new L(u);throw new N(u)}}async watchAsset(e){let{address:t,decimals:r=18,image:n,symbol:i}=e,o=await this.getProvider();if(!o)throw new T;return o.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,decimals:r,image:n,symbol:i}}})}isUserRejectedRequestError(e){return 4001===e.code}}let q={getItem:e=>"",setItem:(e,t)=>null,removeItem:e=>null},H="store";var K=new WeakMap,G=new WeakMap,z=new WeakSet;class W{constructor(e){let t,{autoConnect:r=!1,connectors:n=[new j],provider:o,storage:s=function(e){let{storage:t,key:r="wagmi"}=e;return{...t,getItem:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=t.getItem(`${r}.${e}`);try{return i?JSON.parse(i):n}catch(o){return console.warn(o),n}},setItem(e,n){if(null===n)t.removeItem(`${r}.${e}`);else try{t.setItem(`${r}.${e}`,JSON.stringify(n))}catch(i){console.error(i)}},removeItem:e=>t.removeItem(`${r}.${e}`)}}({storage:"undefined"!=typeof window?window.localStorage:q}),logger:a={warn:console.warn},webSocketProvider:l}=e;v(this,z),w(this,"config",void 0),w(this,"providers",new Map),w(this,"storage",void 0),w(this,"store",void 0),w(this,"webSocketProviders",new Map),b(this,K,{writable:!0,value:void 0}),b(this,G,{writable:!0,value:void 0}),this.config={autoConnect:r,connectors:n,logger:a,provider:o,storage:s,webSocketProvider:l};let c="disconnected";if(r)try{var f,d,p;let m=s.getItem(H,""),g=null===(f=JSON.parse(m||"{}"))||void 0===f?void 0:null===(d=f.state)||void 0===d?void 0:d.data;c=null!=g&&g.account?"reconnecting":"connecting",t=null==g?void 0:null===(p=g.chain)||void 0===p?void 0:p.id}catch(y){}this.store=h(i(u(()=>({connectors:"function"==typeof n?n():n,provider:this.getProvider({chainId:t}),status:c,webSocketProvider:this.getWebSocketProvider({chainId:t})}),{name:H,getStorage:()=>s,partialize(e){var t,n;return{...r&&{data:{account:null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.account,chain:null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.chain}},chains:null==e?void 0:e.chains}},version:1}))),this.storage=s,k(this,G,null==s?void 0:s.getItem("wallet")),S(this,z,Q).call(this),r&&"undefined"!=typeof window&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var e,t;return null===(e=this.data)||void 0===e?void 0:null===(t=e.chain)||void 0===t?void 0:t.id}get provider(){return this.store.getState().provider}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketProvider(){return this.store.getState().webSocketProvider}setState(e){let t="function"==typeof e?e(this.store.getState()):e;this.store.setState(t,!0)}clearState(){this.setState(e=>({...e,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var e,t;this.connector&&await (null===(e=(t=this.connector).disconnect)||void 0===e?void 0:e.call(t)),k(this,K,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(E(this,K))return;k(this,K,!0),this.setState(e=>{var t;return{...e,status:null!==(t=e.data)&&void 0!==t&&t.account?"reconnecting":"connecting"}});let e=E(this,G)?[...this.connectors].sort(e=>e.id===E(this,G)?-1:1):this.connectors,t=!1;for(let r of e){if(!r.ready||!r.isAuthorized)continue;let n=await r.isAuthorized();if(!n)continue;let i=await r.connect();this.setState(e=>({...e,connector:r,chains:null==r?void 0:r.chains,data:i,status:"connected"})),t=!0;break}return t||this.setState(e=>({...e,data:void 0,status:"disconnected"})),k(this,K,!1),this.data}getProvider(){let{bust:e,chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.providers.get(t??-1);if(r&&!e)return r;let{provider:n}=this.config;return r="function"==typeof n?n({chainId:t}):n,this.providers.set(t??-1,r),r}getWebSocketProvider(){let{bust:e,chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.webSocketProviders.get(t??-1);if(r&&!e)return r;let{webSocketProvider:n}=this.config;return(r="function"==typeof n?n({chainId:t}):n)&&this.webSocketProviders.set(t??-1,r),r}setLastUsedConnector(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===(e=this.storage)||void 0===e||e.setItem("wallet",t)}}function Q(){let e=e=>{this.setState(t=>({...t,data:{...t.data,...e}}))},t=()=>{this.clearState()},r=e=>{this.setState(t=>({...t,error:e}))};this.store.subscribe(e=>{let{connector:t}=e;return t},(n,i)=>{var o,s,a,u,l,c;null==i||null===(o=i.off)||void 0===o||o.call(i,"change",e),null==i||null===(s=i.off)||void 0===s||s.call(i,"disconnect",t),null==i||null===(a=i.off)||void 0===a||a.call(i,"error",r),n&&(null===(u=n.on)||void 0===u||u.call(n,"change",e),null===(l=n.on)||void 0===l||l.call(n,"disconnect",t),null===(c=n.on)||void 0===c||c.call(n,"error",r))});let{provider:n,webSocketProvider:i}=this.config;("function"==typeof n||"function"==typeof i)&&this.store.subscribe(e=>{var t;let{data:r}=e;return null==r?void 0:null===(t=r.chain)||void 0===t?void 0:t.id},e=>{this.setState(t=>({...t,provider:this.getProvider({bust:!0,chainId:e}),webSocketProvider:this.getWebSocketProvider({bust:!0,chainId:e})}))})}function J(e){let t=new W(e);return n=t,t}function V(){if(!n)throw Error("No wagmi client found. Ensure you have set up a client: https://wagmi.sh/docs/client");return n}function Y(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=V();return e&&t.getProvider({chainId:e})||t.provider}},2984:function(e,t,r){"use strict";r.d(t,{QB:function(){return a},$j:function(){return l},vZ:function(){return function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){let n,i;if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)&&Array.isArray(r)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();let o=Object.keys(t);if((n=o.length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){let s=o[i];if(s&&!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},zP:function(){return c},em:function(){return u},DG:function(){return d},D0:function(){return p},uN:function(){return h},Hy:function(){return m},xq:function(){return g},If:function(){return y},uH:function(){return v},QC:function(){return b},b0:function(){return f},rn:function(){return w}});var n=r(97231),i=r(8605),o=r(64146),s=(e,t)=>(console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`."),function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,n]of e)if(!Object.is(n,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let i of e)if(!t.has(i))return!1;return!0}let o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(let s=0;s2&&void 0!==arguments[2]?arguments[2]:{};if(!e.length)throw Error("must have at least one chain");if(o{let{id:t}=e;return t===c.id})||(a=[...a,d.chain]),u[c.id]=[...u[c.id]||[],d.provider],d.webSocketProvider&&(l[c.id]=[...l[c.id]||[],d.webSocketProvider]))}if(!h)throw Error(`Could not find valid provider configuration for chain "${c.name}". - -You may need to add \`jsonRpcProvider\` to \`configureChains\` with the chain's RPC URLs. -Read more: https://wagmi.sh/docs/providers/jsonRpc`)}return{chains:a,provider(t){let l,{chainId:c}=t,h=a.find(e=>e.id===c)??e[0],f=u[h.id];if(!f||!f[0])throw Error(`No providers configured for chain "${h.id}"`);return l=1===f.length?f[0]():function e(t,r,n,o){let{stallTimeout:s}=o;try{return new i.FallbackProvider(n.map((e,t)=>{let r=e();return{provider:r,priority:r.priority??t,stallTimeout:r.stallTimeout??s,weight:r.weight}}),t)}catch(u){var a;if(null!=u&&null!==(a=u.message)&&void 0!==a&&a.includes("quorum will always fail; larger than total weight")){if(t===r)throw u;return e(t-1,r,n,{stallTimeout:s})}throw u}}(o,r,f,{stallTimeout:s}),42220===h.id&&(l.formatter.formats.block={...l.formatter.formats.block,difficulty:()=>0,gasLimit:()=>0}),Object.assign(l,{chains:a,pollingInterval:n})},webSocketProvider(t){var r;let{chainId:n}=t,i=a.find(e=>e.id===n)??e[0],o=l[i.id];if(!o)return;let s=null===(r=o[0])||void 0===r?void 0:r.call(o);return s&&42220===i.id&&(s.formatter.formats.block={...s.formatter.formats.block,difficulty:()=>0,gasLimit:()=>0}),Object.assign(s||{},{chains:a})}}}r(26729);let u=[{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:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];async function l(e){let{chainId:t,connector:r}=e,i=(0,n.g)(),o=i.connector;if(r.id===(null==o?void 0:o.id))throw new n.b;try{i.setState(e=>({...e,status:"connecting"}));let s=await r.connect({chainId:t});return i.setLastUsedConnector(r.id),i.setState(e=>({...e,connector:r,chains:null==r?void 0:r.chains,data:s,status:"connected"})),i.storage.setItem("connected",!0),{...s,connector:r}}catch(a){throw i.setState(e=>({...e,status:e.connector?"connected":"disconnected"})),a}}async function c(){let e=(0,n.g)();e.connector&&await e.connector.disconnect(),e.clearState(),e.storage.removeItem("connected")}function h(e){let{address:t,abi:r,signerOrProvider:n}=e;return new o.Contract(t,r,n)}function f(e,t){let r=(0,n.g)(),i=async()=>t((0,n.f)(e)),o=r.subscribe(e=>{let{provider:t}=e;return t},i);return o}async function d(){var e,t;let{chainId:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,n.g)(),o=await (null===(e=i.connector)||void 0===e?void 0:null===(t=e.getSigner)||void 0===t?void 0:t.call(e,{chainId:r}))||null;return o}function p(){let{data:e,connector:t,status:r}=(0,n.g)();switch(r){case"connected":return{address:null==e?void 0:e.account,connector:t,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:null==e?void 0:e.account,connector:t,isConnected:!!(null!=e&&e.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:r};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:r}}}function m(){var e,t,r;let i=(0,n.g)(),o=null===(e=i.data)||void 0===e?void 0:null===(t=e.chain)||void 0===t?void 0:t.id,s=i.chains??[],a=[...i.provider.chains||[],...s].find(e=>e.id===o)??{id:o,name:`Chain ${o}`,network:`${o}`,rpcUrls:{default:""}};return{chain:o?{...a,...null===(r=i.data)||void 0===r?void 0:r.chain,id:o}:void 0,chains:s}}async function g(e){let{domain:t,types:r,value:i}=e,o=await d();if(!o)throw new n.d;let{chainId:s}=t,a=s?(0,n.n)(s):void 0;return a&&function(e){var t,r,i,o;let{chainId:s,signer:a}=e,{chain:u,chains:l}=m(),c=null==u?void 0:u.id;if(c&&s!==c)throw new n.C({activeChain:(null===(t=l.find(e=>e.id===c))||void 0===t?void 0:t.name)??`Chain ${c}`,targetChain:(null===(r=l.find(e=>e.id===s))||void 0===r?void 0:r.name)??`Chain ${s}`});if(a){let h=null===(i=a.provider)||void 0===i?void 0:null===(o=i.network)||void 0===o?void 0:o.chainId;if(h&&s!==h){let f=(0,n.g)().connector;throw new n.a({chainId:s,connectorId:(null==f?void 0:f.id)??"unknown"})}}}({chainId:a,signer:o}),o._signTypedData(t,r,i)}async function y(e){let{chainId:t}=e,{connector:r}=(0,n.g)();if(!r)throw new n.d;if(!r.switchChain)throw new n.S({connector:r});return r.switchChain(t)}function v(e){let{selector:t=e=>e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.g)(),i=()=>e(p()),o=r.subscribe(e=>{let{data:r,connector:n,status:i}=e;return t({address:null==r?void 0:r.account,connector:n,status:i})},i,{equalityFn:s});return o}function b(e){let{selector:t=e=>e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.g)(),i=()=>e(m()),o=r.subscribe(e=>{var r;let{data:n,chains:i}=e;return t({chainId:null==n?void 0:null===(r=n.chain)||void 0===r?void 0:r.id,chains:i})},i,{equalityFn:s});return o}function w(e,t){let{chainId:r}=e,i=(0,n.g)(),o=async()=>t(await d({chainId:r})),a=i.subscribe(e=>{var t;let{data:r,connector:n}=e;return{account:null==r?void 0:r.account,chainId:null==r?void 0:null===(t=r.chain)||void 0===t?void 0:t.id,connector:n}},o,{equalityFn:s});return a}},78826:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function s(e,t,r,n,i){(null!=n||null!=i)&&(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var a,u=(a="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+a[15&n])}return t.join("")}}),l={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],S=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],k=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function C(e){for(var t=[],r=0;r>2,this._Ke[o][t%4]=i[t],this._Kd[e-o][t%4]=i[t];for(var o,s,a=0,u=n;u>16&255]<<24^h[s>>8&255]<<16^h[255&s]<<8^h[s>>24&255]^c[a]<<24,a+=1,8!=n)for(var t=1;t>8&255]<<8^h[s>>16&255]<<16^h[s>>24&255]<<24;for(var t=n/2+1;t>2,d=u%4,this._Ke[f][d]=i[t],this._Kd[e-f][d]=i[t++],u++}for(var f=1;f>24&255]^E[s>>16&255]^S[s>>8&255]^k[255&s]},P.prototype.encrypt=function(e){if(16!=e.length)throw Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=C(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s>24&255]^p[n[(i+1)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^g[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}for(var a,u=o(16),i=0;i<4;i++)a=this._Ke[t][i],u[4*i]=(h[n[i]>>24&255]^a>>24)&255,u[4*i+1]=(h[n[(i+1)%4]>>16&255]^a>>16)&255,u[4*i+2]=(h[n[(i+2)%4]>>8&255]^a>>8)&255,u[4*i+3]=(h[255&n[(i+3)%4]]^a)&255;return u},P.prototype.decrypt=function(e){if(16!=e.length)throw Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=C(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s>24&255]^v[n[(i+3)%4]>>16&255]^b[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}for(var a,u=o(16),i=0;i<4;i++)a=this._Kd[t][i],u[4*i]=(f[n[i]>>24&255]^a>>24)&255,u[4*i+1]=(f[n[(i+3)%4]>>16&255]^a>>16)&255,u[4*i+2]=(f[n[(i+2)%4]>>8&255]^a>>8)&255,u[4*i+3]=(f[255&n[(i+1)%4]]^a)&255;return u};var x=function(e){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new P(e)};x.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},T.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},T.prototype.increment=function(){for(var e=15;e>=0;e--)if(255===this._counter[e])this._counter[e]=0;else{this._counter[e]++;break}};var M=function(e,t){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof T||(t=new T(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new P(e)};M.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}}},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=o(e.length+t);s(e,r);for(var n=e.length;n16)throw Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}for(r=0,t=o(t);rt)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var a=(e=n).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var u=e.slice(0,a),l=e.slice(a+1);if(l.length<6)return"Data too short";var c=s(u);if("string"==typeof c)return c;for(var h=[],f=0;f=l.length||h.push(p)}return 1!==c?"Invalid checksum for "+e:{prefix:u,words:h}}function u(e,t,r,n){for(var i=0,o=0,s=(1<=r;)a.push(i>>(o-=r)&s);if(n)o>0&&a.push(i<=t)return"Excess padding";if(i<n)throw TypeError("Exceeds length limit");var i=s(e=e.toLowerCase());if("string"==typeof i)throw Error(i);for(var a=e+"1",u=0;u>5!=0)throw Error("Non 5-bit word");i=o(i)^l,a+=t.charAt(l)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){var c=i>>(5-u)*5&31;a+=t.charAt(c)}return a},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw Error(t)}}},13550:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{d="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(46601).Buffer}catch(s){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function l(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?e:t},o.min=function(e,t){return 0>e.cmp(t)?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;s-=3)o=e[s]|e[s-1]<<8|e[s-2]<<16,this.words[i]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var n,i=0;i=t;i-=2)n=u(e,t,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(h){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d,p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var l=1;l>>26,h=67108863&u,f=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=f;d++){var p=l-d|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[d])+h)/67108864|0,h=67108863&s}r.words[l]=0|h,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?p[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=m[e],c=g[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modrn(c).toString(e);r=(h=h.idivn(c)).isZero()?f+r:p[l-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},d&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(d,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=e.allocUnsafe?e.allocUnsafe(o):new e(o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var t,r,n,i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,n=this.iadd(e);return e.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(t=this,r=e):(t=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&n;for(;0!==o&&s>26,this.words[s]=67108863&n;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,E=0|s[4],S=8191&E,k=E>>>13,C=0|s[5],P=8191&C,x=C>>>13,O=0|s[6],_=8191&O,R=O>>>13,T=0|s[7],M=8191&T,N=T>>>13,I=0|s[8],L=8191&I,B=I>>>13,F=0|s[9],D=8191&F,U=F>>>13,j=0|a[0],q=8191&j,H=j>>>13,K=0|a[1],G=8191&K,z=K>>>13,W=0|a[2],Q=8191&W,J=W>>>13,V=0|a[3],Y=8191&V,$=V>>>13,Z=0|a[4],X=8191&Z,ee=Z>>>13,et=0|a[5],er=8191&et,en=et>>>13,ei=0|a[6],eo=8191&ei,es=ei>>>13,ea=0|a[7],eu=8191&ea,el=ea>>>13,ec=0|a[8],eh=8191&ec,ef=ec>>>13,ed=0|a[9],ep=8191&ed,em=ed>>>13;r.negative=e.negative^t.negative,r.length=19;var eg=(l+(n=Math.imul(h,q))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(f,q)|0))<<13)|0;l=((o=Math.imul(f,H))+(i>>>13)|0)+(eg>>>26)|0,eg&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,H))+Math.imul(m,q)|0,o=Math.imul(m,H);var ey=(l+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(f,G)|0))<<13)|0;l=((o=o+Math.imul(f,z)|0)+(i>>>13)|0)+(ey>>>26)|0,ey&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,H))+Math.imul(v,q)|0,o=Math.imul(v,H),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,z)|0;var ev=(l+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,Q)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ev>>>26)|0,ev&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,H))+Math.imul(A,q)|0,o=Math.imul(A,H),n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,z)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,J)|0;var eb=(l+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(f,Y)|0))<<13)|0;l=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(eb>>>26)|0,eb&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,H))+Math.imul(k,q)|0,o=Math.imul(k,H),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,$)|0;var ew=(l+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(ew>>>26)|0,ew&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,H))+Math.imul(x,q)|0,o=Math.imul(x,H),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,z)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,$)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var eA=(l+(n=n+Math.imul(h,er)|0)|0)+((8191&(i=(i=i+Math.imul(h,en)|0)+Math.imul(f,er)|0))<<13)|0;l=((o=o+Math.imul(f,en)|0)+(i>>>13)|0)+(eA>>>26)|0,eA&=67108863,n=Math.imul(_,q),i=(i=Math.imul(_,H))+Math.imul(R,q)|0,o=Math.imul(R,H),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,z)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,er)|0,i=(i=i+Math.imul(p,en)|0)+Math.imul(m,er)|0,o=o+Math.imul(m,en)|0;var eE=(l+(n=n+Math.imul(h,eo)|0)|0)+((8191&(i=(i=i+Math.imul(h,es)|0)+Math.imul(f,eo)|0))<<13)|0;l=((o=o+Math.imul(f,es)|0)+(i>>>13)|0)+(eE>>>26)|0,eE&=67108863,n=Math.imul(M,q),i=(i=Math.imul(M,H))+Math.imul(N,q)|0,o=Math.imul(N,H),n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,z)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,er)|0,i=(i=i+Math.imul(y,en)|0)+Math.imul(v,er)|0,o=o+Math.imul(v,en)|0,n=n+Math.imul(p,eo)|0,i=(i=i+Math.imul(p,es)|0)+Math.imul(m,eo)|0,o=o+Math.imul(m,es)|0;var eS=(l+(n=n+Math.imul(h,eu)|0)|0)+((8191&(i=(i=i+Math.imul(h,el)|0)+Math.imul(f,eu)|0))<<13)|0;l=((o=o+Math.imul(f,el)|0)+(i>>>13)|0)+(eS>>>26)|0,eS&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,H))+Math.imul(B,q)|0,o=Math.imul(B,H),n=n+Math.imul(M,G)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,z)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,$)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(w,er)|0,i=(i=i+Math.imul(w,en)|0)+Math.imul(A,er)|0,o=o+Math.imul(A,en)|0,n=n+Math.imul(y,eo)|0,i=(i=i+Math.imul(y,es)|0)+Math.imul(v,eo)|0,o=o+Math.imul(v,es)|0,n=n+Math.imul(p,eu)|0,i=(i=i+Math.imul(p,el)|0)+Math.imul(m,eu)|0,o=o+Math.imul(m,el)|0;var ek=(l+(n=n+Math.imul(h,eh)|0)|0)+((8191&(i=(i=i+Math.imul(h,ef)|0)+Math.imul(f,eh)|0))<<13)|0;l=((o=o+Math.imul(f,ef)|0)+(i>>>13)|0)+(ek>>>26)|0,ek&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,H))+Math.imul(U,q)|0,o=Math.imul(U,H),n=n+Math.imul(L,G)|0,i=(i=i+Math.imul(L,z)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,z)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(S,er)|0,i=(i=i+Math.imul(S,en)|0)+Math.imul(k,er)|0,o=o+Math.imul(k,en)|0,n=n+Math.imul(w,eo)|0,i=(i=i+Math.imul(w,es)|0)+Math.imul(A,eo)|0,o=o+Math.imul(A,es)|0,n=n+Math.imul(y,eu)|0,i=(i=i+Math.imul(y,el)|0)+Math.imul(v,eu)|0,o=o+Math.imul(v,el)|0,n=n+Math.imul(p,eh)|0,i=(i=i+Math.imul(p,ef)|0)+Math.imul(m,eh)|0,o=o+Math.imul(m,ef)|0;var eC=(l+(n=n+Math.imul(h,ep)|0)|0)+((8191&(i=(i=i+Math.imul(h,em)|0)+Math.imul(f,ep)|0))<<13)|0;l=((o=o+Math.imul(f,em)|0)+(i>>>13)|0)+(eC>>>26)|0,eC&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,z))+Math.imul(U,G)|0,o=Math.imul(U,z),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(P,er)|0,i=(i=i+Math.imul(P,en)|0)+Math.imul(x,er)|0,o=o+Math.imul(x,en)|0,n=n+Math.imul(S,eo)|0,i=(i=i+Math.imul(S,es)|0)+Math.imul(k,eo)|0,o=o+Math.imul(k,es)|0,n=n+Math.imul(w,eu)|0,i=(i=i+Math.imul(w,el)|0)+Math.imul(A,eu)|0,o=o+Math.imul(A,el)|0,n=n+Math.imul(y,eh)|0,i=(i=i+Math.imul(y,ef)|0)+Math.imul(v,eh)|0,o=o+Math.imul(v,ef)|0;var eP=(l+(n=n+Math.imul(p,ep)|0)|0)+((8191&(i=(i=i+Math.imul(p,em)|0)+Math.imul(m,ep)|0))<<13)|0;l=((o=o+Math.imul(m,em)|0)+(i>>>13)|0)+(eP>>>26)|0,eP&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,J))+Math.imul(U,Q)|0,o=Math.imul(U,J),n=n+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(B,Y)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(_,er)|0,i=(i=i+Math.imul(_,en)|0)+Math.imul(R,er)|0,o=o+Math.imul(R,en)|0,n=n+Math.imul(P,eo)|0,i=(i=i+Math.imul(P,es)|0)+Math.imul(x,eo)|0,o=o+Math.imul(x,es)|0,n=n+Math.imul(S,eu)|0,i=(i=i+Math.imul(S,el)|0)+Math.imul(k,eu)|0,o=o+Math.imul(k,el)|0,n=n+Math.imul(w,eh)|0,i=(i=i+Math.imul(w,ef)|0)+Math.imul(A,eh)|0,o=o+Math.imul(A,ef)|0;var ex=(l+(n=n+Math.imul(y,ep)|0)|0)+((8191&(i=(i=i+Math.imul(y,em)|0)+Math.imul(v,ep)|0))<<13)|0;l=((o=o+Math.imul(v,em)|0)+(i>>>13)|0)+(ex>>>26)|0,ex&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,$))+Math.imul(U,Y)|0,o=Math.imul(U,$),n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(M,er)|0,i=(i=i+Math.imul(M,en)|0)+Math.imul(N,er)|0,o=o+Math.imul(N,en)|0,n=n+Math.imul(_,eo)|0,i=(i=i+Math.imul(_,es)|0)+Math.imul(R,eo)|0,o=o+Math.imul(R,es)|0,n=n+Math.imul(P,eu)|0,i=(i=i+Math.imul(P,el)|0)+Math.imul(x,eu)|0,o=o+Math.imul(x,el)|0,n=n+Math.imul(S,eh)|0,i=(i=i+Math.imul(S,ef)|0)+Math.imul(k,eh)|0,o=o+Math.imul(k,ef)|0;var eO=(l+(n=n+Math.imul(w,ep)|0)|0)+((8191&(i=(i=i+Math.imul(w,em)|0)+Math.imul(A,ep)|0))<<13)|0;l=((o=o+Math.imul(A,em)|0)+(i>>>13)|0)+(eO>>>26)|0,eO&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,ee))+Math.imul(U,X)|0,o=Math.imul(U,ee),n=n+Math.imul(L,er)|0,i=(i=i+Math.imul(L,en)|0)+Math.imul(B,er)|0,o=o+Math.imul(B,en)|0,n=n+Math.imul(M,eo)|0,i=(i=i+Math.imul(M,es)|0)+Math.imul(N,eo)|0,o=o+Math.imul(N,es)|0,n=n+Math.imul(_,eu)|0,i=(i=i+Math.imul(_,el)|0)+Math.imul(R,eu)|0,o=o+Math.imul(R,el)|0,n=n+Math.imul(P,eh)|0,i=(i=i+Math.imul(P,ef)|0)+Math.imul(x,eh)|0,o=o+Math.imul(x,ef)|0;var e_=(l+(n=n+Math.imul(S,ep)|0)|0)+((8191&(i=(i=i+Math.imul(S,em)|0)+Math.imul(k,ep)|0))<<13)|0;l=((o=o+Math.imul(k,em)|0)+(i>>>13)|0)+(e_>>>26)|0,e_&=67108863,n=Math.imul(D,er),i=(i=Math.imul(D,en))+Math.imul(U,er)|0,o=Math.imul(U,en),n=n+Math.imul(L,eo)|0,i=(i=i+Math.imul(L,es)|0)+Math.imul(B,eo)|0,o=o+Math.imul(B,es)|0,n=n+Math.imul(M,eu)|0,i=(i=i+Math.imul(M,el)|0)+Math.imul(N,eu)|0,o=o+Math.imul(N,el)|0,n=n+Math.imul(_,eh)|0,i=(i=i+Math.imul(_,ef)|0)+Math.imul(R,eh)|0,o=o+Math.imul(R,ef)|0;var eR=(l+(n=n+Math.imul(P,ep)|0)|0)+((8191&(i=(i=i+Math.imul(P,em)|0)+Math.imul(x,ep)|0))<<13)|0;l=((o=o+Math.imul(x,em)|0)+(i>>>13)|0)+(eR>>>26)|0,eR&=67108863,n=Math.imul(D,eo),i=(i=Math.imul(D,es))+Math.imul(U,eo)|0,o=Math.imul(U,es),n=n+Math.imul(L,eu)|0,i=(i=i+Math.imul(L,el)|0)+Math.imul(B,eu)|0,o=o+Math.imul(B,el)|0,n=n+Math.imul(M,eh)|0,i=(i=i+Math.imul(M,ef)|0)+Math.imul(N,eh)|0,o=o+Math.imul(N,ef)|0;var eT=(l+(n=n+Math.imul(_,ep)|0)|0)+((8191&(i=(i=i+Math.imul(_,em)|0)+Math.imul(R,ep)|0))<<13)|0;l=((o=o+Math.imul(R,em)|0)+(i>>>13)|0)+(eT>>>26)|0,eT&=67108863,n=Math.imul(D,eu),i=(i=Math.imul(D,el))+Math.imul(U,eu)|0,o=Math.imul(U,el),n=n+Math.imul(L,eh)|0,i=(i=i+Math.imul(L,ef)|0)+Math.imul(B,eh)|0,o=o+Math.imul(B,ef)|0;var eM=(l+(n=n+Math.imul(M,ep)|0)|0)+((8191&(i=(i=i+Math.imul(M,em)|0)+Math.imul(N,ep)|0))<<13)|0;l=((o=o+Math.imul(N,em)|0)+(i>>>13)|0)+(eM>>>26)|0,eM&=67108863,n=Math.imul(D,eh),i=(i=Math.imul(D,ef))+Math.imul(U,eh)|0,o=Math.imul(U,ef);var eN=(l+(n=n+Math.imul(L,ep)|0)|0)+((8191&(i=(i=i+Math.imul(L,em)|0)+Math.imul(B,ep)|0))<<13)|0;l=((o=o+Math.imul(B,em)|0)+(i>>>13)|0)+(eN>>>26)|0,eN&=67108863;var eI=(l+(n=Math.imul(D,ep))|0)+((8191&(i=(i=Math.imul(D,em))+Math.imul(U,ep)|0))<<13)|0;return l=((o=Math.imul(U,em))+(i>>>13)|0)+(eI>>>26)|0,eI&=67108863,u[0]=eg,u[1]=ey,u[2]=ev,u[3]=eb,u[4]=ew,u[5]=eA,u[6]=eE,u[7]=eS,u[8]=ek,u[9]=eC,u[10]=eP,u[11]=ex,u[12]=eO,u[13]=e_,u[14]=eR,u[15]=eT,u[16]=eM,u[17]=eN,u[18]=eI,0!==l&&(u[19]=l,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function w(e,t){this.x=e,this.y=t}Math.imul||(v=y),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return 10===this.length&&10===e.length?v(this,e,t):n<63?y(this,e,t):b(this,e,t)},w.prototype.makeRBT=function(e){for(var t=Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},w.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,r+=(o/67108864|0)+(s>>>26),this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var i,o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var t=e%26,r=(e-t)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r,n=this.length-e.length,i=this.clone(),s=e,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var u=i.length-s.length;if("mod"!==t){(r=new o(null)).length=u+1,r.words=Array(r.length);for(var l=0;l=0;h--){var f=(0|i.words[s.length+h])*67108864+(0|i.words[s.length+h-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(s,f,h);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,h),i.isZero()||(i.negative^=1);r&&(r.words[h]=f)}return r&&r._strip(),i._strip(),"div"!==t&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(e,t,r){var i,s,a;return(n(!e.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&e.negative)!=0?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||0>this.cmp(e)?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t)},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=67108864%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var f=0,d=1;(t.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t,r=this,i=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,c=1;(r.words[0]&c)==0&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;(i.words[0]&f)==0&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(t=0===r.cmpn(1)?s:a).cmpn(0)&&t.iadd(e),t},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return -1===this.cmpn(e)},o.prototype.lt=function(e){return -1===this.cmp(e)},o.prototype.lten=function(e){return 0>=this.cmpn(e)},o.prototype.lte=function(e){return 0>=this.cmp(e)},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new x(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function C(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new o(null);return e.words=Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},i(S,E),S.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){var t;if(A[e])return A[e];if("k256"===e)t=new S;else if("p224"===e)t=new k;else if("p192"===e)t=new C;else if("p25519"===e)t=new P;else throw Error("Unknown prime "+e);return A[e]=t,t},x.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){n((e.negative|t.negative)==0,"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var h=l>>c&1;if(i!==r[0]&&(i=this.sqr(i)),0===h&&0===s){a=0;continue}s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)}u=26}return i},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,x),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},94184:function(e,t){var r; /*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ !function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(o=8,n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;othis.blockSize&&(e=new this.Hash().update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},26436:function(e,t,r){"use strict";var n=r(79746),i=r(35717);function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function a(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;if(2===e.length)return"000000"+e;if(1===e.length)return"0000000"+e;else return e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e){if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):(o=e,s=i,(64512&o.charCodeAt(s))!=55296||s<0||s+1>=o.length?1:(64512&o.charCodeAt(s+1))!=56320)?(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128):(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128)}}else for(i=0;i>>0;return a},t.split32=function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0;e[t]=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u,l=t;return e+r+i+s+(0+((l=l+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,l){var c,h=t;return e+r+i+s+u+(0+((h=h+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,l){return t+n+o+a+l>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},8679:function(e,t,r){"use strict";var n=r(59864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(e){return n.isMemo(e)?s:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=s;var l=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var i=d(r);i&&i!==p&&e(t,i,n)}var s=c(r);h&&(s=s.concat(h(r)));for(var a=u(t),m=u(r),g=0;g>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function B(e,t,r){L.call(this,e,t,r)}L.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(o);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw Error(o)}else throw Error(o);t=!0}for(var n,i,s=this.blocks,a=this.byteCount,u=e.length,l=this.blockCount,c=0,f=this.s;c>2]|=e[c]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=s[l],n=0;n>=8,r=255&e;r>0;)i.unshift(r),e>>=8,r=255&e,++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},L.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(o);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw Error(o)}else throw Error(o);t=!0}var n=0,i=e.length;if(t)n=i;else for(var s=0;s=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},L.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(t=1,e[0]=e[r];t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t==0&&(F(r),o=0)}return i&&(a+=f[(e=r[o])>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},L.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=new ArrayBuffer(i?n+1<<2:a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&F(n)}return o&&(e=a<<2,t=n[s],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},B.prototype=new L,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),L.prototype.finalize.call(this)};var F=function(e){var t,r,n,i,o,s,a,u,l,c,h,f,d,p,g,y,v,b,w,A,E,S,k,C,P,x,O,_,R,T,M,N,I,L,B,F,D,U,j,q,H,K,G,z,W,Q,J,V,Y,$,Z,X,ee,et,er,en,ei,eo,es,ea,eu,el,ec;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49],t=f^(s<<1|a>>>31),r=d^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|l>>>31),r=o^(l<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(c<<1|h>>>31),r=a^(h<<1|c>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(f<<1|d>>>31),r=l^(d<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=c^(i<<1|o>>>31),r=h^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],g=e[1],Q=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,_=e[20]<<3|e[21]>>>29,R=e[21]<<3|e[20]>>>29,ea=e[31]<<9|e[30]>>>23,eu=e[30]<<9|e[31]>>>23,K=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,B=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,T=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,el=e[42]<<2|e[43]>>>30,ec=e[43]<<2|e[42]>>>30,et=e[5]<<30|e[4]>>>2,er=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,$=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,I=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,P=e[7]<<28|e[6]>>>4,en=e[17]<<23|e[16]>>>9,ei=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,x=e[18]<<20|e[19]>>>12,O=e[19]<<20|e[18]>>>12,eo=e[29]<<7|e[28]>>>25,es=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=p^~y&b,e[1]=g^~v&w,e[10]=C^~x&_,e[11]=P^~O&R,e[20]=L^~F&U,e[21]=B^~D&j,e[30]=z^~Q&V,e[31]=W^~J&Y,e[40]=et^~en&eo,e[41]=er^~ei&es,e[2]=y^~b&A,e[3]=v^~w&E,e[12]=x^~_&T,e[13]=O^~R&M,e[22]=F^~U&q,e[23]=D^~j&H,e[32]=Q^~V&$,e[33]=J^~Y&Z,e[42]=en^~eo&ea,e[43]=ei^~es&eu,e[4]=b^~A&S,e[5]=w^~E&k,e[14]=_^~T&N,e[15]=R^~M&I,e[24]=U^~q&K,e[25]=j^~H&G,e[34]=V^~$&X,e[35]=Y^~Z&ee,e[44]=eo^~ea&el,e[45]=es^~eu&ec,e[6]=A^~S&p,e[7]=E^~k&g,e[16]=T^~N&C,e[17]=M^~I&P,e[26]=q^~K&L,e[27]=H^~G&B,e[36]=$^~X&z,e[37]=Z^~ee&W,e[46]=ea^~el&et,e[47]=eu^~ec&er,e[8]=S^~p&y,e[9]=k^~g&v,e[18]=N^~C&x,e[19]=I^~P&O,e[28]=K^~L&F,e[29]=G^~B&D,e[38]=X^~z&Q,e[39]=ee^~W&J,e[48]=el^~et&en,e[49]=ec^~er&ei,e[0]^=m[n],e[1]^=m[n+1]};if(l)e.exports=x;else{for(_=0;_{let e=new Map;for(let t of u)e.set(t.id,t);return e})(),c="a".repeat(64),h=416001,f=1279692951,d="MWUNSC7QGZS6Y7KROX544EJD7ME6H6XLM5VX3TSIY6JZQW24FMPXWOM7T4",p="https://mainnet-api.algonode.cloud",m="https://algoexplorer.io/",g=[{location:"Seattle, US",name:"Thunder Gateway",value:"https://gw-seattle.crustcloud.io"}],y="https://gw.crustfiles.app",v="https://ipfs.io",b="https://ipfsgw.live"},52196:function(e,t,r){"use strict";r.d(t,{Cg:function(){return i},Kc:function(){return o},TQ:function(){return n}});let n=!1,i=!1,o=!1},51851:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return ek}});var n,i,o,s,a=r(35944),u=r(29282),l=r.n(u),c=r(40924),h=r.n(c),f=r(82463),d=r.n(f),p=r(21056),m=r.n(p);r(16853);var g=r(78082),y=r(9008),v=r.n(y),b=r(2984),w=r(38109),A=r(82775),E=r(8605),S=r(45697),k=r.n(S),C=r(83524),P=r.n(C),x=r(69590),O=r.n(x),_=r(67294),R=r(96086),T=r.n(R),M={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},N={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys(N).map(function(e){return N[e]});var I={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},L={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},B={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},F=Object.keys(L).reduce(function(e,t){return e[L[t]]=t,e},{}),D=[N.NOSCRIPT,N.SCRIPT,N.STYLE],U="data-react-helmet",j="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},q=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},H=function(){function e(e,t){for(var r=0;r=0)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},W=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e},Q=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return!1===t?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},J=function(e){var t=$(e,N.TITLE),r=$(e,B.TITLE_TEMPLATE);if(r&&t)return r.replace(/%s/g,function(){return Array.isArray(t)?t.join(""):t});var n=$(e,B.DEFAULT_TITLE);return t||n||void 0},V=function(e,t){return t.filter(function(t){return void 0!==t[e]}).map(function(t){return t[e]}).reduce(function(e,t){return K({},e,t)},{})},Y=function(e,t,r){var n={};return r.filter(function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&er("Helmet: "+e+' should be of type "Array". Instead found type "'+j(t[e])+'"'),!1)}).map(function(t){return t[e]}).reverse().reduce(function(e,r){var i={};r.filter(function(e){for(var r=void 0,o=Object.keys(e),s=0;s=0;r--){var n=e[r];if(n.hasOwnProperty(t))return n[t]}return null},Z=(n=Date.now(),function(e){var t=Date.now();t-n>16?(n=t,e(t)):setTimeout(function(){Z(e)},0)}),X=function(e){return clearTimeout(e)},ee="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Z:r.g.requestAnimationFrame||Z,et="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||X:r.g.cancelAnimationFrame||X,er=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},en=null,ei=function(e,t){var r=e.baseTag,n=e.bodyAttributes,i=e.htmlAttributes,o=e.linkTags,s=e.metaTags,a=e.noscriptTags,u=e.onChangeClientState,l=e.scriptTags,c=e.styleTags,h=e.title,f=e.titleAttributes;ea(N.BODY,n),ea(N.HTML,i),es(h,f);var d={baseTag:eu(N.BASE,r),linkTags:eu(N.LINK,o),metaTags:eu(N.META,s),noscriptTags:eu(N.NOSCRIPT,a),scriptTags:eu(N.SCRIPT,l),styleTags:eu(N.STYLE,c)},p={},m={};Object.keys(d).forEach(function(e){var t=d[e],r=t.newTags,n=t.oldTags;r.length&&(p[e]=r),n.length&&(m[e]=d[e].oldTags)}),t&&t(),u(e,p,m)},eo=function(e){return Array.isArray(e)?e.join(""):e},es=function(e,t){void 0!==e&&document.title!==e&&(document.title=eo(e)),ea(N.TITLE,t)},ea=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var n=r.getAttribute(U),i=n?n.split(","):[],o=[].concat(i),s=Object.keys(t),a=0;a=0;h--)r.removeAttribute(o[h]);i.length===o.length?r.removeAttribute(U):r.getAttribute(U)!==s.join(",")&&r.setAttribute(U,s.join(","))}},eu=function(e,t){var r=document.head||document.querySelector(N.HEAD),n=r.querySelectorAll(e+"["+U+"]"),i=Array.prototype.slice.call(n),o=[],s=void 0;return t&&t.length&&t.forEach(function(t){var r=document.createElement(e);for(var n in t)if(t.hasOwnProperty(n)){if(n===I.INNER_HTML)r.innerHTML=t.innerHTML;else if(n===I.CSS_TEXT)r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText));else{var a=void 0===t[n]?"":t[n];r.setAttribute(n,a)}}r.setAttribute(U,"true"),i.some(function(e,t){return s=t,r.isEqualNode(e)})?i.splice(s,1):o.push(r)}),i.forEach(function(e){return e.parentNode.removeChild(e)}),o.forEach(function(e){return r.appendChild(e)}),{oldTags:i,newTags:o}},el=function(e){return Object.keys(e).reduce(function(t,r){var n=void 0!==e[r]?r+'="'+e[r]+'"':""+r;return t?t+" "+n:n},"")},ec=function(e,t,r,n){var i=el(r),o=eo(t);return i?"<"+e+" "+U+'="true" '+i+">"+Q(o,n)+"":"<"+e+" "+U+'="true">'+Q(o,n)+""},eh=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce(function(t,r){return t[L[r]||r]=e[r],t},t)},ef=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce(function(t,r){return t[F[r]||r]=e[r],t},t)},ed=function(e,t,r){var n,i=eh(r,((n={key:t})[U]=!0,n));return[_.createElement(N.TITLE,i,t)]},ep=function(e,t,r){switch(e){case N.TITLE:return{toComponent:function(){return ed(e,t.title,t.titleAttributes,r)},toString:function(){return ec(e,t.title,t.titleAttributes,r)}};case M.BODY:case M.HTML:return{toComponent:function(){return eh(t)},toString:function(){return el(t)}};default:return{toComponent:function(){return t.map(function(t,r){var n,i=((n={key:r})[U]=!0,n);return Object.keys(t).forEach(function(e){var r=L[e]||e;if(r===I.INNER_HTML||r===I.CSS_TEXT){var n=t.innerHTML||t.cssText;i.dangerouslySetInnerHTML={__html:n}}else i[r]=t[e]}),_.createElement(e,i)})},toString:function(){return t.reduce(function(t,n){var i=Object.keys(n).filter(function(e){return!(e===I.INNER_HTML||e===I.CSS_TEXT)}).reduce(function(e,t){var i=void 0===n[t]?t:t+'="'+Q(n[t],r)+'"';return e?e+" "+i:i},""),o=n.innerHTML||n.cssText||"",s=-1===D.indexOf(e);return t+"<"+e+" "+U+'="true" '+i+(s?"/>":">"+o+"")},"")}}}},em=function(e){var t=e.baseTag,r=e.bodyAttributes,n=e.encode,i=e.htmlAttributes,o=e.linkTags,s=e.metaTags,a=e.noscriptTags,u=e.scriptTags,l=e.styleTags,c=e.title,h=e.titleAttributes;return{base:ep(N.BASE,t,n),bodyAttributes:ep(M.BODY,r,n),htmlAttributes:ep(M.HTML,i,n),link:ep(N.LINK,o,n),meta:ep(N.META,s,n),noscript:ep(N.NOSCRIPT,a,n),script:ep(N.SCRIPT,u,n),style:ep(N.STYLE,l,n),title:ep(N.TITLE,{title:void 0===c?"":c,titleAttributes:h},n)}},eg=(i=P()(function(e){var t;return{baseTag:(t=[I.HREF,I.TARGET],e.filter(function(e){return void 0!==e[N.BASE]}).map(function(e){return e[N.BASE]}).reverse().reduce(function(e,r){if(!e.length)for(var n=Object.keys(r),i=0;i elements are self-closing and can not contain children. Refer to our API for more information.")},t.prototype.flattenArrayTypeChildren=function(e){var t,r=e.child,n=e.arrayTypeChildren,i=e.newChildProps,o=e.nestedChildren;return K({},n,((t={})[r.type]=[].concat(n[r.type]||[],[K({},i,this.mapNestedChildrenToProps(r,o))]),t))},t.prototype.mapObjectTypeChildren=function(e){var t,r,n=e.child,i=e.newProps,o=e.newChildProps,s=e.nestedChildren;switch(n.type){case N.TITLE:return K({},i,((t={})[n.type]=s,t.titleAttributes=K({},o),t));case N.BODY:return K({},i,{bodyAttributes:K({},o)});case N.HTML:return K({},i,{htmlAttributes:K({},o)})}return K({},i,((r={})[n.type]=K({},o),r))},t.prototype.mapArrayTypeChildrenToProps=function(e,t){var r=K({},t);return Object.keys(e).forEach(function(t){var n;r=K({},r,((n={})[t]=e[t],n))}),r},t.prototype.warnOnInvalidChildren=function(e,t){return!0},t.prototype.mapChildrenToProps=function(e,t){var r=this,n={};return _.Children.forEach(e,function(e){if(e&&e.props){var i=e.props,o=i.children,s=ef(z(i,["children"]));switch(r.warnOnInvalidChildren(e,o),e.type){case N.LINK:case N.META:case N.NOSCRIPT:case N.SCRIPT:case N.STYLE:n=r.flattenArrayTypeChildren({child:e,arrayTypeChildren:n,newChildProps:s,nestedChildren:o});break;default:t=r.mapObjectTypeChildren({child:e,newProps:t,newChildProps:s,nestedChildren:o})}}}),t=this.mapArrayTypeChildrenToProps(n,t)},t.prototype.render=function(){var e=this.props,t=e.children,r=K({},z(e,["children"]));return t&&(r=this.mapChildrenToProps(t,r)),_.createElement(i,r)},H(t,null,[{key:"canUseDOM",set:function(e){i.canUseDOM=e}}]),t}(_.Component),o.propTypes={base:k().object,bodyAttributes:k().object,children:k().oneOfType([k().arrayOf(k().node),k().node]),defaultTitle:k().string,defer:k().bool,encodeSpecialCharacters:k().bool,htmlAttributes:k().object,link:k().arrayOf(k().object),meta:k().arrayOf(k().object),noscript:k().arrayOf(k().object),onChangeClientState:k().func,script:k().arrayOf(k().object),style:k().arrayOf(k().object),title:k().string,titleAttributes:k().object,titleTemplate:k().string},o.defaultProps={defer:!0,encodeSpecialCharacters:!0},o.peek=i.peek,o.rewind=function(){var e=i.rewind();return e||(e=em({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},s);eg.renderStatic=eg.rewind,r(58669);var ey=r(94184),ev=r.n(ey);let eb=[l(),h(),d(),m()].map(e=>e.variable).join(" "),ew=new A.i,{provider:eA,webSocketProvider:eE}=(0,b.QB)(g.XL,[function(){let{priority:e,stallTimeout:t,weight:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){return n.rpcUrls.default?{chain:n,provider(){let i=new E.StaticJsonRpcProvider(n.rpcUrls.default,{chainId:n.id,name:n.network});return Object.assign(i,{priority:e,stallTimeout:t,weight:r})}}:null}}()]),eS=(0,w.eI)({autoConnect:!0,provider:eA,webSocketProvider:eE,connectors:[ew]});function ek(e){let{Component:t,pageProps:r}=e;return(0,a.BX)("div",{suppressHydrationWarning:!0,className:ev()("App font-WorkSans",eb),children:[(0,a.BX)(v(),{children:[(0,a.tZ)("meta",{name:"viewport",content:"width=device-width,user-scalable=no"}),(0,a.tZ)(eg,{children:(0,a.tZ)("script",{src:"../lib/twitter.js",type:"text/javascript"})}),(0,a.tZ)("title",{children:"Crust Cloud"})]}),(0,a.tZ)(w.eM,{client:eS,children:(0,a.tZ)(t,{...r})})]})}},58669:function(){},82463:function(e){e.exports={style:{fontFamily:"'__Roboto_9e7bcd', '__Roboto_Fallback_9e7bcd'",fontWeight:400,fontStyle:"normal"},className:"__className_9e7bcd",variable:"__variable_9e7bcd"}},21056:function(e){e.exports={style:{fontFamily:"'__Roboto_Mono_f18e28', '__Roboto_Mono_Fallback_f18e28'",fontWeight:700,fontStyle:"normal"},className:"__className_f18e28",variable:"__variable_f18e28"}},29282:function(e){e.exports={style:{fontFamily:"'__Squada_One_4f93f4', '__Squada_One_Fallback_4f93f4'",fontWeight:400,fontStyle:"normal"},className:"__className_4f93f4",variable:"__variable_4f93f4"}},40924:function(e){e.exports={style:{fontFamily:"'__Work_Sans_57f497', '__Work_Sans_Fallback_57f497'",fontStyle:"normal"},className:"__className_57f497",variable:"__variable_57f497"}},16853:function(){},9008:function(e,t,r){e.exports=r(83121)},34155:function(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(n){r=s}}();var u=[],l=!1,c=-1;function h(){l&&n&&(l=!1,n.length?u=n.concat(u):c=-1,u.length&&f())}function f(){if(!l){var e=a(h);l=!0;for(var t=u.length;t;){for(n=u,u=[];++c1)for(var r=1;r=64;){let d=r,p=n,m=i,g=o,y=s,v=a,b=u,w=l,A,E,S,k,C;for(E=0;E<16;E++)S=h+4*E,c[E]=(255&e[S])<<24|(255&e[S+1])<<16|(255&e[S+2])<<8|255&e[S+3];for(E=16;E<64;E++)k=((A=c[E-2])>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,C=((A=c[E-15])>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,c[E]=(k+c[E-7]|0)+(C+c[E-16]|0)|0;for(E=0;E<64;E++)k=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&v^~y&b)|0)+(w+(t[E]+c[E]|0)|0)|0,C=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&p^d&m^p&m)|0,w=b,b=v,v=y,y=g+k|0,g=m,m=p,p=d,d=k+C|0;r=r+d|0,n=n+p|0,i=i+m|0,o=o+g|0,s=s+y|0,a=a+v|0,u=u+b|0,l=l+w|0,h+=64,f-=64}}h(e);let f,d=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=d<56?56:120,y=e.slice(e.length-d,e.length);for(y.push(128),f=d+1;f>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),h(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255]}function n(e,t,n){let i;e=e.length<=64?e:r(e);let o=64+t.length+4,s=Array(o),a=Array(64),u=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i=o-4;e--){if(s[e]++,s[e]<=255)return;s[e]=0}}for(;n>=32;)l(),u=u.concat(r(a.concat(r(s)))),n-=32;return n>0&&(l(),u=u.concat(r(a.concat(r(s))).slice(0,n))),u}function i(e,t,r,n,i){let u;for(a(e,(2*r-1)*16,i,0,16),u=0;u<2*r;u++)s(e,16*u,i,16),function(e,t){a(e,0,t,0,16);for(let r=8;r>0;r-=2)t[4]^=o(t[0]+t[12],7),t[8]^=o(t[4]+t[0],9),t[12]^=o(t[8]+t[4],13),t[0]^=o(t[12]+t[8],18),t[9]^=o(t[5]+t[1],7),t[13]^=o(t[9]+t[5],9),t[1]^=o(t[13]+t[9],13),t[5]^=o(t[1]+t[13],18),t[14]^=o(t[10]+t[6],7),t[2]^=o(t[14]+t[10],9),t[6]^=o(t[2]+t[14],13),t[10]^=o(t[6]+t[2],18),t[3]^=o(t[15]+t[11],7),t[7]^=o(t[3]+t[15],9),t[11]^=o(t[7]+t[3],13),t[15]^=o(t[11]+t[7],18),t[1]^=o(t[0]+t[3],7),t[2]^=o(t[1]+t[0],9),t[3]^=o(t[2]+t[1],13),t[0]^=o(t[3]+t[2],18),t[6]^=o(t[5]+t[4],7),t[7]^=o(t[6]+t[5],9),t[4]^=o(t[7]+t[6],13),t[5]^=o(t[4]+t[7],18),t[11]^=o(t[10]+t[9],7),t[8]^=o(t[11]+t[10],9),t[9]^=o(t[8]+t[11],13),t[10]^=o(t[9]+t[8],18),t[12]^=o(t[15]+t[14],7),t[13]^=o(t[12]+t[15],9),t[14]^=o(t[13]+t[12],13),t[15]^=o(t[14]+t[13],18);for(let n=0;n<16;++n)e[n]+=t[n]}(i,n),a(i,0,e,t+16*u,16);for(u=0;u>>32-t}function s(e,t,r,n){for(let i=0;i=256)return!1}return!0}function l(e,t){if("number"!=typeof e||e%1)throw Error("invalid "+t);return e}function c(e,t,r,o,c,h,f){let d;if(r=l(r,"N"),o=l(o,"r"),c=l(c,"p"),h=l(h,"dkLen"),0===r||(r&r-1)!=0)throw Error("N must be power of 2");if(r>2147483647/128/o)throw Error("N too large");if(o>2147483647/128/c)throw Error("r too large");if(!u(e))throw Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!u(t))throw Error("salt must be an array or buffer");let p=n(e,t=Array.prototype.slice.call(t),128*c*o),m=new Uint32Array(32*c*o);for(let g=0;gR&&(t=R);for(let u=0;uR&&(t=R);for(let g=0;g>0&255),p.push(m[L]>>8&255),p.push(m[L]>>16&255),p.push(m[L]>>24&255);let B=n(e,p,h);return f&&f(null,1,B),B}f&&T(M)};if(!f)for(;;){let N=M();if(void 0!=N)return N}M()}e.exports={scrypt:function(e,t,r,n,i,o,s){return new Promise(function(a,u){let l=0;s&&s(0),c(e,t,r,n,i,o,function(e,t,r){if(e)u(e);else if(r)s&&1!==l&&s(1),a(new Uint8Array(r));else if(s&&t!==l)return l=t,s(t)})})},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(c(e,t,r,n,i,o))}}}(0)},53250:function(e,t,r){"use strict";/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ var n=r(67294),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,s=n.useEffect,a=n.useLayoutEffect,u=n.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(n){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=o({inst:{value:r,getSnapshot:t}}),i=n[0].inst,c=n[1];return a(function(){i.value=r,i.getSnapshot=t,l(i)&&c({inst:i})},[e,r,t]),s(function(){return l(i)&&c({inst:i}),e(function(){l(i)&&c({inst:i})})},[e]),u(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},50139:function(e,t,r){"use strict";/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ var n=r(67294),i=r(61688),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,a=n.useRef,u=n.useEffect,l=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var h=a(null);if(null===h.current){var f={hasValue:!1,value:null};h.current=f}else f=h.current;h=l(function(){function e(e){if(!u){if(u=!0,s=e,e=n(e),void 0!==i&&f.hasValue){var t=f.value;if(i(t,e))return a=t}return a=e}if(t=a,o(s,e))return t;var r=n(e);return void 0!==i&&i(t,r)?t:(s=e,a=r)}var s,a,u=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,i]);var d=s(e,h[0],h[1]);return u(function(){f.hasValue=!0,f.value=d},[d]),c(d),d}},61688:function(e,t,r){"use strict";e.exports=r(53250)},52798:function(e,t,r){"use strict";e.exports=r(50139)},38109:function(e,t,r){"use strict";let n;function i(){}r.d(t,{eM:function(){return ex},eI:function(){return ek},mA:function(){return eL},$4:function(){return eD},cq:function(){return e$},qL:function(){return eq},LN:function(){return eH},yL:function(){return eM},yw:function(){return eQ},mx:function(){return ez},g0:function(){return eY}});let o="undefined"==typeof window||"Deno"in window;function s(){}function a(e){return"number"==typeof e&&e>=0&&e!==1/0}function u(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t,r){return A(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function c(e,t,r){return A(e)?"function"==typeof t?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:"function"==typeof e?{...t,mutationFn:e}:{...e}}function h(e,t,r){return A(e)?[{...t,queryKey:e},r]:[e||{},t]}function f(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(A(s)){if(n){if(t.queryHash!==p(s,t.options))return!1}else{if(!g(t.queryKey,s))return!1}}if("all"!==r){let u=t.isActive();if("active"===r&&!u||"inactive"===r&&u)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(void 0===i||i===t.state.fetchStatus)&&(!o||!!o(t))}function d(e,t){let{exact:r,fetching:n,predicate:i,mutationKey:o}=e;if(A(o)){if(!t.options.mutationKey)return!1;if(r){if(m(t.options.mutationKey)!==m(o))return!1}else{if(!g(t.options.mutationKey,o))return!1}}return("boolean"!=typeof n||"loading"===t.state.status===n)&&(!i||!!i(t))}function p(e,t){let r=(null==t?void 0:t.queryKeyHashFn)||m;return r(e)}function m(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(r=>!g(e[r],t[r]))}function y(e,t){if(e&&!t||t&&!e)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!w(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(w(r)&&r.hasOwnProperty("isPrototypeOf"))}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function A(e){return Array.isArray(e)}function E(e){return new Promise(t=>{setTimeout(t,e)})}function S(e){E(0).then(e)}function k(e,t,r){return null!=r.isDataEqual&&r.isDataEqual(e,t)?e:"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=v(t)&&v(r);if(n||b(t)&&b(r)){let i=n?t.length:Object.keys(t).length,o=n?r:Object.keys(r),s=o.length,a=n?[]:{},u=0;for(let l=0;l{e()},n=e=>{e()},i=e=>{let r;t++;try{r=e()}finally{--t||a()}return r},o=n=>{t?e.push(n):S(()=>{r(n)})},s=e=>(...t)=>{o(()=>{e(...t)})},a=()=>{let t=e;e=[],t.length&&S(()=>{n(()=>{t.forEach(e=>{r(e)})})})},u=e=>{r=e},l=e=>{n=e};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:u,setBatchNotifyFunction:l}}();class x{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){let t={listener:e};return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}let O=new class extends x{constructor(){super(),this.setup=e=>{if(!o&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){let t=this.focused!==e;t&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},_=["online","offline"],R=new class extends x{constructor(){super(),this.setup=e=>{if(!o&&window.addEventListener){let t=()=>e();return _.forEach(e=>{window.addEventListener(e,t,!1)}),()=>{_.forEach(e=>{window.removeEventListener(e,t)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()})}setOnline(e){let t=this.online!==e;t&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}};function T(e){return Math.min(1e3*2**e,3e4)}function M(e){return(null!=e?e:"online")!=="online"||R.isOnline()}class N{constructor(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}}function I(e){return e instanceof N}function L(e){let t,r,n,i=!1,o=0,s=!1,a=new Promise((e,t)=>{r=e,n=t}),u=t=>{s||(d(new N(t)),null==e.abort||e.abort())},l=()=>{i=!0},c=()=>{i=!1},h=()=>!O.isFocused()||"always"!==e.networkMode&&!R.isOnline(),f=n=>{s||(s=!0,null==e.onSuccess||e.onSuccess(n),null==t||t(),r(n))},d=r=>{s||(s=!0,null==e.onError||e.onError(r),null==t||t(),n(r))},p=()=>new Promise(r=>{t=e=>{let t=s||!h();return t&&r(e),t},null==e.onPause||e.onPause()}).then(()=>{t=void 0,s||null==e.onContinue||e.onContinue()}),m=()=>{let t;if(!s){try{t=e.fn()}catch(r){t=Promise.reject(r)}Promise.resolve(t).then(f).catch(t=>{var r,n;if(s)return;let a=null!=(r=e.retry)?r:3,u=null!=(n=e.retryDelay)?n:T,l="function"==typeof u?u(o,t):u,c=!0===a||"number"==typeof a&&o{if(h())return p()}).then(()=>{i?d(t):m()})})}};return M(e.networkMode)?m():p().then(m),{promise:a,cancel:u,continue(){let e=null==t?void 0:t();return e?a:Promise.resolve()},cancelRetry:l,continueRetry:c}}class B{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:o?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class F extends B{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||C,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){let r=k(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),r}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;let r=this.promise;return null==(t=this.retryer)||t.cancel(e),r?r.then(s).catch(s):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>!1!==e.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!u(this.state.dataUpdatedAt,e)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var r,n,i,o;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){let s=this.observers.find(e=>e.options.queryFn);s&&this.setOptions(s.options)}let a=function(){if("function"==typeof AbortController)return new AbortController}(),u={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(u);let c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(u)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),h={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};l(h),null==(r=this.options.behavior)||r.onFetch(h),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=h.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(o=h.fetchOptions)?void 0:o.meta});let f=e=>{if(I(e)&&e.silent||this.dispatch({type:"error",error:e}),!I(e)){var t,r,n,i;null==(t=(r=this.cache.config).onError)||t.call(r,e,this),null==(n=(i=this.cache.config).onSettled)||n.call(i,this.state.data,e,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=L({fn:h.fetchFn,abort:null==a?void 0:a.abort.bind(a),onSuccess:e=>{var t,r,n,i;if(void 0===e){f(Error(this.queryHash+" data is undefined"));return}this.setData(e),null==(t=(r=this.cache.config).onSuccess)||t.call(r,e,this),null==(n=(i=this.cache.config).onSettled)||n.call(i,e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:f,onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var r,n;switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(r=e.meta)?r:null,fetchStatus:M(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(n=e.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=e.error;if(I(i)&&i.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}class D extends x{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,r){var n;let i=t.queryKey,o=null!=(n=t.queryHash)?n:p(i,t),s=this.get(o);return s||(s=new F({cache:this,logger:e.getLogger(),queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){let t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter(t=>t!==e),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){P.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){let[r]=h(e,t);return void 0===r.exact&&(r.exact=!0),this.queries.find(e=>f(r,e))}findAll(e,t){let[r]=h(e,t);return Object.keys(r).length>0?this.queries.filter(e=>f(r,e)):this.queries}notify(e){P.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}onFocus(){P.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){P.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class U extends B{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||C,this.observers=[],this.state=e.state||j(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){var e,t,r,n,i,o,s,a,u,l,c,h,f,d,p,m,g,y,v,b;let w="loading"===this.state.status;try{if(!w){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(u=(l=this.mutationCache.config).onMutate)?void 0:u.call(l,this.state.variables,this));let A=await (null==(c=(h=this.options).onMutate)?void 0:c.call(h,this.state.variables));A!==this.state.context&&this.dispatch({type:"loading",context:A,variables:this.state.variables})}let E=await (()=>{var e;return this.retryer=L({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return await (null==(e=(t=this.mutationCache.config).onSuccess)?void 0:e.call(t,E,this.state.variables,this.state.context,this)),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,E,this.state.variables,this.state.context)),await (null==(i=(o=this.mutationCache.config).onSettled)?void 0:i.call(o,E,null,this.state.variables,this.state.context,this)),await (null==(s=(a=this.options).onSettled)?void 0:s.call(a,E,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:E}),E}catch(S){try{throw await (null==(f=(d=this.mutationCache.config).onError)?void 0:f.call(d,S,this.state.variables,this.state.context,this)),await (null==(p=(m=this.options).onError)?void 0:p.call(m,S,this.state.variables,this.state.context)),await (null==(g=(y=this.mutationCache.config).onSettled)?void 0:g.call(y,void 0,S,this.state.variables,this.state.context,this)),await (null==(v=(b=this.options).onSettled)?void 0:v.call(b,void 0,S,this.state.variables,this.state.context)),S}finally{this.dispatch({type:"error",error:S})}}}dispatch(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!M(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(t=>{t.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function j(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class q extends x{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,r){let n=new U({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(n),n}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(t=>t!==e),this.notify({type:"removed",mutation:e})}clear(){P.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find(t=>d(e,t))}findAll(e){return this.mutations.filter(t=>d(e,t))}notify(e){P.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}resumePausedMutations(){var e;return this.resuming=(null!=(e=this.resuming)?e:Promise.resolve()).then(()=>{let e=this.mutations.filter(e=>e.state.isPaused);return P.batch(()=>e.reduce((e,t)=>e.then(()=>t.continue().catch(s)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function H(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}class K{constructor(e={}){this.queryCache=e.queryCache||new D,this.mutationCache=e.mutationCache||new q,this.logger=e.logger||C,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=O.subscribe(()=>{O.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=R.subscribe(()=>{R.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,t;this.mountCount--,0===this.mountCount&&(null==(e=this.unsubscribeFocus)||e.call(this),this.unsubscribeFocus=void 0,null==(t=this.unsubscribeOnline)||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){let[r]=h(e,t);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state.data}ensureQueryData(e,t,r){let n=l(e,t,r),i=this.getQueryData(n.queryKey);return i?Promise.resolve(i):this.fetchQuery(n)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:e,state:t})=>{let r=t.data;return[e,r]})}setQueryData(e,t,r){let n=this.queryCache.find(e),i=null==n?void 0:n.state.data,o="function"==typeof t?t(i):t;if(void 0===o)return;let s=l(e),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return P.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state}removeQueries(e,t){let[r]=h(e,t),n=this.queryCache;P.batch(()=>{n.findAll(r).forEach(e=>{n.remove(e)})})}resetQueries(e,t,r){let[n,i]=h(e,t,r),o=this.queryCache,s={type:"active",...n};return P.batch(()=>(o.findAll(n).forEach(e=>{e.reset()}),this.refetchQueries(s,i)))}cancelQueries(e,t,r){let[n,i={}]=h(e,t,r);void 0===i.revert&&(i.revert=!0);let o=P.batch(()=>this.queryCache.findAll(n).map(e=>e.cancel(i)));return Promise.all(o).then(s).catch(s)}invalidateQueries(e,t,r){let[n,i]=h(e,t,r);return P.batch(()=>{var e,t;if(this.queryCache.findAll(n).forEach(e=>{e.invalidate()}),"none"===n.refetchType)return Promise.resolve();let r={...n,type:null!=(e=null!=(t=n.refetchType)?t:n.type)?e:"active"};return this.refetchQueries(r,i)})}refetchQueries(e,t,r){let[n,i]=h(e,t,r),o=P.batch(()=>this.queryCache.findAll(n).filter(e=>!e.isDisabled()).map(e=>{var t;return e.fetch(void 0,{...i,cancelRefetch:null==(t=null==i?void 0:i.cancelRefetch)||t,meta:{refetchPage:n.refetchPage}})})),a=Promise.all(o).then(s);return null!=i&&i.throwOnError||(a=a.catch(s)),a}fetchQuery(e,t,r){let n=l(e,t,r),i=this.defaultQueryOptions(n);void 0===i.retry&&(i.retry=!1);let o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}prefetchQuery(e,t,r){return this.fetchQuery(e,t,r).then(s).catch(s)}fetchInfiniteQuery(e,t,r){let n=l(e,t,r);return n.behavior={onFetch(e){e.fetchFn=()=>{var t,r,n,i,o,s,a;let u;let l=null==(t=e.fetchOptions)?void 0:null==(r=t.meta)?void 0:r.refetchPage,c=null==(n=e.fetchOptions)?void 0:null==(i=n.meta)?void 0:i.fetchMore,h=null==c?void 0:c.pageParam,f=(null==c?void 0:c.direction)==="forward",d=(null==c?void 0:c.direction)==="backward",p=(null==(o=e.state.data)?void 0:o.pages)||[],m=(null==(s=e.state.data)?void 0:s.pageParams)||[],g=m,y=!1,v=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get(){var t,r;return null!=(t=e.signal)&&t.aborted?y=!0:null==(r=e.signal)||r.addEventListener("abort",()=>{y=!0}),e.signal}})},b=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),w=(e,t,r,n)=>(g=n?[t,...g]:[...g,t],n?[r,...e]:[...e,r]),A=(t,r,n,i)=>{if(y)return Promise.reject("Cancelled");if(void 0===n&&!r&&t.length)return Promise.resolve(t);let o={queryKey:e.queryKey,pageParam:n,meta:e.options.meta};v(o);let s=b(o),a=Promise.resolve(s).then(e=>w(t,n,e,i));return a};if(p.length){if(f){let E=void 0!==h,S=E?h:H(e.options,p);u=A(p,E,S)}else if(d){let k=void 0!==h,C=k?h:null==(a=e.options).getPreviousPageParam?void 0:a.getPreviousPageParam(p[0],p);u=A(p,k,C,!0)}else{g=[];let P=void 0===e.options.getNextPageParam,x=!l||!p[0]||l(p[0],0,p);u=x?A([],P,m[0]):Promise.resolve(w([],m[0],p[0]));for(let O=1;O{let r=!l||!p[O]||l(p[O],O,p);if(r){let n=P?m[O]:H(e.options,t);return A(t,P,n)}return Promise.resolve(w(t,m[O],p[O]))})}}else u=A([]);let _=u.then(e=>({pages:e,pageParams:g}));return _}}},this.fetchQuery(n)}prefetchInfiniteQuery(e,t,r){return this.fetchInfiniteQuery(e,t,r).then(s).catch(s)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){let r=this.queryDefaults.find(t=>m(e)===m(t.queryKey));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;let t=this.queryDefaults.find(t=>g(e,t.queryKey));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){let r=this.mutationDefaults.find(t=>m(e)===m(t.mutationKey));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;let t=this.mutationDefaults.find(t=>g(e,t.mutationKey));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;let t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=p(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}var G=r(67294);let z=G.createContext(void 0),W=G.createContext(!1);function Q(e,t){return e||(t&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=z),window.ReactQueryClientContext):z)}let J=({context:e}={})=>{let t=G.useContext(Q(e,G.useContext(W)));if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},V=({client:e,children:t,context:r,contextSharing:n=!1})=>{G.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);let i=Q(r,n);return G.createElement(W.Provider,{value:!r&&n},G.createElement(i.Provider,{value:e},t))},Y=G.createContext(!1),$=()=>G.useContext(Y);Y.Provider;let Z=G.createContext((n=!1,{clearReset(){n=!1},reset(){n=!0},isReset:()=>n})),X=()=>G.useContext(Z);class ee extends x{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let r=this.options;this.options=this.client.defaultMutationOptions(e),y(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:j(),t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){P.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var t,r,n,i,o,s,a,u;e.onSuccess?(null==(t=(r=this.mutateOptions).onSuccess)||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(i=this.mutateOptions).onSettled)||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(o=(s=this.mutateOptions).onError)||o.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(u=this.mutateOptions).onSettled)||a.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}}var et=r(61688);let er=et.useSyncExternalStore;function en(){}class ei extends x{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),eo(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return es(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return es(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){let r=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),y(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();let i=this.hasListeners();i&&ea(this.currentQuery,n,this.options,r)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();let o=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){let t=this.client.getQueryCache().build(this.client,e),r=this.createResult(t,e);return e.keepPreviousData||(void 0!==e.placeholderData?!r.isPlaceholderData:y(this.getCurrentResult(),r))||(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(e){let t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){let t=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(s)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),o||this.currentResult.isStale||!a(this.options.staleTime))return;let e=u(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},e+1)}computeRefetchInterval(){var e;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!o&&!1!==this.options.enabled&&a(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||O.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){let r;let n=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,a=this.currentResultOptions,u=e!==n,l=u?e.state:this.currentQueryInitialState,c=u?this.currentResult:this.previousQueryResult,{state:h}=e,{dataUpdatedAt:f,error:d,errorUpdatedAt:p,fetchStatus:m,status:g}=h,y=!1,v=!1;if(t._optimisticResults){let b=this.hasListeners(),w=!b&&eo(e,t),A=b&&ea(e,n,t,i);(w||A)&&(m=M(e.options.networkMode)?"fetching":"paused",f||(g="loading")),"isRestoring"===t._optimisticResults&&(m="idle")}if(t.keepPreviousData&&!h.dataUpdatedAt&&null!=c&&c.isSuccess&&"error"!==g)r=c.data,f=c.dataUpdatedAt,g=c.status,y=!0;else if(t.select&&void 0!==h.data){if(o&&h.data===(null==s?void 0:s.data)&&t.select===this.selectFn)r=this.selectResult;else try{this.selectFn=t.select,r=t.select(h.data),r=k(null==o?void 0:o.data,r,t),this.selectResult=r,this.selectError=null}catch(E){this.selectError=E}}else r=h.data;if(void 0!==t.placeholderData&&void 0===r&&"loading"===g){let S;if(null!=o&&o.isPlaceholderData&&t.placeholderData===(null==a?void 0:a.placeholderData))S=o.data;else if(S="function"==typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&void 0!==S)try{S=t.select(S),this.selectError=null}catch(C){this.selectError=C}void 0!==S&&(g="success",r=k(null==o?void 0:o.data,S,t),v=!0)}this.selectError&&(d=this.selectError,r=this.selectResult,p=Date.now(),g="error");let P="fetching"===m,x="loading"===g,O="error"===g,_={status:g,fetchStatus:m,isLoading:x,isSuccess:"success"===g,isError:O,isInitialLoading:x&&P,data:r,dataUpdatedAt:f,error:d,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>l.dataUpdateCount||h.errorUpdateCount>l.errorUpdateCount,isFetching:P,isRefetching:P&&!x,isLoadingError:O&&0===h.dataUpdatedAt,isPaused:"paused"===m,isPlaceholderData:v,isPreviousData:y,isRefetchError:O&&0!==h.dataUpdatedAt,isStale:eu(e,t),refetch:this.refetch,remove:this.remove};return _}updateResult(e){let t=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,y(r,t))return;this.currentResult=r;let n={cache:!0};(null==e?void 0:e.listeners)!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.trackedProps.size)return!0;let n=new Set(null!=r?r:this.trackedProps);return this.options.useErrorBoundary&&n.add("error"),Object.keys(this.currentResult).some(e=>{let r=this.currentResult[e]!==t[e];return r&&n.has(e)})})()&&(n.listeners=!0),this.notify({...n,...e})}updateQuery(){let e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;let t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){let t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||I(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){P.batch(()=>{var t,r,n,i,o,s,a,u;e.onSuccess?(null==(t=(r=this.options).onSuccess)||t.call(r,this.currentResult.data),null==(n=(i=this.options).onSettled)||n.call(i,this.currentResult.data,null)):e.onError&&(null==(o=(s=this.options).onError)||o.call(s,this.currentResult.error),null==(a=(u=this.options).onSettled)||a.call(u,void 0,this.currentResult.error)),e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function eo(e,t){return!1!==t.enabled&&!e.state.dataUpdatedAt&&!("error"===e.state.status&&!1===t.retryOnMount)||e.state.dataUpdatedAt>0&&es(e,t,t.refetchOnMount)}function es(e,t,r){if(!1!==t.enabled){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&eu(e,t)}return!1}function ea(e,t,r,n){return!1!==r.enabled&&(e!==t||!1===n.enabled)&&(!r.suspense||"error"!==e.state.status)&&eu(e,r)}function eu(e,t){return e.isStaleByTime(t.staleTime)}function el(e){return e.state.isPaused}function ec(e){return"success"===e.state.status}let eh=["added","removed","updated"];function ef(e){return eh.includes(e)}async function ed({queryClient:e,persister:t,maxAge:r=864e5,buster:n="",hydrateOptions:i}){try{let o=await t.restoreClient();if(o){if(o.timestamp){let s=Date.now()-o.timestamp>r,a=o.buster!==n;s||a?t.removeClient():function(e,t,r){if("object"!=typeof t||null===t)return;let n=e.getMutationCache(),i=e.getQueryCache(),o=t.mutations||[],s=t.queries||[];o.forEach(t=>{var i;n.build(e,{...null==r?void 0:null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:t.mutationKey},t.state)}),s.forEach(({queryKey:t,state:n,queryHash:o})=>{var s;let a=i.get(o);if(a){if(a.state.dataUpdatedAt{i(e)&&r.push({mutationKey:e.options.mutationKey,state:e.state})})}if(!1!==t.dehydrateQueries){let o=t.shouldDehydrateQuery||ec;e.getQueryCache().getAll().forEach(e=>{o(e)&&n.push({state:e.state,queryKey:e.queryKey,queryHash:e.queryHash})})}return{mutations:r,queries:n}}(e,n)};await t.persistClient(i)}var em=r(97231),eg=r(2984),ey=r(5151),ev=r(52798);let eb=(e,t)=>{let{find:r,replace:n}=t;return e&&r(e)?n(e):"object"!=typeof e?e:Array.isArray(e)?e.map(e=>eb(e,{find:r,replace:n})):e instanceof Object?Object.entries(e).reduce((e,t)=>{let[i,o]=t;return{...e,[i]:eb(o,{find:r,replace:n})}},{}):e};function ew(e){let t=JSON.parse(e),r=eb(t,{find:e=>"BigNumber"===e.type,replace:e=>ey.BigNumber.from(e.hex)});return r}function eA(e,t){return e.slice(0,t).join(".")||"."}function eE(e,t){let{length:r}=e;for(let n=0;n{try{e.setItem(t,n(r));return}catch(i){return i}};return{persistClient:function(e,t=100){let r=null;return function(...n){null===r&&(r=setTimeout(()=>{e(...n),r=null},t))}}(e=>{let t=e,r=a(t),n=0;for(;r&&t;)n++,(t=null==s?void 0:s({persistedClient:t,error:r,errorCount:n}))&&(r=a(t))},r),restoreClient(){let r=e.getItem(t);if(r)return o(r)},removeClient(){e.removeItem(t)}}}return{persistClient:i,restoreClient:()=>void 0,removeClient:i}}({key:"wagmi.cache",storage:window.localStorage,serialize:eS,deserialize:ew}):void 0,...n}=e,o=(0,em.k)(n);return r&&function(e){let t;ed(e).then(()=>{(function(e){let t=e.queryClient.getQueryCache().subscribe(t=>{ef(t.type)&&ep(e)}),r=e.queryClient.getMutationCache().subscribe(t=>{ef(t.type)&&ep(e)});()=>{t(),r()}})(e)})}({queryClient:t,persister:r,dehydrateOptions:{shouldDehydrateQuery:e=>0!==e.cacheTime&&!1!==e.queryKey[0].persist}}),Object.assign(o,{queryClient:t})}let eC=G.createContext(void 0),eP=G.createContext(void 0);function ex(e){let{children:t,client:r}=e;return G.createElement(eC.Provider,{value:r},G.createElement(V,{client:r.queryClient,context:eP},t))}function eO(){let e=G.useContext(eC);if(!e)throw Error("`useClient` must be used within `WagmiConfig`.\n\nRead more: https://wagmi.sh/docs/WagmiConfig");return e}let e_=et.useSyncExternalStore;function eR(e,t,r){let n=c(e,t,r);return function(e,t,r){var n,i;let o=c(e,void 0,void 0),s=J({context:o.context}),[a]=G.useState(()=>new ee(s,o));G.useEffect(()=>{a.setOptions(o)},[a,o]);let u=er(G.useCallback(e=>a.subscribe(P.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),l=G.useCallback((e,t)=>{a.mutate(e,t).catch(en)},[a]);if(u.error&&(n=a.options.useErrorBoundary,i=[u.error],"function"==typeof n?n(...i):!!n))throw u.error;return{...u,mutate:l,mutateAsync:u.mutate}}({context:eP,...n})}let eT=()=>J({context:eP});function eM(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ev.useSyncExternalStoreWithSelector)(t=>(0,eg.b0)({chainId:e},t),()=>(0,em.f)({chainId:e}),()=>(0,em.f)({chainId:e}),e=>e,(e,t)=>e.network.chainId===t.network.chainId)}let eN=e=>"object"==typeof e&&!Array.isArray(e);function eI(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:eg.vZ,i=G.useRef([]),o=(0,ev.useSyncExternalStoreWithSelector)(e,t,r,e=>e,(e,t)=>{if(eN(e)&&eN(t)){for(let r of i.current){let o=n(e[r],t[r]);if(!o)return!1}return!0}return n(e,t)});if(eN(o)){let s={...o};return Object.defineProperties(s,Object.entries(s).reduce((e,t)=>{let[r,n]=t;return{...e,[r]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(r)||i.current.push(r),n)}}},{})),s}return o}function eL(){var e,t,r;let{onConnect:n,onDisconnect:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=eI(eg.uH,eg.D0),s=G.useRef();return n&&(null===(e=s.current)||void 0===e?void 0:e.status)!=="connected"&&"connected"===o.status&&n({address:o.address,connector:o.connector,isReconnected:(null===(t=s.current)||void 0===t?void 0:t.status)==="reconnecting"}),i&&(null===(r=s.current)||void 0===r?void 0:r.status)=="connected"&&"disconnected"===o.status&&i(),s.current=o,o}let eB=e=>[{entity:"connect",...e}],eF=e=>{let{connector:t,chainId:r}=e;if(!t)throw Error("connector is required");return(0,eg.$j)({connector:t,chainId:r})};function eD(){let{chainId:e,connector:t,onError:r,onMutate:n,onSettled:i,onSuccess:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=eO(),{data:a,error:u,isError:l,isIdle:c,isLoading:h,isSuccess:f,mutate:d,mutateAsync:p,reset:m,status:g,variables:y}=eR(eB({connector:t,chainId:e}),eF,{onError:r,onMutate:n,onSettled:i,onSuccess:o}),v=G.useCallback(r=>d({chainId:(null==r?void 0:r.chainId)??e,connector:(null==r?void 0:r.connector)??t}),[e,t,d]),b=G.useCallback(r=>p({chainId:(null==r?void 0:r.chainId)??e,connector:(null==r?void 0:r.connector)??t}),[e,t,p]);return{connect:v,connectAsync:b,connectors:s.connectors,data:a,error:u,isError:l,isIdle:c,isLoading:h,isSuccess:f,pendingConnector:null==y?void 0:y.connector,reset:m,status:g,variables:y}}let eU=[{entity:"disconnect"}],ej=()=>(0,eg.zP)();function eq(){let{onError:e,onMutate:t,onSettled:r,onSuccess:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{error:i,isError:o,isIdle:s,isLoading:a,isSuccess:u,mutate:l,mutateAsync:c,reset:h,status:f}=eR(eU,ej,{...e?{onError(t,r,n){e(t,n)}}:{},onMutate:t,...r?{onSettled(e,t,n,i){r(t,i)}}:{},...n?{onSuccess(e,t,r){n(r)}}:{}});return{disconnect:l,disconnectAsync:c,error:i,isError:o,isIdle:s,isLoading:a,isSuccess:u,reset:h,status:f}}function eH(){return eI(eg.QC,eg.Hy)}function eK(e){let{chainId:t}=e;return[{entity:"signer",chainId:t,persist:!1}]}function eG(e){let{queryKey:[{chainId:t}]}=e;return(0,eg.DG)({chainId:t})}function ez(){let{chainId:e,suspense:t,onError:r,onSettled:n,onSuccess:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=function(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=eM({chainId:e});return t.network.chainId}({chainId:e}),s=function(e,t,r){let n=Array.isArray(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e,i=function(e,t){var r,n;let i=J({context:e.context}),o=$(),s=X(),a=i.defaultQueryOptions(e);a._optimisticResults=o?"isRestoring":"optimistic",a.onError&&(a.onError=P.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=P.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=P.batchCalls(a.onSettled)),a.suspense&&"number"!=typeof a.staleTime&&(a.staleTime=1e3),(a.suspense||a.useErrorBoundary)&&!s.isReset()&&(a.retryOnMount=!1);let[u]=G.useState(()=>new t(i,a)),l=u.getOptimisticResult(a);if(e_(G.useCallback(e=>o?()=>void 0:u.subscribe(P.batchCalls(e)),[u,o]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),G.useEffect(()=>{s.clearReset()},[s]),G.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),a.suspense&&l.isLoading&&l.isFetching&&!o)throw u.fetchOptimistic(a).then(e=>{var t,r;let{data:n}=e;null===(t=a.onSuccess)||void 0===t||t.call(a,n),null===(r=a.onSettled)||void 0===r||r.call(a,n,null)}).catch(e=>{var t,r;s.clearReset(),null===(t=a.onError)||void 0===t||t.call(a,e),null===(r=a.onSettled)||void 0===r||r.call(a,void 0,e)});if(l.isError&&!s.isReset()&&!l.isFetching&&(r=a.useErrorBoundary,n=[l.error,u.getCurrentQuery()],"function"==typeof r?r(...n):!!r))throw l.error;let c="loading"===l.status&&"idle"===l.fetchStatus?"idle":l.status,h="loading"===c&&"fetching"===l.fetchStatus;return{...l,defaultedOptions:a,isIdle:"idle"===c,isLoading:h,observer:u,status:c}}({context:eP,...n},ei),o={data:i.data,error:i.error,fetchStatus:i.fetchStatus,isError:i.isError,isFetched:i.isFetched,isFetchedAfterMount:i.isFetchedAfterMount,isFetching:i.isFetching,isIdle:i.isIdle,isLoading:i.isLoading,isRefetching:i.isRefetching,isSuccess:i.isSuccess,refetch:i.refetch,status:i.status,internal:{dataUpdatedAt:i.dataUpdatedAt,errorUpdatedAt:i.errorUpdatedAt,failureCount:i.failureCount,isFetchedAfterMount:i.isFetchedAfterMount,isLoadingError:i.isLoadingError,isPaused:i.isPaused,isPlaceholderData:i.isPlaceholderData,isPreviousData:i.isPreviousData,isRefetchError:i.isRefetchError,isStale:i.isStale,remove:i.remove}};return i.defaultedOptions.notifyOnChangeProps?o:function(e,t){let r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(t.trackedProps.add(n),e[n])})}),r}(o,i.observer)}(eK({chainId:o}),eG,{cacheTime:0,staleTime:1/0,suspense:t,onError:r,onSettled:n,onSuccess:i}),a=eT();return G.useEffect(()=>{let e=(0,eg.rn)({chainId:o},e=>a.setQueryData(eK({chainId:o}),e));return e},[a,o]),s}function eW(e){let{domain:t,types:r,value:n}=e;if(!t)throw Error("domain is required");if(!r)throw Error("types is required");if(!n)throw Error("value is required");return(0,eg.xq)({domain:t,types:r,value:n})}function eQ(){let{domain:e,types:t,value:r,onError:n,onMutate:i,onSettled:o,onSuccess:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:a,error:u,isError:l,isIdle:c,isLoading:h,isSuccess:f,mutate:d,mutateAsync:p,reset:m,status:g,variables:y}=eR(function(e){let{domain:t,types:r,value:n}=e;return[{entity:"signTypedData",domain:t,types:r,value:n}]}({domain:e,types:t,value:r}),eW,{onError:n,onMutate:i,onSettled:o,onSuccess:s}),v=G.useCallback(n=>d({domain:(null==n?void 0:n.domain)??e,types:(null==n?void 0:n.types)??t,value:(null==n?void 0:n.value)??r}),[e,t,r,d]),b=G.useCallback(n=>p({domain:(null==n?void 0:n.domain)??e,types:(null==n?void 0:n.types)??t,value:(null==n?void 0:n.value)??r}),[e,t,r,p]);return{data:a,error:u,isError:l,isIdle:c,isLoading:h,isSuccess:f,reset:m,signTypedData:v,signTypedDataAsync:b,status:g,variables:y}}let eJ=e=>[{entity:"switchNetwork",...e}],eV=e=>{let{chainId:t}=e;if(!t)throw Error("chainId is required");return(0,eg.If)({chainId:t})};function eY(){var e;let t,r;let{chainId:n,throwForSwitchChainNotSupported:i,onError:o,onMutate:s,onSettled:a,onSuccess:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=eO(),c=function(){let[,e]=G.useReducer(e=>e+1,0);return e}(),{data:h,error:f,isError:d,isIdle:p,isLoading:m,isSuccess:g,mutate:y,mutateAsync:v,reset:b,status:w,variables:A}=eR(eJ({chainId:n}),eV,{onError:o,onMutate:s,onSettled:a,onSuccess:u}),E=G.useCallback(e=>y({chainId:e??n}),[n,y]),S=G.useCallback(e=>v({chainId:e??n}),[n,v]);G.useEffect(()=>{let e=l.subscribe(e=>{let{chains:t,connector:r}=e;return{chains:t,connector:r}},c);return e},[l,c]);let k=!!(null!==(e=l.connector)&&void 0!==e&&e.switchChain);return(i||k)&&(t=E,r=S),{chains:l.chains??[],data:h,error:f,isError:d,isIdle:p,isLoading:m,isSuccess:g,pendingChainId:null==A?void 0:A.chainId,reset:b,status:w,switchNetwork:t,switchNetworkAsync:r,variables:A}}function e$(){let{address:e,abi:t,signerOrProvider:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return G.useMemo(()=>e&&t?(0,eg.uN)({address:e,abi:t,signerOrProvider:null===r?void 0:r}):null,[e,t,r])}},46601:function(){}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],function(){return t(6840),t(80880)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/pages/_app-d33a6e25cba9f24a.js b/_next/static/chunks/pages/_app-d33a6e25cba9f24a.js new file mode 100644 index 0000000..56397cb --- /dev/null +++ b/_next/static/chunks/pages/_app-d33a6e25cba9f24a.js @@ -0,0 +1,31 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{8417:function(e,t,r){"use strict";r.d(t,{Z:function(){return H}});var n=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t;this._insertTag(((t=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&t.setAttribute("nonce",this.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t))}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?m[A]+" "+E:a(E,/&\f/g,m[A])).trim())&&(h[w++]=k);return b(e,t,r,0===o?R:l,h,f,d)}function L(e,t,r,n){return b(e,t,r,M,c(e,0,n),c(e,n+1,-1),n)}var F=function(e,t,r){for(var n=0,i=0;n=i,i=E(),38===n&&12===i&&(t[r]=1),!k(i);)A();return c(v,e,g)},D=function(e,t){var r=-1,n=44;do switch(k(n)){case 0:38===n&&12===E()&&(t[r]=1),e[r]+=F(g-1,t,r);break;case 2:e[r]+=P(n);break;case 4:if(44===n){e[++r]=58===E()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=o(n)}while(n=A());return e},U=function(e,t){var r;return r=D(S(e),t),v="",r},j=new WeakMap,q=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||j.get(r))&&!n){j.set(e,!0);for(var i=[],o=U(t,i),s=r.props,a=0,u=0;a-1&&!e.return)switch(e.type){case M:e.return=function e(t,r){switch(45^l(t,0)?(((r<<2^l(t,0))<<2^l(t,1))<<2^l(t,2))<<2^l(t,3):0){case 5103:return _+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return _+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return _+t+C+t+x+t+t;case 6828:case 4268:return _+t+x+t+t;case 6165:return _+t+x+"flex-"+t+t;case 5187:return _+t+a(t,/(\w+).+(:[^]+)/,_+"box-$1$2"+x+"flex-$1$2")+t;case 5443:return _+t+x+"flex-item-"+a(t,/flex-|-self/,"")+t;case 4675:return _+t+x+"flex-line-pack"+a(t,/align-content|flex-|-self/,"")+t;case 5548:return _+t+x+a(t,"shrink","negative")+t;case 5292:return _+t+x+a(t,"basis","preferred-size")+t;case 6060:return _+"box-"+a(t,"-grow","")+_+t+x+a(t,"grow","positive")+t;case 4554:return _+a(t,/([^-])(transform)/g,"$1"+_+"$2")+t;case 6187:return a(a(a(t,/(zoom-|grab)/,_+"$1"),/(image-set)/,_+"$1"),t,"")+t;case 5495:case 3959:return a(t,/(image-set\([^]*)/,_+"$1$`$1");case 4968:return a(a(t,/(.+:)(flex-)?(.*)/,_+"box-pack:$3"+x+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+_+t+t;case 4095:case 3583:case 4068:case 2532:return a(t,/(.+)-inline(.+)/,_+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(h(t)-1-r>6)switch(l(t,r+1)){case 109:if(45!==l(t,r+4))break;case 102:return a(t,/(.+:)(.+)-([^]+)/,"$1"+_+"$2-$3$1"+C+(108==l(t,r+3)?"$3":"$2-$3"))+t;case 115:return~u(t,"stretch")?e(a(t,"stretch","fill-available"),r)+t:t}break;case 4949:if(115!==l(t,r+1))break;case 6444:switch(l(t,h(t)-3-(~u(t,"!important")&&10))){case 107:return a(t,":",":"+_)+t;case 101:return a(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+_+(45===l(t,14)?"inline-":"")+"box$3$1"+_+"$2$3$1"+x+"$2box$3")+t}break;case 5936:switch(l(t,r+11)){case 114:return _+t+x+a(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return _+t+x+a(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return _+t+x+a(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return _+t+x+t+t}return t}(e.value,e.length);break;case N:return I([w(e,{value:a(e.value,"@","@"+_)})],n);case R:if(e.length)return e.props.map(function(t){var r;switch(r=t,(r=/(::plac\w+|:read-\w+)/.exec(r))?r[0]:r){case":read-only":case":read-write":return I([w(e,{props:[a(t,/:(read-\w+)/,":"+C+"$1")]})],n);case"::placeholder":return I([w(e,{props:[a(t,/:(plac\w+)/,":"+_+"input-$1")]}),w(e,{props:[a(t,/:(plac\w+)/,":"+C+"$1")]}),w(e,{props:[a(t,/:(plac\w+)/,x+"input-$1")]})],n)}return""}).join("")}}],H=function(e){var t,r,i,s,m,w=e.key;if("css"===w){var x=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(x,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var C=e.stylisPlugins||K,_={},R=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+w+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r2||k(y)>3?"":" "}(T);break;case 92:z+=function(e,t){for(var r;--t&&A()&&!(y<48)&&!(y>102)&&(!(y>57)||!(y<65))&&(!(y>70)||!(y<97)););return r=g+(t<6&&32==E()&&32==A()),c(v,e,r)}(g-1,7);continue;case 47:switch(E()){case 42:case 47:f(b(C=function(e,t){for(;A();)if(e+y===57)break;else if(e+y===84&&47===E())break;return"/*"+c(v,t,g-1)+"*"+o(47===e?e:A())}(A(),g),r,n,O,o(y),c(C,2,-2),0),x);break;default:z+="/"}break;case 123*F:S[_++]=h(z)*U;case 125*F:case 59:case 0:switch(j){case 0:case 125:D=0;case 59+R:-1==U&&(z=a(z,/\f/g,"")),I>0&&h(z)-M&&f(I>32?L(z+";",i,n,M-1):L(a(z," ","")+";",i,n,M-2),x);break;case 59:z+=";";default:if(f(H=B(z,r,n,_,R,s,S,q,G=[],K=[],M),m),123===j){if(0===R)e(z,r,H,H,G,m,M,S,K);else switch(99===N&&110===l(z,3)?100:N){case 100:case 108:case 109:case 115:e(t,H,H,i&&f(B(t,H,H,0,0,s,S,q,s,G=[],M),K),s,K,M,S,i?G:K);break;default:e(z,H,H,H,[""],K,0,S,K)}}}_=R=I=0,F=U=1,q=z="",M=w;break;case 58:M=1+h(z),I=T;default:if(F<1){if(123==j)--F;else if(125==j&&0==F++&&125==(y=g>0?l(v,--g):0,p--,10===y&&(p=1,d--),y))continue}switch(z+=o(j),j*F){case 38:U=R>0?1:(z+="\f",-1);break;case 44:S[_++]=(h(z)-1)*U,U=1;break;case 64:45===E()&&(z+=P(A())),N=E(),R=M=h(q=z+=function(e){for(;!k(E());)A();return c(v,e,g)}(g)),j++;break;case 45:45===T&&2==h(z)&&(F=0)}}return m}("",null,null,null,[""],t=S(t=e),0,[0],t),v="",r),M)},F={key:w,sheet:new n({key:w,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:_,registered:{},insert:function(e,t,r,n){m=r,N(e?e+"{"+t.styles+"}":t.styles),n&&(F.inserted[t.name]=!0)}};return F.sheet.hydrate(R),F}},45042:function(e,t,r){"use strict";function n(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}r.d(t,{Z:function(){return n}})},75260:function(e,t,r){"use strict";r.d(t,{E:function(){return m},T:function(){return h},c:function(){return d},h:function(){return u},w:function(){return c}});var n=r(67294),i=r(8417),o=r(70444),s=r(48137),a=r(27278),u={}.hasOwnProperty,l=n.createContext("undefined"!=typeof HTMLElement?(0,i.Z)({key:"css"}):null);l.Provider;var c=function(e){return(0,n.forwardRef)(function(t,r){return e(t,(0,n.useContext)(l),r)})},h=n.createContext({}),f="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",d=function(e,t){var r={};for(var n in t)u.call(t,n)&&(r[n]=t[n]);return r[f]=e,r},p=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,o.hC)(t,r,n),(0,a.L)(function(){return(0,o.My)(t,r,n)}),null},m=c(function(e,t,r){var i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var a=e[f],l=[i],c="";"string"==typeof e.className?c=(0,o.fp)(t.registered,l,e.className):null!=e.className&&(c=e.className+" ");var d=(0,s.O)(l,void 0,n.useContext(h));c+=t.key+"-"+d.name;var m={};for(var g in e)u.call(e,g)&&"css"!==g&&g!==f&&(m[g]=e[g]);return m.ref=r,m.className=c,n.createElement(n.Fragment,null,n.createElement(p,{cache:t,serialized:d,isStringTag:"string"==typeof a}),n.createElement(a,m))})},35944:function(e,t,r){"use strict";r.d(t,{BX:function(){return a},HY:function(){return o},tZ:function(){return s}});var n=r(85893),i=r(75260);r(67294),r(8417),r(8679),r(48137),r(27278);var o=n.Fragment;function s(e,t,r){return i.h.call(t,"css")?n.jsx(i.E,(0,i.c)(e,t),r):n.jsx(e,t,r)}function a(e,t,r){return i.h.call(t,"css")?n.jsxs(i.E,(0,i.c)(e,t),r):n.jsxs(e,t,r)}},48137:function(e,t,r){"use strict";r.d(t,{O:function(){return p}});var n,i={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},o=r(45042),s=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,u=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},c=(0,o.Z)(function(e){return u(e)?e:e.replace(s,"-$&").toLowerCase()}),h=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(a,function(e,t,r){return n={name:t,styles:r,next:n},t})}return 1===i[e]||u(e)||"number"!=typeof t||0===t?t:t+"px"};function f(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return n={name:r.name,styles:r.styles,next:n},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)n={name:i.name,styles:i.styles,next:n},i=i.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i=4;++n,i-=4)t=(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))*1540483477+((t>>>16)*59797<<16),t^=t>>>24,r=(65535&t)*1540483477+((t>>>16)*59797<<16)^(65535&r)*1540483477+((r>>>16)*59797<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r^=255&e.charCodeAt(n),r=(65535&r)*1540483477+((r>>>16)*59797<<16)}return r^=r>>>13,(((r=(65535&r)*1540483477+((r>>>16)*59797<<16))^r>>>15)>>>0).toString(36)}(s)+l,styles:s,next:n}}},27278:function(e,t,r){"use strict";r.d(t,{L:function(){return s}});var n,i=r(67294),o=!!(n||(n=r.t(i,2))).useInsertionEffect&&(n||(n=r.t(i,2))).useInsertionEffect,s=o||function(e){return e()};o||i.useLayoutEffect},70444:function(e,t,r){"use strict";function n(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "}),n}r.d(t,{My:function(){return o},fp:function(){return n},hC:function(){return i}});var i=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},o=function(e,t,r){i(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next;while(void 0!==o)}}},95851:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="abi/5.7.0"},84243:function(e,t,r){"use strict";r.d(t,{R:function(){return R},$:function(){return M}});var n=r(16441),i=r(6881),o=r(1581),s=r(95851),a=r(61184),u=r(19485);class l extends a.XI{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=(0,u.getAddress)(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}decode(e){return(0,u.getAddress)((0,n.hexZeroPad)(e.readValue().toHexString(),20))}}class c extends a.XI{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}let h=new o.Logger(s.i);function f(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let i={};n=t.map(e=>{let t=e.localName;return t||h.throwError("cannot encode object for signature with missing names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&h.throwError("cannot encode object for signature with duplicate names",o.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]})}else h.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&h.throwArgumentError("types/value length mismatch","tuple",r);let s=new a.QV(e.wordSize),u=new a.QV(e.wordSize),l=[];return t.forEach((e,t)=>{let r=n[t];if(e.dynamic){let i=u.length;e.encode(u,r);let o=s.writeUpdatableValue();l.push(e=>{o(e+i)})}else e.encode(s,r)}),l.forEach(e=>{e(s.length)}),e.appendWriter(s)+e.appendWriter(u)}function d(e,t){let r=[],n=e.subReader(0);t.forEach(t=>{let i=null;if(t.dynamic){let s=e.readValue(),a=n.subReader(s.toNumber());try{i=t.decode(a)}catch(u){if(u.code===o.Logger.errors.BUFFER_OVERRUN)throw u;(i=u).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(l){if(l.code===o.Logger.errors.BUFFER_OVERRUN)throw l;(i=l).baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&r.push(i)});let i=t.reduce((e,t)=>{let r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});t.forEach((e,t)=>{let n=e.localName;if(!n||1!==i[n]||("length"===n&&(n="_length"),null!=r[n]))return;let o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get(){throw o}}):r[n]=o});for(let s=0;s=0?t:"")+"]",i=-1===t||e.dynamic;super("array",n,r,i),this.coder=e,this.length=t}defaultValue(){let e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&h.throwError("insufficient data length",o.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});let r=[];for(let n=0;n{e.dynamic&&(r=!0),n.push(e.type)});let i="tuple("+n.join(",")+")";super("tuple",i,t,r),this.coders=e}defaultValue(){let e=[];this.coders.forEach(t=>{e.push(t.defaultValue())});let t=this.coders.reduce((e,t)=>{let r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))}),Object.freeze(e)}encode(e,t){return f(e,this.coders,t)}decode(e){return e.coerce(this.name,d(e,this.coders))}}var x=r(11388);let C=new o.Logger(s.i),_=RegExp(/^bytes([0-9]*)$/),O=RegExp(/^(u?int)([0-9]*)$/);class R{constructor(e){(0,i.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new l(e.name);case"bool":return new m(e.name);case"string":return new S(e.name);case"bytes":return new y(e.name);case"array":return new p(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new P((e.components||[]).map(e=>this._getCoder(e)),e.name);case"":return new b(e.name)}let t=e.type.match(O);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&C.throwArgumentError("invalid "+t[1]+" bit length","param",e),new E(r/8,"int"===t[1],e.name)}if(t=e.type.match(_)){let n=parseInt(t[1]);return(0===n||n>32)&&C.throwArgumentError("invalid bytes length","param",e),new v(n,e.name)}return C.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new a.Ej(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new a.QV(this._getWordSize())}getDefaultValue(e){let t=e.map(e=>this._getCoder(x._R.from(e))),r=new P(t,"_");return r.defaultValue()}encode(e,t){e.length!==t.length&&C.throwError("types/values length mismatch",o.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});let r=e.map(e=>this._getCoder(x._R.from(e))),n=new P(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){let i=e.map(e=>this._getCoder(x._R.from(e))),o=new P(i,"_");return o.decode(this._getReader((0,n.arrayify)(t),r))}}let M=new R},61184:function(e,t,r){"use strict";r.d(t,{BR:function(){return l},Ej:function(){return f},QV:function(){return h},XI:function(){return c}});var n=r(16441),i=r(2593),o=r(6881),s=r(1581),a=r(95851);let u=new s.Logger(a.i);function l(e){let t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){let o=e.slice();o.push(i);try{r(o,n[i])}catch(s){t.push({path:o,error:s})}}};return r([],e),t}class c{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){u.throwArgumentError(e,this.localName,t)}}class h{constructor(e){(0,o.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,n.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,n.concat)(e._data))}writeBytes(e){let t=(0,n.arrayify)(e),r=t.length%this.wordSize;return r&&(t=(0,n.concat)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,n.arrayify)(i.O$.from(e));return t.length>this.wordSize&&u.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,n.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){let e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class f{constructor(e,t,r,i){(0,o.defineReadOnly)(this,"_data",(0,n.arrayify)(e)),(0,o.defineReadOnly)(this,"wordSize",t||32),(0,o.defineReadOnly)(this,"_coerceFunc",r),(0,o.defineReadOnly)(this,"allowLoose",i),this._offset=0}get data(){return(0,n.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&48>=parseInt(r[1])&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):f.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:u.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new f(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}},11388:function(e,t,r){"use strict";r.d(t,{HY:function(){return y},IC:function(){return P},QV:function(){return v},Xg:function(){return E},YW:function(){return k},_R:function(){return m},pc:function(){return d}});var n=r(2593),i=r(6881),o=r(1581),s=r(95851);let a=new o.Logger(s.i),u={},l={calldata:!0,memory:!0,storage:!0},c={calldata:!0,memory:!0};function h(e,t){if("bytes"===e||"string"===e){if(l[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&c[t])return!0;return(l[t]||"payable"===t)&&a.throwArgumentError("invalid modifier","name",t),!1}function f(e,t){for(let r in t)(0,i.defineReadOnly)(e,r,t[r])}let d=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=RegExp(/^(.*)\[([0-9]*)\]$/);class m{constructor(e,t){e!==u&&a.throwError("use fromString",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),f(this,t);let r=this.type.match(p);r?f(this,{arrayLength:parseInt(r[2]||"-1"),arrayChildren:m.fromObject({type:r[1],components:this.components}),baseType:"array"}):f(this,{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(t)}let r="";return"array"===this.baseType?r+=this.arrayChildren.format(e)+"["+(this.arrayLength<0?"":String(this.arrayLength))+"]":"tuple"===this.baseType?(e!==d.sighash&&(r+=this.type),r+="("+this.components.map(t=>t.format(e)).join(e===d.full?", ":",")+")"):r+=this.type,e!==d.sighash&&(!0===this.indexed&&(r+=" indexed"),e===d.full&&this.name&&(r+=" "+this.name)),r}static from(e,t){return"string"==typeof e?m.fromString(e,t):m.fromObject(e)}static fromObject(e){return m.isParamType(e)?e:new m(u,{name:e.name||null,type:x(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(m.fromObject):null})}static fromString(e,t){var r;return r=function(e,t){let r=e;function n(t){a.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let u=0;um.fromString(e,t))}class y{constructor(e,t){e!==u&&a.throwError("use a static from method",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return y.isFragment(e)?e:"string"==typeof e?y.fromString(e):y.fromObject(e)}static fromObject(e){if(y.isFragment(e))return e;switch(e.type){case"function":return k.fromObject(e);case"event":return v.fromObject(e);case"constructor":return E.fromObject(e);case"error":return P.fromObject(e);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?v.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?k.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?E.fromString(e.trim()):"error"===e.split(" ")[0]?P.fromString(e.substring(5).trim()):a.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class v extends y{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==d.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===d.full?", ":",")+") ",e!==d.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?v.fromString(e):v.fromObject(e)}static fromObject(e){if(v.isEventFragment(e))return e;"event"!==e.type&&a.throwArgumentError("invalid event object","value",e);let t={name:_(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(m.fromObject):[],type:"event"};return new v(u,t)}static fromString(e){let t=e.match(O);t||a.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach(e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+e)}}),v.fromObject({name:t[1].trim(),anonymous:r,inputs:g(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function b(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.O$.from(r[1]),r[0]):e}function w(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}})}function A(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&a.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&a.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||a.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&a.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&a.throwArgumentError("unable to determine stateMutability","value",e),t}class E extends y{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});e===d.sighash&&a.throwError("cannot format a constructor for sighash",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map(t=>t.format(e)).join(e===d.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?E.fromString(e):E.fromObject(e)}static fromObject(e){if(E.isConstructorFragment(e))return e;"constructor"!==e.type&&a.throwArgumentError("invalid constructor object","value",e);let t=A(e);t.constant&&a.throwArgumentError("constructor cannot be constant","value",e);let r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.O$.from(e.gas):null};return new E(u,r)}static fromString(e){let t={type:"constructor"},r=(e=b(e,t)).match(O);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",e),t.inputs=g(r[2].trim(),!1),w(r[3].trim(),t),E.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class k extends E{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),outputs:this.outputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==d.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===d.full?", ":",")+") ",e!==d.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(t=>t.format(e)).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?k.fromString(e):k.fromObject(e)}static fromObject(e){if(k.isFunctionFragment(e))return e;"function"!==e.type&&a.throwArgumentError("invalid function object","value",e);let t=A(e),r={type:e.type,name:_(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(m.fromObject):[],outputs:e.outputs?e.outputs.map(m.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.O$.from(e.gas):null};return new k(u,r)}static fromString(e){let t={type:"function"},r=(e=b(e,t)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",e);let n=r[0].match(O);if(n||a.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&_(t.name),t.inputs=g(n[2],!1),w(n[3].trim(),t),r.length>1){let i=r[1].match(O);(""!=i[1].trim()||""!=i[3].trim())&&a.throwArgumentError("unexpected tokens","value",e),t.outputs=g(i[2],!1)}else t.outputs=[];return k.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function S(e){let t=e.format();return("Error(string)"===t||"Panic(uint256)"===t)&&a.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class P extends y{format(e){if(e||(e=d.sighash),d[e]||a.throwArgumentError("invalid format type","format",e),e===d.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==d.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===d.full?", ":",")+") ").trim()}static from(e){return"string"==typeof e?P.fromString(e):P.fromObject(e)}static fromObject(e){if(P.isErrorFragment(e))return e;"error"!==e.type&&a.throwArgumentError("invalid error object","value",e);let t={type:e.type,name:_(e.name),inputs:e.inputs?e.inputs.map(m.fromObject):[]};return S(new P(u,t))}static fromString(e){let t={type:"error"},r=e.match(O);return r||a.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&_(t.name),t.inputs=g(r[2],!1),S(P.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function x(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}let C=RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function _(e){return e&&e.match(C)||a.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}let O=RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},83893:function(e,t,r){"use strict";r.r(t),r.d(t,{AbiCoder:function(){return i.R},ConstructorFragment:function(){return n.Xg},ErrorFragment:function(){return n.IC},EventFragment:function(){return n.QV},FormatTypes:function(){return n.pc},Fragment:function(){return n.HY},FunctionFragment:function(){return n.YW},Indexed:function(){return o.Hk},Interface:function(){return o.vU},LogDescription:function(){return o.CC},ParamType:function(){return n._R},TransactionDescription:function(){return o.vk},checkResultErrors:function(){return s.BR},defaultAbiCoder:function(){return i.$}});var n=r(11388),i=r(84243),o=r(8198),s=r(61184)},8198:function(e,t,r){"use strict";r.d(t,{CC:function(){return p},Hk:function(){return y},vU:function(){return w},vk:function(){return m}});var n=r(19485),i=r(2593),o=r(16441),s=r(32046),a=r(38197),u=r(6881),l=r(84243),c=r(11388),h=r(1581),f=r(95851);let d=new h.Logger(f.i);class p extends u.Description{}class m extends u.Description{}class g extends u.Description{}class y extends u.Description{static isIndexed(e){return!!(e&&e._isIndexed)}}let v={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function b(e,t){let r=Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class w{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,(0,u.defineReadOnly)(this,"fragments",t.map(e=>c.HY.from(e)).filter(e=>null!=e)),(0,u.defineReadOnly)(this,"_abiCoder",(0,u.getStatic)(new.target,"getAbiCoder")()),(0,u.defineReadOnly)(this,"functions",{}),(0,u.defineReadOnly)(this,"errors",{}),(0,u.defineReadOnly)(this,"events",{}),(0,u.defineReadOnly)(this,"structs",{}),this.fragments.forEach(e=>{let t=null;switch(e.type){case"constructor":if(this.deploy){d.warn("duplicate definition - constructor");return}(0,u.defineReadOnly)(this,"deploy",e);return;case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();if(t[r]){d.warn("duplicate definition - "+r);return}t[r]=e}),this.deploy||(0,u.defineReadOnly)(this,"deploy",c.Xg.from({payable:!1,type:"constructor"})),(0,u.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=c.pc.full),e===c.pc.sighash&&d.throwArgumentError("interface does not support formatting sighash","format",e);let t=this.fragments.map(t=>t.format(e));return e===c.pc.json?JSON.stringify(t.map(e=>JSON.parse(e))):t}static getAbiCoder(){return l.$}static getAddress(e){return(0,n.getAddress)(e)}static getSighash(e){return(0,o.hexDataSlice)((0,s.id)(e.format()),0,4)}static getEventTopic(e){return(0,s.id)(e.format())}getFunction(e){if((0,o.isHexString)(e)){for(let t in this.functions)if(e===this.getSighash(t))return this.functions[t];d.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){let r=e.trim(),n=Object.keys(this.functions).filter(e=>e.split("(")[0]===r);return 0===n.length?d.throwArgumentError("no matching function","name",r):n.length>1&&d.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}let i=this.functions[c.YW.fromString(e).format()];return i||d.throwArgumentError("no matching function","signature",e),i}getEvent(e){if((0,o.isHexString)(e)){let t=e.toLowerCase();for(let r in this.events)if(t===this.getEventTopic(r))return this.events[r];d.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){let n=e.trim(),i=Object.keys(this.events).filter(e=>e.split("(")[0]===n);return 0===i.length?d.throwArgumentError("no matching event","name",n):i.length>1&&d.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}let s=this.events[c.QV.fromString(e).format()];return s||d.throwArgumentError("no matching event","signature",e),s}getError(e){if((0,o.isHexString)(e)){let t=(0,u.getStatic)(this.constructor,"getSighash");for(let r in this.errors){let n=this.errors[r];if(e===t(n))return this.errors[r]}d.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){let i=e.trim(),s=Object.keys(this.errors).filter(e=>e.split("(")[0]===i);return 0===s.length?d.throwArgumentError("no matching error","name",i):s.length>1&&d.throwArgumentError("multiple matching errors","name",i),this.errors[s[0]]}let a=this.errors[c.YW.fromString(e).format()];return a||d.throwArgumentError("no matching error","signature",e),a}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch(t){throw r}}return(0,u.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),(0,u.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));let r=(0,o.arrayify)(t);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(e)&&d.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,o.arrayify)(t);return(0,o.hexlify)(r.slice(0,4))!==this.getSighash(e)&&d.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,o.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,o.hexlify)((0,o.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,o.arrayify)(t),n=null,i="",s=null,a=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(l){}break;case 4:{let c=(0,o.hexlify)(r.slice(0,4)),f=v[c];if(f)s=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,u=f.signature,f.reason&&(n=s[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{let p=this.getError(c);s=this._abiCoder.decode(p.inputs,r.slice(4)),a=p.name,u=p.format()}catch(m){}}}return d.throwError("call revert exception"+i,h.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,o.hexlify)(t),errorArgs:s,errorName:a,errorSignature:u,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,o.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&d.throwError("too many arguments for "+e.format(),h.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));let n=(e,t)=>"string"===e.type?(0,s.id)(t):"bytes"===e.type?(0,a.keccak256)((0,o.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=i.O$.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,o.hexZeroPad)((0,o.hexlify)(t),32));for(t.forEach((t,i)=>{let o=e.inputs[i];if(!o.indexed){null!=t&&d.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t);return}null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?d.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map(e=>n(o,e))):r.push(n(o,t))});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));let r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&d.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((e,o)=>{let u=t[o];if(e.indexed){if("string"===e.type)r.push((0,s.id)(u));else if("bytes"===e.type)r.push((0,a.keccak256)(u));else if("tuple"===e.baseType||"array"===e.baseType)throw Error("not implemented");else r.push(this._abiCoder.encode([e.type],[u]))}else n.push(e),i.push(u)}),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let n=this.getEventTopic(e);(0,o.isHexString)(r[0],32)&&r[0].toLowerCase()===n||d.throwError("fragment/topic mismatch",h.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}let i=[],s=[],a=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(c._R.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(s.push(e),a.push(!1))});let u=null!=r?this._abiCoder.decode(i,(0,o.concat)(r)):null,l=this._abiCoder.decode(s,t,!0),f=[],p=0,m=0;e.inputs.forEach((e,t)=>{if(e.indexed){if(null==u)f[t]=new y({_isIndexed:!0,hash:null});else if(a[t])f[t]=new y({_isIndexed:!0,hash:u[m++]});else try{f[t]=u[m++]}catch(r){f[t]=r}}else try{f[t]=l[p++]}catch(n){f[t]=n}if(e.name&&null==f[e.name]){let i=f[t];i instanceof Error?Object.defineProperty(f,e.name,{enumerable:!0,get(){throw b(`property ${JSON.stringify(e.name)}`,i)}}):f[e.name]=i}});for(let g=0;gnull)}),r=null,o=null,s=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,s=n.O$.from("1500000000"),o=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:r,maxFeePerGas:o,maxPriorityFeePerGas:s,gasPrice:t}},new(r||(r=Promise))(function(n,i){function s(e){try{u(o.next(e))}catch(t){i(t)}}function a(e){try{u(o.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((o=o.apply(e,t||[])).next())})}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!!(e&&e._isProvider)}}},48088:function(e,t,r){"use strict";r.r(t),r.d(t,{Signer:function(){return l},VoidSigner:function(){return c}});var n=r(6881),i=r(1581),o=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let s=new i.Logger("abstract-signer/5.7.0"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],u=[i.Logger.errors.INSUFFICIENT_FUNDS,i.Logger.errors.NONCE_EXPIRED,i.Logger.errors.REPLACEMENT_UNDERPRICED];class l{constructor(){s.checkAbstract(new.target,l),(0,n.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return o(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return o(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return o(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let t=yield(0,n.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return o(this,void 0,void 0,function*(){this._checkProvider("call");let r=yield(0,n.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return o(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return o(this,void 0,void 0,function*(){this._checkProvider("getChainId");let e=yield this.provider.getNetwork();return e.chainId})}getGasPrice(){return o(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return o(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return o(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(let t in e)-1===a.indexOf(t)&&s.throwArgumentError("invalid transaction key: "+t,"transaction",e);let r=(0,n.shallowCopy)(e);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&s.throwArgumentError("from address mismatch","transaction",e),t[0])),r}populateTransaction(e){return o(this,void 0,void 0,function*(){let t=yield(0,n.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then(e=>o(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.resolveName(e);return null==t&&s.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})),t.to.catch(e=>{}));let r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null!=t.gasPrice&&(2===t.type||r)?s.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(0===t.type||1===t.type)&&r&&s.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(2===t.type||null==t.type)&&null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)t.type=2;else if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{let a=yield this.getFeeData();if(null==t.type){if(null!=a.maxFeePerGas&&null!=a.maxPriorityFeePerGas){if(t.type=2,null!=t.gasPrice){let l=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=l,t.maxPriorityFeePerGas=l}else null==t.maxFeePerGas&&(t.maxFeePerGas=a.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=a.maxPriorityFeePerGas)}else null!=a.gasPrice?(r&&s.throwError("network does not support EIP-1559",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=a.gasPrice),t.type=0):s.throwError("failed to get consistent fee data",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"})}else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=a.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch(e=>{if(u.indexOf(e.code)>=0)throw e;return s.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})})),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(t=>(0!==t[1]&&t[0]!==t[1]&&s.throwArgumentError("chainId address mismatch","transaction",e),t[0])),yield(0,n.resolveProperties)(t)})}_checkProvider(e){this.provider||s.throwError("missing provider",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class c extends l{constructor(e,t){super(),(0,n.defineReadOnly)(this,"address",e),(0,n.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then(()=>{s.throwError(e,i.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new c(this.address,e)}}},19485:function(e,t,r){"use strict";r.r(t),r.d(t,{getAddress:function(){return m},getContractAddress:function(){return v},getCreate2Address:function(){return b},getIcapAddress:function(){return y},isAddress:function(){return g}});var n=r(16441),i=r(2593),o=r(38197),s=r(59052),a=r(1581);let u=new a.Logger("address/5.7.0");function l(e){(0,n.isHexString)(e,20)||u.throwArgumentError("invalid address","address",e),e=e.toLowerCase();let t=e.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=t[i].charCodeAt(0);let s=(0,n.arrayify)((0,o.keccak256)(r));for(let a=0;a<40;a+=2)s[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(15&s[a>>1])>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}let c={};for(let h=0;h<10;h++)c[String(h)]=String(h);for(let f=0;f<26;f++)c[String.fromCharCode(65+f)]=String(10+f);let d=Math.floor(Math.log10?Math.log10(9007199254740991):Math.log(9007199254740991)/Math.LN10);function p(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>c[e]).join("");for(;t.length>=d;){let r=t.substring(0,d);t=parseInt(r,10)%97+t.substring(r.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}function m(e){let t=null;if("string"!=typeof e&&u.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=l(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=l("0x"+t)}else u.throwArgumentError("invalid address","address",e);return t}function g(e){try{return m(e),!0}catch(t){}return!1}function y(e){let t=(0,i.t2)(m(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t}function v(e){let t=null;try{t=m(e.from)}catch(r){u.throwArgumentError("missing from address","transaction",e)}let a=(0,n.stripZeros)((0,n.arrayify)(i.O$.from(e.nonce).toHexString()));return m((0,n.hexDataSlice)((0,o.keccak256)((0,s.encode)([t,a])),12))}function b(e,t,r){return 32!==(0,n.hexDataLength)(t)&&u.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,n.hexDataLength)(r)&&u.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),m((0,n.hexDataSlice)((0,o.keccak256)((0,n.concat)(["0xff",m(e),t,r])),12))}},59567:function(e,t,r){"use strict";r.d(t,{J:function(){return i},c:function(){return o}});var n=r(16441);function i(e){e=atob(e);let t=[];for(let r=0;r0;)r.push(o%this.base),o=o/this.base|0}let a="";for(let u=0;0===t[u]&&u=0;--l)a+=this.alphabet[r[l]];return a}decode(e){if("string"!=typeof e)throw TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;o>0;)t.push(255&o),o>>=8}for(let a=0;e[a]===this._leader&&a0&&(10===arguments[0]?f||(f=!0,l.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?l.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):l.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof d)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new d(c,p(e)):e.match(/^-?[0-9]+$/)?new d(c,p(new u(e))):l.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&y("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&y("overflow","BigNumber.from",e),d.from(String(e));if("bigint"==typeof e)return d.from(e.toString());if((0,o.isBytes)(e))return d.from((0,o.hexlify)(e));if(e){if(e.toHexString){let t=e.toHexString();if("string"==typeof t)return d.from(t)}else{let r=e._hex;if(null==r&&"BigNumber"===e.type&&(r=e.hex),"string"==typeof r&&((0,o.isHexString)(r)||"-"===r[0]&&(0,o.isHexString)(r.substring(1))))return d.from(r)}}return l.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function p(e){if("string"!=typeof e)return p(e.toString(16));if("-"===e[0])return("-"===(e=e.substring(1))[0]&&l.throwArgumentError("invalid hex","value",e),"0x00"===(e=p(e)))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function m(e){return d.from(p(e))}function g(e){let t=d.from(e).toHexString();return"-"===t[0]?new u("-"+t.substring(3),16):new u(t.substring(2),16)}function y(e,t,r){let n={fault:e,operation:t};return null!=r&&(n.value=r),l.throwError(e,s.Logger.errors.NUMERIC_FAULT,n)}function v(e){return new u(e,36).toString(16)}function b(e){return new u(e,16).toString(36)}},20335:function(e,t,r){"use strict";r.d(t,{Ox:function(){return m},S5:function(){return p},xO:function(){return g},xs:function(){return y}});var n=r(16441),i=r(1581),o=r(48794),s=r(2593);let a=new i.Logger(o.i),u={},l=s.O$.from(0),c=s.O$.from(-1);function h(e,t,r,n){let o={fault:t,operation:r};return void 0!==n&&(o.value=n),a.throwError(e,i.Logger.errors.NUMERIC_FAULT,o)}let f="0";for(;f.length<256;)f+=f;function d(e){if("number"!=typeof e)try{e=s.O$.from(e).toNumber()}catch(t){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+f.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function p(e,t){null==t&&(t=0);let r=d(t);e=s.O$.from(e);let n=e.lt(l);n&&(e=e.mul(c));let i=e.mod(r).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",e);let o=i[0],u=i[1];for(o||(o="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>r.length-1&&h("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.lengthnull==e[t]?n:(typeof e[t]!==r&&a.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=o("signed","boolean",t),r=o("width","number",r),n=o("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new g(u,t,r,n)}}class y{constructor(e,t,r,n){e!==u&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);let t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return y.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);let t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return y.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);let t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return y.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);let t=m(this._value,this.format.decimals),r=m(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format),r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(v.toFormat(t.format))),t}ceiling(){let e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format),r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(v.toFormat(t.format))),t}round(e){null==e&&(e=0);let t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;let r=y.from("1"+f.substring(0,e),this.format),n=b.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);let t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,n.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,s.Zm)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),y.fromString(p(e,t),g.from(r))}static fromString(e,t){null==t&&(t="fixed");let r=g.from(t),i=m(e,r.decimals);!r.signed&&i.lt(l)&&h("unsigned value cannot be negative","overflow","value",e);let o=null;r.signed?o=i.toTwos(r.width).toHexString():(o=i.toHexString(),o=(0,n.hexZeroPad)(o,r.width/8));let s=p(i,r.decimals);return new y(u,o,s,r)}static fromBytes(e,t){null==t&&(t="fixed");let r=g.from(t);if((0,n.arrayify)(e).length>r.width/8)throw Error("overflow");let i=s.O$.from(e);r.signed&&(i=i.fromTwos(r.width));let o=i.toTwos((r.signed?0:1)+r.width).toHexString(),a=p(i,r.decimals);return new y(u,o,a,r)}static from(e,t){if("string"==typeof e)return y.fromString(e,t);if((0,n.isBytes)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(r){if(r.code!==i.Logger.errors.INVALID_ARGUMENT)throw r}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}let v=y.from(1),b=y.from("0.5")},833:function(e,t,r){"use strict";r.r(t),r.d(t,{BigNumber:function(){return n.O$},FixedFormat:function(){return i.xO},FixedNumber:function(){return i.xs},_base16To36:function(){return n.t2},_base36To16:function(){return n.g$},formatFixed:function(){return i.S5},parseFixed:function(){return i.Ox}});var n=r(2593),i=r(20335)},16441:function(e,t,r){"use strict";r.r(t),r.d(t,{arrayify:function(){return c},concat:function(){return h},hexConcat:function(){return b},hexDataLength:function(){return y},hexDataSlice:function(){return v},hexStripZeros:function(){return A},hexValue:function(){return w},hexZeroPad:function(){return E},hexlify:function(){return g},isBytes:function(){return l},isBytesLike:function(){return a},isHexString:function(){return p},joinSignature:function(){return S},splitSignature:function(){return k},stripZeros:function(){return f},zeroPad:function(){return d}});var n=r(1581);let i=new n.Logger("bytes/5.7.0");function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){let t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return p(e)&&!(e.length%2)||l(e)}function u(e){return"number"==typeof e&&e==e&&e%1==0}function l(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e||!u(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"==typeof e){i.checkSafeUint53(e,"invalid arrayify value");let r=[];for(;e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),s(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e)&&(e=e.toHexString()),p(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":i.throwArgumentError("hex data is odd-length","value",e));let a=[];for(let u=0;uc(e)),r=t.reduce((e,t)=>e+t.length,0),n=new Uint8Array(r);return t.reduce((e,t)=>(n.set(t,e),e+t.length),0),s(n)}function f(e){let t=c(e);if(0===t.length)return t;let r=0;for(;rt&&i.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),s(r)}function p(e,t){return"string"==typeof e&&!!e.match(/^0x[0-9A-Fa-f]*$/)&&(!t||e.length===2+2*t)}let m="0123456789abcdef";function g(e,t){if(t||(t={}),"number"==typeof e){i.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=m[15&e]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":i.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(l(e)){let n="0x";for(let s=0;s>4]+m[15&a]}return n}return i.throwArgumentError("invalid hexlify value","value",e)}function y(e){if("string"!=typeof e)e=g(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function v(e,t,r){return("string"!=typeof e?e=g(e):(!p(e)||e.length%2)&&i.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r)?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function b(e){let t="0x";return e.forEach(e=>{t+=g(e).substring(2)}),t}function w(e){let t=A(g(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function A(e){"string"!=typeof e&&(e=g(e)),p(e)||i.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&i.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function k(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){let r=c(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=g(r.slice(0,32)),t.s=g(r.slice(32,64))):65===r.length?(t.r=g(r.slice(0,32)),t.s=g(r.slice(32,64)),t.v=r[64]):i.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:i.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=g(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){let n=d(c(t._vs),32);t._vs=g(n);let o=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&i.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;let s=g(n);null==t.s?t.s=s:t.s!==s&&i.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?i.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{let u=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==u&&i.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=E(t.r,32):i.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=E(t.s,32):i.throwArgumentError("signature missing or invalid s","signature",e);let l=c(t.s);l[0]>=128&&i.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128);let h=g(l);t._vs&&(p(t._vs)||i.throwArgumentError("signature invalid _vs","signature",e),t._vs=E(t._vs,32)),null==t._vs?t._vs=h:t._vs!==h&&i.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function S(e){return g(h([(e=k(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},9279:function(e,t,r){"use strict";r.d(t,{d:function(){return n}});let n="0x0000000000000000000000000000000000000000"},21046:function(e,t,r){"use strict";r.d(t,{$B:function(){return c},Bz:function(){return l},Ce:function(){return u},PS:function(){return h},Py:function(){return a},_Y:function(){return o},fh:function(){return s},tL:function(){return i}});var n=r(2593);let i=n.O$.from(-1),o=n.O$.from(0),s=n.O$.from(1),a=n.O$.from(2),u=n.O$.from("1000000000000000000"),l=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),c=n.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),h=n.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},57218:function(e,t,r){"use strict";r.d(t,{R:function(){return n}});let n="0x0000000000000000000000000000000000000000000000000000000000000000"},21815:function(e,t,r){"use strict";r.r(t),r.d(t,{AddressZero:function(){return n.d},EtherSymbol:function(){return s},HashZero:function(){return o.R},MaxInt256:function(){return i.PS},MaxUint256:function(){return i.Bz},MinInt256:function(){return i.$B},NegativeOne:function(){return i.tL},One:function(){return i.fh},Two:function(){return i.Py},WeiPerEther:function(){return i.Ce},Zero:function(){return i._Y}});var n=r(9279),i=r(21046),o=r(57218);let s="Ξ"},64146:function(e,t,r){"use strict";r.r(t),r.d(t,{BaseContract:function(){return C},Contract:function(){return _},ContractFactory:function(){return O}});var n=r(61184),i=r(8198),o=r(81556),s=r(48088),a=r(19485),u=r(2593),l=r(16441),c=r(6881),h=r(83875),f=r(1581),d=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let p=new f.Logger("contracts/5.7.0"),m={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function g(e,t){return d(this,void 0,void 0,function*(){let r=yield t;"string"!=typeof r&&p.throwArgumentError("invalid address or ENS name","name",r);try{return(0,a.getAddress)(r)}catch(n){}e||p.throwError("a provider or signer is needed to resolve ENS names",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});let i=yield e.resolveName(r);return null==i&&p.throwArgumentError("resolver or addr is not configured for ENS name","name",r),i})}function y(e,t,r){return d(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((r,n)=>y(e,Array.isArray(t)?t[n]:t[r.name],r))):"address"===r.type?yield g(e,t):"tuple"===r.type?yield y(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map(t=>y(e,t,r.arrayChildren))):Promise.reject(p.makeError("invalid value for array",f.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t})}function v(e,t,r){return d(this,void 0,void 0,function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=(0,c.shallowCopy)(r.pop())),p.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=(0,c.resolveProperties)({override:g(e.signer,n.from),signer:e.signer.getAddress()}).then(e=>d(this,void 0,void 0,function*(){return(0,a.getAddress)(e.signer)!==e.override&&p.throwError("Contract with a Signer cannot override from",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})):n.from=e.signer.getAddress():n.from&&(n.from=g(e.provider,n.from));let i=yield(0,c.resolveProperties)({args:y(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,c.resolveProperties)(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),s={data:o,to:i.address},m=i.overrides;if(null!=m.nonce&&(s.nonce=u.O$.from(m.nonce).toNumber()),null!=m.gasLimit&&(s.gasLimit=u.O$.from(m.gasLimit)),null!=m.gasPrice&&(s.gasPrice=u.O$.from(m.gasPrice)),null!=m.maxFeePerGas&&(s.maxFeePerGas=u.O$.from(m.maxFeePerGas)),null!=m.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=u.O$.from(m.maxPriorityFeePerGas)),null!=m.from&&(s.from=m.from),null!=m.type&&(s.type=m.type),null!=m.accessList&&(s.accessList=(0,h.accessListify)(m.accessList)),null==s.gasLimit&&null!=t.gas){let v=21e3,b=(0,l.arrayify)(o);for(let w=0;wnull!=n[e]);return E.length&&p.throwError(`cannot override ${E.map(e=>JSON.stringify(e)).join(",")}`,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:E}),s})}function b(e,t){let r=t.wait.bind(t);t.wait=t=>r(t).then(t=>(t.events=t.logs.map(r=>{let n=(0,c.deepCopy)(r),i=null;try{i=e.interface.parseLog(r)}catch(o){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n}),t))}function w(e,t,r){let n=e.signer||e.provider;return function(...i){return d(this,void 0,void 0,function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){let s=(0,c.shallowCopy)(i.pop());null!=s.blockTag&&(o=yield s.blockTag),delete s.blockTag,i.push(s)}null!=e.deployTransaction&&(yield e._deployed(o));let a=yield v(e,t,i),u=yield n.call(a,o);try{let l=e.interface.decodeFunctionResult(t,u);return r&&1===t.outputs.length&&(l=l[0]),l}catch(h){throw h.code===f.Logger.errors.CALL_EXCEPTION&&(h.address=e.address,h.args=i,h.transaction=a),h}})}}function A(e,t,r){return t.constant?w(e,t,r):function(...r){return d(this,void 0,void 0,function*(){e.signer||p.throwError("sending a transaction requires a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());let n=yield v(e,t,r),i=yield e.signer.sendTransaction(n);return b(e,i),i})}}function E(e){return e.address&&(null==e.topics||0===e.topics.length)?"*":(e.address||"*")+"@"+(e.topics?e.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class k{constructor(e,t){(0,c.defineReadOnly)(this,"tag",e),(0,c.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter(r=>!!t||r.listener!==e||(t=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){let t=this.listenerCount();return this._listeners=this._listeners.filter(t=>{let r=e.slice();return setTimeout(()=>{t.listener.apply(this,r)},0),!t.once}),t}prepareEvent(e){}getEmit(e){return[e]}}class S extends k{constructor(){super("error",null)}}class P extends k{constructor(e,t,r,n){let i={address:e},o=t.getEventTopic(r);n?(o!==n[0]&&p.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(E(i),i),(0,c.defineReadOnly)(this,"address",e),(0,c.defineReadOnly)(this,"interface",t),(0,c.defineReadOnly)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){let t=(0,n.BR)(e.args);if(t.length)throw t[0].error;let r=(e.args||[]).slice();return r.push(e),r}}class x extends k{constructor(e,t){super("*",{address:e}),(0,c.defineReadOnly)(this,"address",e),(0,c.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{let t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(r){}}}class C{constructor(e,t,r){(0,c.defineReadOnly)(this,"interface",(0,c.getStatic)(new.target,"getInterface")(t)),null==r?((0,c.defineReadOnly)(this,"provider",null),(0,c.defineReadOnly)(this,"signer",null)):s.Signer.isSigner(r)?((0,c.defineReadOnly)(this,"provider",r.provider||null),(0,c.defineReadOnly)(this,"signer",r)):o.zt.isProvider(r)?((0,c.defineReadOnly)(this,"provider",r),(0,c.defineReadOnly)(this,"signer",null)):p.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,c.defineReadOnly)(this,"callStatic",{}),(0,c.defineReadOnly)(this,"estimateGas",{}),(0,c.defineReadOnly)(this,"functions",{}),(0,c.defineReadOnly)(this,"populateTransaction",{}),(0,c.defineReadOnly)(this,"filters",{});{let n={};Object.keys(this.interface.events).forEach(e=>{let t=this.interface.events[e];(0,c.defineReadOnly)(this.filters,e,(...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(t,e)})),n[t.name]||(n[t.name]=[]),n[t.name].push(e)}),Object.keys(n).forEach(e=>{let t=n[e];1===t.length?(0,c.defineReadOnly)(this.filters,e,this.filters[t[0]]):p.warn(`Duplicate definition of ${e} (${t.join(", ")})`)})}if((0,c.defineReadOnly)(this,"_runningEvents",{}),(0,c.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&p.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,c.defineReadOnly)(this,"address",e),this.provider)(0,c.defineReadOnly)(this,"resolvedAddress",g(this.provider,e));else try{(0,c.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,a.getAddress)(e)))}catch(i){p.throwError("provider is required to use ENS name as contract address",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(e=>{});let u={},l={};Object.keys(this.interface.functions).forEach(e=>{let t=this.interface.functions[e];if(l[e]){p.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);return}l[e]=!0;{let r=t.name;u[`%${r}`]||(u[`%${r}`]=[]),u[`%${r}`].push(e)}if(null==this[e]&&(0,c.defineReadOnly)(this,e,A(this,t,!0)),null==this.functions[e]&&(0,c.defineReadOnly)(this.functions,e,A(this,t,!1)),null==this.callStatic[e]&&(0,c.defineReadOnly)(this.callStatic,e,w(this,t,!0)),null==this.populateTransaction[e]){var n;(0,c.defineReadOnly)(this.populateTransaction,e,(n=this,function(...e){return v(n,t,e)}))}null==this.estimateGas[e]&&(0,c.defineReadOnly)(this.estimateGas,e,function(e,t){let r=e.signer||e.provider;return function(...n){return d(this,void 0,void 0,function*(){r||p.throwError("estimate require a provider or signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});let i=yield v(e,t,n);return yield r.estimateGas(i)})}}(this,t))}),Object.keys(u).forEach(e=>{let t=u[e];if(t.length>1)return;e=e.substring(1);let r=t[0];try{null==this[e]&&(0,c.defineReadOnly)(this,e,this[r])}catch(n){}null==this.functions[e]&&(0,c.defineReadOnly)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,c.defineReadOnly)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,c.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,c.defineReadOnly)(this.estimateGas,e,this.estimateGas[r])})}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getInterface(e){return i.vU.isInterface(e)?e:new i.vU(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(e=>("0x"===e&&p.throwError("contract not deployed",f.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||p.throwError("sending a transactions require a signer",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});let t=(0,c.shallowCopy)(e||{});return["from","to"].forEach(function(e){null!=t[e]&&p.throwError("cannot override "+e,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})}),t.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(t))}connect(e){"string"==typeof e&&(e=new s.VoidSigner(e,this.provider));let t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,c.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return i.Hk.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new S);if("event"===e)return this._normalizeRunningEvent(new k("event",null));if("*"===e)return this._normalizeRunningEvent(new x(this.address,this.interface));let t=this.interface.getEvent(e);return this._normalizeRunningEvent(new P(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{let r=e.topics[0];if("string"!=typeof r)throw Error("invalid topic");let n=this.interface.getEvent(r);return this._normalizeRunningEvent(new P(this.address,this.interface,n,e.topics))}catch(i){}let o={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new k(E(o),o))}return this._normalizeRunningEvent(new x(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];let t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){let n=(0,c.deepCopy)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||p.throwError("events require a provider or a signer with a provider",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){let n=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{let i=e.getEmit(n);this.emit(e.filter,...i)}catch(o){n.decodeError=o.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=n,null!=e.filter&&this.provider.on(e.filter,n)}}queryFilter(e,t,r){let n=this._getRunningEvent(e),i=(0,c.shallowCopy)(n.filter);return"string"==typeof t&&(0,l.isHexString)(t,32)?(null!=r&&p.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then(e=>e.map(e=>this._wrapEvent(n,e,null)))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;let r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce((e,t)=>e+this._runningEvents[t].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){let t=[];for(let r in this._runningEvents)this._runningEvents[r].listeners().forEach(e=>{t.push(e)});return t}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(let t in this._runningEvents){let r=this._runningEvents[t];r.removeAllListeners(),this._checkRunningEvents(r)}return this}let n=this._getRunningEvent(e);return n.removeAllListeners(),this._checkRunningEvents(n),this}off(e,t){if(!this.provider)return this;let r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class _ extends C{}class O{constructor(e,t,r){let n=null;"0x"!==(n="string"==typeof t?t:(0,l.isBytes)(t)?(0,l.hexlify)(t):t&&"string"==typeof t.object?t.object:"!").substring(0,2)&&(n="0x"+n),(!(0,l.isHexString)(n)||n.length%2)&&p.throwArgumentError("invalid bytecode","bytecode",t),r&&!s.Signer.isSigner(r)&&p.throwArgumentError("invalid signer","signer",r),(0,c.defineReadOnly)(this,"bytecode",n),(0,c.defineReadOnly)(this,"interface",(0,c.getStatic)(new.target,"getInterface")(e)),(0,c.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){for(let r in t=(0,c.shallowCopy)(e.pop()))if(!m[r])throw Error("unknown transaction override "+r)}if(["data","from","to"].forEach(e=>{null!=t[e]&&p.throwError("cannot override "+e,f.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})}),t.value){let n=u.O$.from(t.value);n.isZero()||this.interface.deploy.payable||p.throwError("non-payable constructor cannot override value",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return p.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=(0,l.hexlify)((0,l.concat)([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return d(this,void 0,void 0,function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),p.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");let r=yield y(this.signer,e,this.interface.deploy.inputs);r.push(t);let n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=(0,c.getStatic)(this.constructor,"getContractAddress")(i),s=(0,c.getStatic)(this.constructor,"getContract")(o,this.interface,this.signer);return b(s,i),(0,c.defineReadOnly)(s,"deployTransaction",i),s})}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&p.throwError("missing compiler output",f.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));let r=e.abi,n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return _.getInterface(e)}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getContract(e,t,r){return new _(e,t,r)}}},35644:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="hash/5.7.0"},32046:function(e,t,r){"use strict";r.d(t,{id:function(){return o}});var n=r(38197),i=r(29251);function o(e){return(0,n.keccak256)((0,i.Y0)(e))}},75931:function(e,t,r){"use strict";r.r(t),r.d(t,{_TypedDataEncoder:function(){return s.E},dnsEncode:function(){return i.Kn},ensNormalize:function(){return i.w3},hashMessage:function(){return o.r},id:function(){return n.id},isValidName:function(){return i.r1},messagePrefix:function(){return o.B},namehash:function(){return i.VM}});var n=r(32046),i=r(27586),o=r(93684),s=r(67827)},93684:function(e,t,r){"use strict";r.d(t,{B:function(){return s},r:function(){return a}});var n=r(16441),i=r(38197),o=r(29251);let s="\x19Ethereum Signed Message:\n";function a(e){return"string"==typeof e&&(e=(0,o.Y0)(e)),(0,i.keccak256)((0,n.concat)([(0,o.Y0)(s),(0,o.Y0)(String(e.length)),e]))}},27586:function(e,t,r){"use strict";let n,i;r.d(t,{Kn:function(){return R},w3:function(){return C},r1:function(){return _},VM:function(){return O}});var o,s=r(16441),a=r(29251),u=r(38197),l=r(1581),c=r(35644),h=r(59567);function f(e,t){null==t&&(t=1);let r=[],n=r.forEach,i=function(e,t){n.call(e,function(e){t>0&&Array.isArray(e)?i(e,t-1):r.push(e)})};return i(e,t),r}function d(e,t){let r=Array(e);for(let n=0,i=-1;nt[e]):r}function m(e,t,r){let n=Array(e).fill(void 0).map(()=>[]);for(let i=0;i>1:o>>1}return r})(e,r).forEach((e,t)=>n[t].push(e));return n}let g=(o=function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let s=1;s>--l&1}let f=0;for(let d=0;d<31;d++)f=f<<1|h();let p=[],m=0,g=2147483648;for(;;){let y=Math.floor(((f-m+1)*i-1)/g),v=0,b=n;for(;b-v>1;){let w=v+b>>>1;y{switch(t-k){case 3:return k+65792+(e[u++]<<16|e[u++]<<8|e[u++]);case 2:return k+256+(e[u++]<<8|e[u++]);case 1:return k+e[u++];default:return t-1}})}((0,h.J)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),i=0,()=>o[i++]),y=new Set(p(g)),v=new Set(p(g)),b=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(function(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return f(m(i.length,1+e,t).map((e,t)=>{let o=e[0],s=e.slice(1);return Array(i[t]).fill(void 0).map((e,t)=>{let i=t*n;return[o+t*r,s.map(e=>e+i)]})}))}(r,e))}for(;;){let n=e()-1;if(n<0)break;t.push(m(1+e(),1+n,e).map(e=>[e[0],e.slice(1)]))}return function(e){let t={};for(let r=0;re-t),function e(){let t=[];for(;;){let r=p(g,n);if(0==r.length)break;t.push({set:new Set(r),node:e()})}t.sort((e,t)=>t.set.size-e.set.size);let i=g(),o=i%3,s=!!(1&(i=i/3|0)),a=1==(i>>=1),u=2==i;return{branches:t,valid:o,fe0f:s,save:a,check:u}}());function A(e){return e.filter(e=>65039!=e)}function E(e){for(let t of e.split(".")){var r;let n=(r=t,(0,a.XL)(r));try{for(let i=n.lastIndexOf(95)-1;i>=0;i--)if(95!==n[i])throw Error("underscore only allowed at start");if(n.length>=4&&n.every(e=>e<128)&&45===n[2]&&45===n[3])throw Error("invalid label extension")}catch(o){throw Error(`Invalid label "${t}": ${o.message}`)}}return e}let k=new l.Logger(c.i),S=new Uint8Array(32);function P(e){if(0===e.length)throw Error("invalid ENS name; empty component");return e}function x(e){let t=(0,a.Y0)(E(function(e,t){let r=(0,a.XL)(e).reverse(),n=[];for(;r.length;){let i=function(e,t){var r;let n,i;let o=w,s=[],a=e.length;for(t&&(t.length=0);a;){let u=e[--a];if(!(o=null===(r=o.branches.find(e=>e.set.has(u)))||void 0===r?void 0:r.node))break;if(o.save)i=u;else if(o.check&&u===i)break;s.push(u),o.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),o.valid&&(n=s.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return n}(r);if(i){n.push(...t(i));continue}let o=r.pop();if(y.has(o)){n.push(o);continue}if(v.has(o))continue;let s=b[o];if(s){n.push(...s);continue}throw Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`)}return E(String.fromCodePoint(...n).normalize("NFC"))}(e,A))),r=[];if(0===e.length)return r;let n=0;for(let i=0;i=t.length)throw Error("invalid ENS name; empty component");return r.push(P(t.slice(n))),r}function C(e){return x(e).map(e=>(0,a.ZN)(e)).join(".")}function _(e){try{return 0!==x(e).length}catch(t){}return!1}function O(e){"string"!=typeof e&&k.throwArgumentError("invalid ENS name; not a string","name",e);let t=S,r=x(e);for(;r.length;)t=(0,u.keccak256)((0,s.concat)([t,(0,u.keccak256)(r.pop())]));return(0,s.hexlify)(t)}function R(e){return(0,s.hexlify)((0,s.concat)(x(e).map(e=>{if(e.length>63)throw Error("invalid DNS encoded entry; length exceeds 63 bytes");let t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"}S.fill(0)},67827:function(e,t,r){"use strict";r.d(t,{E:function(){return P}});var n=r(19485),i=r(2593),o=r(16441),s=r(38197),a=r(6881),u=r(1581),l=r(35644),c=r(32046);let h=new u.Logger(l.i),f=new Uint8Array(32);f.fill(0);let d=i.O$.from(-1),p=i.O$.from(0),m=i.O$.from(1),g=i.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),y=(0,o.hexZeroPad)(m.toHexString(),32),v=(0,o.hexZeroPad)(p.toHexString(),32),b={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},w=["name","version","chainId","verifyingContract","salt"];function A(e){return function(t){return"string"!=typeof t&&h.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}let E={name:A("name"),version:A("version"),chainId:function(e){try{return i.O$.from(e).toString()}catch(t){}return h.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,n.getAddress)(e).toLowerCase()}catch(t){}return h.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{let t=(0,o.arrayify)(e);if(32!==t.length)throw Error("bad length");return(0,o.hexlify)(t)}catch(r){}return h.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function k(e){{let t=e.match(/^(u?)int(\d*)$/);if(t){let r=""===t[1],a=parseInt(t[2]||"256");(a%8!=0||a>256||t[2]&&t[2]!==String(a))&&h.throwArgumentError("invalid numeric width","type",e);let u=g.mask(r?a-1:a),l=r?u.add(m).mul(d):p;return function(t){let r=i.O$.from(t);return(r.lt(l)||r.gt(u))&&h.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,o.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{let b=e.match(/^bytes(\d+)$/);if(b){let w=parseInt(b[1]);return(0===w||w>32||b[1]!==String(w))&&h.throwArgumentError("invalid bytes width","type",e),function(t){let r=(0,o.arrayify)(t);return r.length!==w&&h.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){let t=(0,o.arrayify)(e),r=t.length%32;return r?(0,o.hexConcat)([t,f.slice(r)]):(0,o.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,o.hexZeroPad)((0,n.getAddress)(e),32)};case"bool":return function(e){return e?y:v};case"bytes":return function(e){return(0,s.keccak256)(e)};case"string":return function(e){return(0,c.id)(e)}}return null}function S(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}class P{constructor(e){(0,a.defineReadOnly)(this,"types",Object.freeze((0,a.deepCopy)(e))),(0,a.defineReadOnly)(this,"_encoderCache",{}),(0,a.defineReadOnly)(this,"_types",{});let t={},r={},n={};for(let i in Object.keys(e).forEach(e=>{t[e]={},r[e]=[],n[e]={}}),e){let o={};e[i].forEach(n=>{o[n.name]&&h.throwArgumentError(`duplicate variable name ${JSON.stringify(n.name)} in ${JSON.stringify(i)}`,"types",e),o[n.name]=!0;let s=n.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===i&&h.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);let a=k(s);a||(r[s]||h.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(i),t[i][s]=!0)})}let s=Object.keys(r).filter(e=>0===r[e].length);for(let u in 0===s.length?h.throwArgumentError("missing primary type","types",e):s.length>1&&h.throwArgumentError(`ambiguous primary types or unused types: ${s.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),(0,a.defineReadOnly)(this,"primaryType",s[0]),!function i(o,s){s[o]&&h.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),s[o]=!0,Object.keys(t[o]).forEach(e=>{r[e]&&(i(e,s),Object.keys(s).forEach(t=>{n[t][e]=!0}))}),delete s[o]}(this.primaryType,{}),n){let l=Object.keys(n[u]);l.sort(),this._types[u]=S(u,e[u])+l.map(t=>S(t,e[t])).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{let t=k(e);if(t)return t}let r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){let n=r[1],i=this.getEncoder(n),a=parseInt(r[3]);return e=>{a>=0&&e.length!==a&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let t=e.map(i);return this._types[n]&&(t=t.map(s.keccak256)),(0,s.keccak256)((0,o.hexConcat)(t))}}let u=this.types[e];if(u){let l=(0,c.id)(this._types[e]);return e=>{let t=u.map(({name:t,type:r})=>{let n=this.getEncoder(r)(e[t]);return this._types[r]?(0,s.keccak256)(n):n});return t.unshift(l),(0,o.hexConcat)(t)}}return h.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let t=this._types[e];return t||h.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,s.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){{let n=k(e);if(n)return r(e,t)}let i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){let o=i[1],s=parseInt(i[3]);return s>=0&&t.length!==s&&h.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map(e=>this._visit(o,e,r))}let a=this.types[e];return a?a.reduce((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e),{}):h.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new P(e)}static getPrimaryType(e){return P.from(e).primaryType}static hashStruct(e,t,r){return P.from(t).hashStruct(e,r)}static hashDomain(e){let t=[];for(let r in e){let n=b[r];n||h.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort((e,t)=>w.indexOf(e.name)-w.indexOf(t.name)),P.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,o.hexConcat)(["0x1901",P.hashDomain(e),P.from(t).hash(r)])}static hash(e,t,r){return(0,s.keccak256)(P.encode(e,t,r))}static resolveNames(e,t,r,n){var i,s,u,l;return i=this,s=void 0,u=void 0,l=function*(){e=(0,a.shallowCopy)(e);let i={};e.verifyingContract&&!(0,o.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let s=P.from(t);for(let u in s.visit(r,(e,t)=>("address"!==e||(0,o.isHexString)(t,20)||(i[t]="0x"),t)),i)i[u]=yield n(u);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=s.visit(r,(e,t)=>"address"===e&&i[t]?i[t]:t),{domain:e,value:r}},new(u||(u=Promise))(function(e,t){function r(e){try{o(l.next(e))}catch(r){t(r)}}function n(e){try{o(l.throw(e))}catch(r){t(r)}}function o(t){var i;t.done?e(t.value):((i=t.value)instanceof u?i:new u(function(e){e(i)})).then(r,n)}o((l=l.apply(i,s||[])).next())})}static getPayload(e,t,r){P.hashDomain(e);let n={},s=[];w.forEach(t=>{let r=e[t];null!=r&&(n[t]=E[t](r),s.push({name:t,type:b[t]}))});let u=P.from(t),l=(0,a.shallowCopy)(t);return l.EIP712Domain?h.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):l.EIP712Domain=s,u.encode(r),{types:l,domain:n,primaryType:u.primaryType,message:u.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.arrayify)(t));if(e.match(/^u?int/))return i.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&h.throwArgumentError("invalid string","value",t),t}return h.throwArgumentError("unsupported type","type",e)})}}}},84178:function(e,t,r){"use strict";r.r(t),r.d(t,{HDNode:function(){return S},defaultPath:function(){return k},entropyToMnemonic:function(){return C},getAccountPath:function(){return O},isValidMnemonic:function(){return _},mnemonicToEntropy:function(){return x},mnemonicToSeed:function(){return P}});var n=r(57727),i=r(16441),o=r(2593),s=r(29251),a=r(85306),u=r(6881),l=r(67669),c=r(2006),h=r(21261),f=r(83875),d=r(10234),p=r(1581);let m=new p.Logger("hdnode/5.7.0"),g=o.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y=(0,s.Y0)("Bitcoin seed");function v(e){return(1<=256)throw Error("Depth too large!");return w((0,i.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,i.hexlify)(this.depth),this.parentFingerprint,(0,i.hexZeroPad)((0,i.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,i.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new S(E,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));let r=new Uint8Array(37);if(2147483648&e){if(!this.privateKey)throw Error("cannot derive child of neutered node");r.set((0,i.arrayify)(this.privateKey),1),t&&(t+="'")}else r.set((0,i.arrayify)(this.publicKey));for(let n=24;n>=0;n-=8)r[33+(n>>3)]=e>>24-n&255;let s=(0,i.arrayify)((0,c.Gy)(h.p.sha512,this.chainCode,r)),a=s.slice(0,32),u=s.slice(32),f=null,d=null;if(this.privateKey)f=b(o.O$.from(a).add(this.privateKey).mod(g));else{let p=new l.SigningKey((0,i.hexlify)(a));d=p._addPoint(this.publicKey)}let m=t,y=this.mnemonic;return y&&(m=Object.freeze({phrase:y.phrase,path:t,locale:y.locale||"en"})),new S(E,f,d,this.fingerprint,b(u),e,this.depth+1,m)}derivePath(e){let t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let n=0;n=2147483648)throw Error("invalid path index - "+i);r=r._derive(2147483648+o)}else if(i.match(/^[0-9]+$/)){let s=parseInt(i);if(s>=2147483648)throw Error("invalid path index - "+i);r=r._derive(s)}else throw Error("invalid path component - "+i)}return r}static _fromSeed(e,t){let r=(0,i.arrayify)(e);if(r.length<16||r.length>64)throw Error("invalid seed");let n=(0,i.arrayify)((0,c.Gy)(h.p.sha512,y,r));return new S(E,b(n.slice(0,32)),null,"0x00000000",b(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=C(x(e,r=A(r)),r),S._fromSeed(P(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return S._fromSeed(e,null)}static fromExtendedKey(e){let t=n.Base58.decode(e);(82!==t.length||w(t.slice(0,78))!==e)&&m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let r=t[4],o=(0,i.hexlify)(t.slice(5,9)),s=parseInt((0,i.hexlify)(t.slice(9,13)).substring(2),16),a=(0,i.hexlify)(t.slice(13,45)),u=t.slice(45,78);switch((0,i.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new S(E,null,(0,i.hexlify)(u),o,a,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new S(E,(0,i.hexlify)(u.slice(1)),null,o,a,s,r,null)}return m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function P(e,t){t||(t="");let r=(0,s.Y0)("mnemonic"+t,s.Uj.NFKD);return(0,a.n)((0,s.Y0)(e,s.Uj.NFKD),r,2048,64,"sha512")}function x(e,t){t=A(t),m.checkNormalize();let r=t.split(e);if(r.length%3!=0)throw Error("invalid mnemonic");let n=(0,i.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),o=0;for(let s=0;s>3]|=1<<7-o%8),o++}let l=32*r.length/3,h=r.length/3,f=v(h),d=(0,i.arrayify)((0,c.JQ)(n.slice(0,l/8)))[0]&f;if(d!==(n[n.length-1]&f))throw Error("invalid checksum");return(0,i.hexlify)(n.slice(0,l/8))}function C(e,t){if(t=A(t),(e=(0,i.arrayify)(e)).length%4!=0||e.length<16||e.length>32)throw Error("invalid entropy");let r=[0],n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=e[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[o]>>8-n,r.push(e[o]&(1<<8-n)-1),n+=3);let s=e.length/4,a=(0,i.arrayify)((0,c.JQ)(e))[0]&v(s);return r[r.length-1]<<=s,r[r.length-1]|=a>>8-s,t.join(r.map(e=>t.getWord(e)))}function _(e,t){try{return x(e,t),!0}catch(r){}return!1}function O(e){return("number"!=typeof e||e<0||e>=2147483648||e%1)&&m.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}},29816:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="json-wallets/5.7.0"},45659:function(e,t,r){"use strict";r.r(t),r.d(t,{decryptCrowdsale:function(){return g},decryptJsonWallet:function(){return A},decryptJsonWalletSync:function(){return E},decryptKeystore:function(){return w.pe},decryptKeystoreSync:function(){return w.hb},encryptKeystore:function(){return w.HI},getJsonWalletAddress:function(){return b},isCrowdsaleWallet:function(){return y},isKeystoreWallet:function(){return v}});var n=r(78826),i=r.n(n),o=r(19485),s=r(16441),a=r(38197),u=r(85306),l=r(29251),c=r(6881),h=r(1581),f=r(29816),d=r(97013);let p=new h.Logger(f.i);class m extends c.Description{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}}function g(e,t){let r=JSON.parse(e);t=(0,d.Ij)(t);let n=(0,o.getAddress)((0,d.gx)(r,"ethaddr")),c=(0,d.p3)((0,d.gx)(r,"encseed"));c&&c.length%16==0||p.throwArgumentError("invalid encseed","json",e);let h=(0,s.arrayify)((0,u.n)(t,t,2e3,32,"sha256")).slice(0,16),f=c.slice(0,16),g=c.slice(16),y=new(i()).ModeOfOperation.cbc(h,f),v=i().padding.pkcs7.strip((0,s.arrayify)(y.decrypt(g))),b="";for(let w=0;w{t=(0,u.arrayify)(t);let r=t.slice(0,16),n=t.slice(16,32),o=t.slice(32,64),s=new(i()).Counter(P),a=new(i()).ModeOfOperation.ctr(r,s),l=(0,u.arrayify)(a.encrypt(g)),h=(0,c.keccak256)((0,u.concat)([n,l])),d={address:e.address.substring(2).toLowerCase(),id:(0,m.EH)(x),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,u.hexlify)(P).substring(2)},ciphertext:(0,u.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,u.hexlify)(S).substring(2),n:C,dklen:32,p:O,r:_},mac:h.substring(2)}};if(v){let p=(0,f.O)(16),y=new(i()).Counter(p),b=new(i()).ModeOfOperation.ctr(o,y),E=(0,u.arrayify)(b.encrypt(v)),R=new Date,M=R.getUTCFullYear()+"-"+(0,m.VP)(R.getUTCMonth()+1,2)+"-"+(0,m.VP)(R.getUTCDate(),2)+"T"+(0,m.VP)(R.getUTCHours(),2)+"-"+(0,m.VP)(R.getUTCMinutes(),2)+"-"+(0,m.VP)(R.getUTCSeconds(),2)+".0Z";d["x-ethers"]={client:k,gethFilename:"UTC--"+M+"--"+d.address,mnemonicCounter:(0,u.hexlify)(p).substring(2),mnemonicCiphertext:(0,u.hexlify)(E).substring(2),path:w,locale:A,version:"0.1"}}return JSON.stringify(d)})}},97013:function(e,t,r){"use strict";r.d(t,{EH:function(){return l},Ij:function(){return a},VP:function(){return s},gx:function(){return u},p3:function(){return o}});var n=r(16441),i=r(29251);function o(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,n.arrayify)(e)}function s(e,t){for(e=String(e);e.length{try{if("test"!=="test".normalize(t))throw Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(t){return t.message}return null}();(o=n||(n={})).DEBUG="DEBUG",o.INFO="INFO",o.WARNING="WARNING",o.ERROR="ERROR",o.OFF="OFF",(s=i||(i={})).UNKNOWN_ERROR="UNKNOWN_ERROR",s.NOT_IMPLEMENTED="NOT_IMPLEMENTED",s.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",s.NETWORK_ERROR="NETWORK_ERROR",s.SERVER_ERROR="SERVER_ERROR",s.TIMEOUT="TIMEOUT",s.BUFFER_OVERRUN="BUFFER_OVERRUN",s.NUMERIC_FAULT="NUMERIC_FAULT",s.MISSING_NEW="MISSING_NEW",s.INVALID_ARGUMENT="INVALID_ARGUMENT",s.MISSING_ARGUMENT="MISSING_ARGUMENT",s.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",s.CALL_EXCEPTION="CALL_EXCEPTION",s.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",s.NONCE_EXPIRED="NONCE_EXPIRED",s.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",s.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",s.TRANSACTION_REPLACED="TRANSACTION_REPLACED",s.ACTION_REJECTED="ACTION_REJECTED";let d="0123456789abcdef";class p{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let r=e.toLowerCase();null==l[r]&&this.throwArgumentError("invalid log level name","logLevel",e),c>l[r]||console.log.apply(console,t)}debug(...e){this._log(p.levels.DEBUG,e)}info(...e){this._log(p.levels.INFO,e)}warn(...e){this._log(p.levels.WARNING,e)}makeError(e,t,r){if(u)return this.makeError("censored error",t,{});t||(t=p.errors.UNKNOWN_ERROR),r||(r={});let n=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let i="";for(let o=0;o>4]+d[15&t[o]];n.push(e+"=Uint8Array(0x"+i+")")}else n.push(e+"="+JSON.stringify(t))}catch(s){n.push(e+"="+JSON.stringify(r[e].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);let o=e,s="";switch(t){case i.NUMERIC_FAULT:{s="NUMERIC_FAULT";let a=e;switch(a){case"overflow":case"underflow":case"division-by-zero":s+="-"+a;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case i.CALL_EXCEPTION:case i.INSUFFICIENT_FUNDS:case i.MISSING_NEW:case i.NONCE_EXPIRED:case i.REPLACEMENT_UNDERPRICED:case i.TRANSACTION_REPLACED:case i.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(e+=" ("+n.join(", ")+")");let l=Error(e);return l.reason=o,l.code=t,Object.keys(r).forEach(function(e){l[e]=r[e]}),l}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,p.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),f&&this.throwError("platform missing String.prototype.normalize",p.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,p.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||null==e)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",p.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||null==e)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return h||(h=new p("logger/5.7.0")),h}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a){if(!e)return;this.globalLogger().throwError("error censorship permanent",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!e,a=!!t}static setLogLevel(e){let t=l[e.toLowerCase()];if(null==t){p.globalLogger().warn("invalid log level - "+e);return}c=t}static from(e){return new p(e)}}p.errors=i,p.levels=n},45710:function(e,t,r){"use strict";r.d(t,{H:function(){return h}});var n=r(1581);let i=new n.Logger("networks/5.7.1");function o(e){let t=function(t,r){null==r&&(r={});let n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(i){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(o){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(s){}if(t.PocketProvider&&"-"!==r.pocket)try{let a=new t.PocketProvider(e,r.pocket);a.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(a.network.name)&&n.push(a)}catch(u){}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(l){}if(t.AnkrProvider&&"-"!==r.ankr)try{let c=new t.AnkrProvider(e,r.ankr);c.network&&-1===["ropsten"].indexOf(c.network.name)&&n.push(c)}catch(h){}if(0===n.length)return null;if(t.FallbackProvider){let f=1;return null!=r.quorum?f=r.quorum:"homestead"===e&&(f=2),new t.FallbackProvider(n,f)}return n[0]};return t.renetwork=function(e){return o(e)},t}function s(e,t){let r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return s(e,t)},r}let a={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:o("homestead")},u={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:o("ropsten")},l={chainId:63,name:"classicMordor",_defaultProvider:s("https://www.ethercluster.com/mordor","classicMordor")},c={unspecified:{chainId:0,name:"unspecified"},homestead:a,mainnet:a,morden:{chainId:2,name:"morden"},ropsten:u,testnet:u,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:o("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:o("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:o("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:o("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:s("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:l,classicTestnet:l,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:s("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:o("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:o("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function h(e){if(null==e)return null;if("number"==typeof e){for(let t in c){let r=c[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){let n=c[e];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}let o=c[e.name];if(!o)return"number"!=typeof e.chainId&&i.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==o.chainId&&i.throwArgumentError("network chainId mismatch","network",e);let s=e._defaultProvider||null;if(null==s&&o._defaultProvider){var a;s=(a=o._defaultProvider)&&"function"==typeof a.renetwork?o._defaultProvider.renetwork(e):o._defaultProvider}return{name:e.name,chainId:o.chainId,ensAddress:e.ensAddress||o.ensAddress||null,_defaultProvider:s}}},85306:function(e,t,r){"use strict";r.d(t,{n:function(){return o}});var n=r(16441),i=r(2006);function o(e,t,r,o,s){let a,u,l;e=(0,n.arrayify)(e),t=(0,n.arrayify)(t);let c=1,h=new Uint8Array(o),f=new Uint8Array(t.length+4);f.set(t);for(let d=1;d<=c;d++){f[t.length]=d>>24&255,f[t.length+1]=d>>16&255,f[t.length+2]=d>>8&255,f[t.length+3]=255&d;let p=(0,n.arrayify)((0,i.Gy)(s,e,f));a||(a=p.length,l=new Uint8Array(a),c=Math.ceil(o/a),u=o-(c-1)*a),l.set(p);for(let m=1;m{let r=e[t];return Promise.resolve(r).then(e=>({key:t,value:e}))}),r=yield Promise.all(t);return r.reduce((e,t)=>(e[t.key]=t.value,e),{})},new(n||(n=Promise))(function(e,o){function s(e){try{u(i.next(e))}catch(t){o(t)}}function a(e){try{u(i.throw(e))}catch(t){o(t)}}function u(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(s,a)}u((i=i.apply(t,r||[])).next())})}function u(e,t){e&&"object"==typeof e||i.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||i.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}function l(e){let t={};for(let r in e)t[r]=e[r];return t}let c={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function h(e){return function(e){if(function e(t){if(null==t||c[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;let r=Object.keys(t);for(let n=0;nh(e)));if("object"==typeof e){let t={};for(let r in e){let n=e[r];void 0!==n&&o(t,r,h(n))}return t}return i.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}(e)}class f{constructor(e){for(let t in e)this[t]=h(e[t])}}},34216:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="providers/5.7.2"},75361:function(e,t,r){"use strict";r.d(t,{H2:function(){return U},Zk:function(){return G}});var n=r(81556),i=r(59567),o=r(57727),s=r(2593),a=r(16441),u=r(57218),l=r(27586),c=r(45710),h=r(6881),f=r(2006),d=r(29251),p=r(37707),m=r(92882),g=r.n(m),y=r(1581),v=r(34216),b=r(30032),w=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let A=new y.Logger(v.i);function E(e){return null==e?"null":(32!==(0,a.hexDataLength)(e)&&A.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function k(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map(e=>{if(!Array.isArray(e))return E(e);{let t={};e.forEach(e=>{t[E(e)]=!0});let r=Object.keys(t);return r.sort(),r.join("|")}}).join("&")}function S(e){if("string"==typeof e){if(e=e.toLowerCase(),32===(0,a.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else if(Array.isArray(e))return"filter:*:"+k(e);else if(n.Sg.isForkEvent(e))throw A.warn("not implemented"),Error("not implemented");else if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+k(e.topics||[]);throw Error("invalid event - "+e)}function P(){return new Date().getTime()}function x(e){return new Promise(t=>{setTimeout(t,e)})}let C=["block","network","pending","poll"];class _{constructor(e,t,r){(0,h.defineReadOnly)(this,"tag",e),(0,h.defineReadOnly)(this,"listener",t),(0,h.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){let e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){var e;let t=this.tag.split(":");if("filter"!==t[0])return null;let r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map(e=>{if(""===e)return[];let t=e.split("|").map(e=>"null"===e?null:e);return 1===t.length?t[0]:t}),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||C.indexOf(this.tag)>=0}}let O={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function R(e){return(0,a.hexZeroPad)(s.O$.from(e).toHexString(),32)}function M(e){return o.Base58.encode((0,a.concat)([e,(0,a.hexDataSlice)((0,f.JQ)((0,f.JQ)(e)),0,4)]))}let N=RegExp("^(ipfs)://(.*)$","i"),I=[RegExp("^(https)://(.*)$","i"),RegExp("^(data):(.*)$","i"),N,RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function T(e,t){try{return(0,d.ZN)(B(e,t))}catch(r){}return null}function B(e,t){if("0x"===e)return null;let r=s.O$.from((0,a.hexDataSlice)(e,t,t+32)).toNumber(),n=s.O$.from((0,a.hexDataSlice)(e,r,r+32)).toNumber();return(0,a.hexDataSlice)(e,r+32,r+32+n)}function L(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):A.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function F(e){let t=(0,a.arrayify)(e);if(t.length>32)throw Error("internal; should not happen");let r=new Uint8Array(32);return r.set(t,32-t.length),r}function D(e){let t=[],r=0;for(let n=0;ns.O$.from(e).eq(1)).catch(e=>{if(e.code===y.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,t){return w(this,void 0,void 0,function*(){let r={to:this.address,ccipReadEnabled:!0,data:(0,a.hexConcat)([e,(0,l.VM)(this.name),t||"0x"])},n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,a.hexConcat)(["0x9061b923",D([(0,l.Kn)(this.name),r.data])]));try{let i=yield this.provider.call(r);return(0,a.arrayify)(i).length%32==4&&A.throwError("resolver threw error",y.Logger.errors.CALL_EXCEPTION,{transaction:r,data:i}),n&&(i=B(i,0)),i}catch(o){if(o.code===y.Logger.errors.CALL_EXCEPTION)return null;throw o}})}_fetchBytes(e,t){return w(this,void 0,void 0,function*(){let r=yield this._fetch(e,t);return null!=r?B(r,0):null})}_getAddress(e,t){let r=O[String(e)];if(null==r&&A.throwError(`unsupported coin type: ${e}`,y.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);let n=(0,a.arrayify)(t);if(null!=r.p2pkh){let i=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){let o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return M((0,a.concat)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){let s=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){let u=parseInt(s[1],16);if(s[2].length===2*u&&u>=1&&u<=75)return M((0,a.concat)([[r.p2sh],"0x"+s[2]]))}}if(null!=r.prefix){let l=n[1],c=n[0];if(0===c?20!==l&&32!==l&&(c=-1):c=-1,c>=0&&n.length===2+l&&l>=1&&l<=75){let h=g().toWords(n.slice(2));return h.unshift(c),g().encode(r.prefix,h)}}return null}getAddress(e){return w(this,void 0,void 0,function*(){if(null==e&&(e=60),60===e)try{let t=yield this._fetch("0x3b3b57de");if("0x"===t||t===u.R)return null;return this.provider.formatter.callAddress(t)}catch(r){if(r.code===y.Logger.errors.CALL_EXCEPTION)return null;throw r}let n=yield this._fetchBytes("0xf1cb7e06",R(e));if(null==n||"0x"===n)return null;let i=this._getAddress(e,n);return null==i&&A.throwError("invalid or unsupported coin data",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:n}),i})}getAvatar(){return w(this,void 0,void 0,function*(){let e=[{type:"name",content:this.name}];try{let t=yield this.getText("avatar");if(null==t)return null;for(let r=0;rl[e]);return"sia://"+c}return A.throwError("invalid or unsupported content hash data",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return w(this,void 0,void 0,function*(){let t=(0,d.Y0)(e);(t=(0,a.concat)([R(64),R(t.length),t])).length%32!=0&&(t=(0,a.concat)([t,(0,a.hexZeroPad)("0x",32-e.length%32)]));let r=yield this._fetchBytes("0x59d1d43c",(0,a.hexlify)(t));return null==r||"0x"===r?null:(0,d.ZN)(r)})}}let j=null,q=1;class G extends n.zt{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,h.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(e=>{}),this._ready().catch(e=>{});else{let t=(0,h.getStatic)(new.target,"getNetwork")(e);t?((0,h.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):A.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return w(this,void 0,void 0,function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(t){}null==e&&(e=yield this.detectNetwork()),e||A.throwError("no network detected",y.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:(0,h.defineReadOnly)(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return(0,p.poll)(()=>this._ready().then(e=>e,e=>{if(e.code!==y.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}static getFormatter(){return null==j&&(j=new b.Mb),j}static getNetwork(e){return(0,c.H)(null==e?"homestead":e)}ccipReadFetch(e,t,r){return w(this,void 0,void 0,function*(){if(this.disableCcipRead||0===r.length)return null;let n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let s=0;s=0?null:JSON.stringify({data:i,sender:n}),c=yield(0,p.fetchJson)({url:u,errorPassThrough:!0},l,(e,t)=>(e.status=t.statusCode,e));if(c.data)return c.data;let h=c.message||"unknown error";if(c.status>=400&&c.status<500)return A.throwError(`response not found during CCIP fetch: ${h}`,y.Logger.errors.SERVER_ERROR,{url:a,errorMessage:h});o.push(h)}return A.throwError(`error encountered during CCIP fetch: ${o.map(e=>JSON.stringify(e)).join(", ")}`,y.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:o})})}_getInternalBlockNumber(e){return w(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){let t=this._internalBlockNumber;try{let r=yield t;if(P()-r.respTime<=e)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===t)break}}let i=P(),o=(0,h.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(e=>null,e=>e)}).then(({blockNumber:e,networkError:t})=>{if(t)throw this._internalBlockNumber===o&&(this._internalBlockNumber=null),t;let r=P();return(e=s.O$.from(e).toNumber()){this._internalBlockNumber===o&&(this._internalBlockNumber=null)}),(yield o).blockNumber})}poll(){return w(this,void 0,void 0,function*(){let e=q++,t=[],r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){this.emit("error",n);return}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r===this._lastBlockNumber){this.emit("didPoll",e);return}if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)A.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",A.makeError("network block skew detected",y.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let i=this._emitted.block+1;i<=r;i++)this.emit("block",i);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(e=>{if("block"===e)return;let t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]})),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach(e=>{switch(e.type){case"tx":{let n=e.hash,i=this.getTransactionReceipt(n).then(e=>(e&&null!=e.blockNumber&&(this._emitted["t:"+n]=e.blockNumber,this.emit(n,e)),null)).catch(e=>{this.emit("error",e)});t.push(i);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);let o=e.filter;o.fromBlock=e._lastBlockNumber+1,o.toBlock=r;let s=o.toBlock-this._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);let a=this.getLogs(o).then(t=>{e._inflight=!1,0!==t.length&&t.forEach(t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(o,t)})}).catch(t=>{this.emit("error",t),e._inflight=!1});t.push(a)}}}),this._lastBlockNumber=r,Promise.all(t).then(()=>{this.emit("didPoll",e)}).catch(e=>{this.emit("error",e)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return w(this,void 0,void 0,function*(){return A.throwError("provider does not support network detection",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return w(this,void 0,void 0,function*(){let e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield x(0),this._network;let r=A.makeError("underlying network changed",y.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let e=P();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){(null==this._fastBlockNumber||!(ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return w(this,void 0,void 0,function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)})}_waitForTransaction(e,t,r,n){return w(this,void 0,void 0,function*(){let i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise((i,o)=>{let s=[],a=!1,u=function(){return!!a||(a=!0,s.forEach(e=>{e()}),!1)},l=e=>{e.confirmations{this.removeListener(e,l)}),n){let c=n.startBlock,h=null,f=r=>w(this,void 0,void 0,function*(){a||(yield x(1e3),this.getTransactionCount(n.from).then(i=>w(this,void 0,void 0,function*(){if(!a){if(i<=n.nonce)c=r;else{{let s=yield this.getTransaction(e);if(s&&null!=s.blockNumber)return}for(null==h&&(h=c-3){a||this.once("block",f)}))});if(a)return;this.once("block",f),s.push(()=>{this.removeListener("block",f)})}if("number"==typeof r&&r>0){let d=setTimeout(()=>{u()||o(A.makeError("timeout exceeded",y.Logger.errors.TIMEOUT,{timeout:r}))},r);d.unref&&d.unref(),s.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return w(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return w(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield this.perform("getGasPrice",{});try{return s.O$.from(e)}catch(t){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}})}getBalance(e,t){return w(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,h.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return s.O$.from(n)}catch(i){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:i})}})}getTransactionCount(e,t){return w(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,h.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return s.O$.from(n).toNumber()}catch(i){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:i})}})}getCode(e,t){return w(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,h.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,a.hexlify)(n)}catch(i){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:i})}})}getStorageAt(e,t,r){return w(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield(0,h.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then(e=>(0,a.hexValue)(e))}),i=yield this.perform("getStorageAt",n);try{return(0,a.hexlify)(i)}catch(o){return A.throwError("bad result from backend",y.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:o})}})}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,a.hexDataLength)(t))throw Error("invalid response - sendTransaction");let n=e;return null!=t&&e.hash!==t&&A.throwError("Transaction hash mismatch from Provider.sendTransaction.",y.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>w(this,void 0,void 0,function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});let o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&A.throwError("transaction failed",y.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)}),n}sendTransaction(e){return w(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield Promise.resolve(e).then(e=>(0,a.hexlify)(e)),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let i=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,i,n)}catch(o){throw o.transaction=r,o.transactionHash=r.hash,o}})}_getTransactionRequest(e){return w(this,void 0,void 0,function*(){let t=yield e,r={};return["from","to"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?this._getAddress(e):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?s.O$.from(e):null))}),["type"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>null!=e?e:null))}),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?(0,a.hexlify)(e):null))}),this.formatter.transactionRequest((yield(0,h.resolveProperties)(r)))})}_getFilter(e){return w(this,void 0,void 0,function*(){e=yield e;let t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(r=>{null!=e[r]&&(t[r]=e[r])}),["fromBlock","toBlock"].forEach(r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))}),this.formatter.filter((yield(0,h.resolveProperties)(t)))})}_call(e,t,r){return w(this,void 0,void 0,function*(){r>=10&&A.throwError("CCIP read exceeded maximum redirections",y.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e});let n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&(0,a.hexDataLength)(i)%32==4)try{let o=(0,a.hexDataSlice)(i,4),u=(0,a.hexDataSlice)(o,0,32);s.O$.from(u).eq(n)||A.throwError("CCIP Read sender did not match",y.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});let l=[],c=s.O$.from((0,a.hexDataSlice)(o,32,64)).toNumber(),h=s.O$.from((0,a.hexDataSlice)(o,c,c+32)).toNumber(),f=(0,a.hexDataSlice)(o,c+32);for(let d=0;dw(this,void 0,void 0,function*(){let e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let i=null;for(let o=0;othis._wrapTransaction(e)),u}return this.formatter.block(e)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return w(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return(0,p.poll)(()=>w(this,void 0,void 0,function*(){let r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;let n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let i=yield this._getInternalBlockNumber(100+2*this.pollingInterval),o=i-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(e){return w(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return(0,p.poll)(()=>w(this,void 0,void 0,function*(){let r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;let n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let i=yield this._getInternalBlockNumber(100+2*this.pollingInterval),o=i-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return n}),{oncePoll:this})})}getLogs(e){return w(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield(0,h.resolveProperties)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach(e=>{null==e.removed&&(e.removed=!1)}),b.Mb.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return w(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return w(this,void 0,void 0,function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&A.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return(t+=e)<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)})}getResolver(e){return w(this,void 0,void 0,function*(){let t=e;for(;;){if(""===t||"."===t||"eth"!==e&&"eth"===t)return null;let r=yield this._getResolver(t,"getResolver");if(null!=r){let n=new U(this,r,e);if(t!==e&&!(yield n.supportsWildcard()))return null;return n}t=t.split(".").slice(1).join(".")}})}_getResolver(e,t){return w(this,void 0,void 0,function*(){null==t&&(t="ENS");let r=yield this.getNetwork();r.ensAddress||A.throwError("network does not support ENS",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{let n=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,l.VM)(e).substring(2)});return this.formatter.callAddress(n)}catch(i){}return null})}resolveName(e){return w(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if((0,a.isHexString)(e))throw t}"string"!=typeof e&&A.throwArgumentError("invalid ENS name","name",e);let r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return w(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);let t=e.substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;let n=T((yield this.call({to:r,data:"0x691f3431"+(0,l.VM)(t).substring(2)})),0),i=yield this.resolveName(n);return i!=e?null:n})}getAvatar(e){return w(this,void 0,void 0,function*(){let t=null;if((0,a.isHexString)(e)){let r=this.formatter.address(e),n=r.substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(n,"getAvatar");if(!i)return null;t=new U(this,i,n);try{let o=yield t.getAvatar();if(o)return o.url}catch(s){if(s.code!==y.Logger.errors.CALL_EXCEPTION)throw s}try{let u=T((yield this.call({to:i,data:"0x691f3431"+(0,l.VM)(n).substring(2)})),0);t=yield this.getResolver(u)}catch(c){if(c.code!==y.Logger.errors.CALL_EXCEPTION)throw c;return null}}else if(!(t=yield this.getResolver(e)))return null;let h=yield t.getAvatar();return null==h?null:h.url})}perform(e,t){return A.throwError(e+" not implemented",y.Logger.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(e,t,r){let n=new _(S(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=S(e);return this._events=this._events.filter(e=>e.tag!==i||(setTimeout(()=>{e.listener.apply(this,t)},0),r=!0,!e.once||(n.push(e),!1))),n.forEach(e=>{this._stopEvent(e)}),r}listenerCount(e){if(!e)return this._events.length;let t=S(e);return this._events.filter(e=>e.tag===t).length}listeners(e){if(null==e)return this._events.map(e=>e.listener);let t=S(e);return this._events.filter(e=>e.tag===t).map(e=>e.listener)}off(e,t){if(null==t)return this.removeAllListeners(e);let r=[],n=!1,i=S(e);return this._events=this._events.filter(e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1)),r.forEach(e=>{this._stopEvent(e)}),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{let r=S(e);this._events=this._events.filter(e=>e.tag!==r||(t.push(e),!1))}return t.forEach(e=>{this._stopEvent(e)}),this}}},51619:function(e,t,r){"use strict";r.d(t,{H:function(){return P}});var n=r(81556),i=r(2593),o=r(16441),s=r(6881),a=r(52472),u=r(37707),l=r(75361),c=r(30032),h=r(1581),f=r(34216),d=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let p=new h.Logger(f.i);function m(){return new Date().getTime()}function g(e){let t=null;for(let r=0;rt?null:(n+i)/2}function v(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(i.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map(e=>v(e)));if("object"==typeof e){let t=Object.keys(e);return t.sort(),"{"+t.map(t=>{let r=e[t];return r="function"==typeof r?"[function]":v(r),JSON.stringify(t)+":"+r}).join(",")+"}"}throw Error("unknown value type: "+typeof e)}let b=1;function w(e){let t=null,r=null,n=new Promise(n=>{r=setTimeout(t=function(){r&&(clearTimeout(r),r=null),n()},e)}),i=e=>n=n.then(e);return{cancel:t,getPromise:function(){return n},wait:i}}let A=[h.Logger.errors.CALL_EXCEPTION,h.Logger.errors.INSUFFICIENT_FUNDS,h.Logger.errors.NONCE_EXPIRED,h.Logger.errors.REPLACEMENT_UNDERPRICED,h.Logger.errors.UNPREDICTABLE_GAS_LIMIT],E=["address","args","errorArgs","errorSignature","method","transaction"];function k(e,t){let r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function S(e,t){return d(this,void 0,void 0,function*(){let r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:(0,u.poll)(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}class P extends l.Zk{constructor(e,t){0===e.length&&p.throwArgumentError("missing providers","providers",e);let r=e.map((e,t)=>{if(n.zt.isProvider(e)){let r=(0,c.Gp)(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}let i=(0,s.shallowCopy)(e);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=(0,c.Gp)(e)?2e3:750),null==i.weight&&(i.weight=1);let o=i.weight;return(o%1||o>512||o<1)&&p.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,o),Object.freeze(i)}),i=r.reduce((e,t)=>e+t.weight,0);null==t?t=i/2:t>i&&p.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let o=g(r.map(e=>e.provider.network));null==o&&(o=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(e,t)},0)})),super(o),(0,s.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,s.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return d(this,void 0,void 0,function*(){let e=yield Promise.all(this.providerConfigs.map(e=>e.provider.getNetwork()));return g(e)})}perform(e,t){return d(this,void 0,void 0,function*(){if("sendTransaction"===e){let r=yield Promise.all(this.providerConfigs.map(e=>e.provider.sendTransaction(t.signedTransaction).then(e=>e.hash,e=>e)));for(let n=0;ne.result),n=y(t.map(e=>e.result),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){let t=e.map(e=>e.result);return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return y(e.map(e=>e.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":o=function(e){return null==e?null:((e=(0,s.shallowCopy)(e)).confirmations=-1,v(e))};break;case"getBlock":o=r.includeTransactions?function(e){return null==e?null:((e=(0,s.shallowCopy)(e)).transactions=e.transactions.map(e=>((e=(0,s.shallowCopy)(e)).confirmations=-1,e)),v(e))}:function(e){return null==e?null:v(e)};break;default:throw Error("unknown method: "+t)}return n=o,i=e.quorum,function(e){let t={};e.forEach(e=>{let r=n(e.result);t[r]||(t[r]={count:0,result:e.result}),t[r].count++});let r=Object.keys(t);for(let o=0;o=i)return s.result}}}(this,e,t),l=(0,a.y)(this.providerConfigs.map(s.shallowCopy));l.sort((e,t)=>e.priority-t.priority);let c=this._highestBlockNumber,f=0,g=!0;for(;;){let P=m(),x=l.filter(e=>e.runner&&P-e.starte+t.weight,0);for(;x{C.staller=null}),C.runner=(function(e,t,r,n){return d(this,void 0,void 0,function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,o.isHexString)(n.blockTag)&&(i=yield S(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,o.isHexString)(n.blockTag)&&(i=yield S(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,o.isHexString)(n.blockTag)&&(i=yield S(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":if(n.blockTag&&(0,o.isHexString)(n.blockTag)&&(i=yield S(e,t)),"call"===r&&n.blockTag)return i[r](n.transaction,n.blockTag);return i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&(0,o.isHexString)(s.fromBlock)||s.toBlock&&(0,o.isHexString)(s.toBlock))&&(i=yield S(e,t)),i.getLogs(s)}}return p.throwError("unknown method error",h.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})})})(C,c,e,t).then(r=>{C.done=!0,C.result=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:_,backend:k(C,m()),request:{method:e,params:(0,s.deepCopy)(t)},provider:this})},r=>{C.done=!0,C.error=r,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:_,backend:k(C,m()),request:{method:e,params:(0,s.deepCopy)(t)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:_,backend:k(C,null),request:{method:e,params:(0,s.deepCopy)(t)},provider:this}),x+=C.weight}let O=[];l.forEach(e=>{!e.done&&e.runner&&(O.push(e.runner),e.staller&&O.push(e.staller.getPromise()))}),O.length&&(yield Promise.race(O));let R=l.filter(e=>e.done&&null==e.error);if(R.length>=this.quorum){let M=u(R);if(void 0!==M)return l.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}),M;g||(yield w(100).getPromise()),g=!1}let N=l.reduce((e,t)=>{if(!t.done||null==t.error)return e;let r=t.error.code;return A.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e},{});if(Object.keys(N).forEach(e=>{let t=N[e];if(t.weight{e.staller&&e.staller.cancel(),e.cancelled=!0});let r=t.error,n={};E.forEach(e=>{null!=r[e]&&(n[e]=r[e])}),p.throwError(r.reason||r.message,e,n)}),0===l.filter(e=>!e.done).length)break}return l.forEach(e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}),p.throwError("failed to meet quorum",h.Logger.errors.SERVER_ERROR,{method:e,params:t,results:l.map(e=>k(e)),provider:this})})}}},30032:function(e,t,r){"use strict";r.d(t,{Ed:function(){return d},Gp:function(){return p},Mb:function(){return f},vh:function(){return g}});var n=r(19485),i=r(2593),o=r(16441),s=r(9279),a=r(6881),u=r(83875),l=r(1581),c=r(34216);let h=new l.Logger(c.i);class f{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),u=this.number.bind(this),l=this.type.bind(this),c=e=>this.data(e,!0);return e.transaction={hash:o,type:l,accessList:f.allowNull(this.accessList.bind(this),null),blockHash:f.allowNull(o,null),blockNumber:f.allowNull(u,null),transactionIndex:f.allowNull(u,null),confirmations:f.allowNull(u,null),from:t,gasPrice:f.allowNull(r),maxPriorityFeePerGas:f.allowNull(r),maxFeePerGas:f.allowNull(r),gasLimit:r,to:f.allowNull(t,null),value:r,nonce:u,data:i,r:f.allowNull(this.uint256),s:f.allowNull(this.uint256),v:f.allowNull(u),creates:f.allowNull(t,null),raw:f.allowNull(i)},e.transactionRequest={from:f.allowNull(t),nonce:f.allowNull(u),gasLimit:f.allowNull(r),gasPrice:f.allowNull(r),maxPriorityFeePerGas:f.allowNull(r),maxFeePerGas:f.allowNull(r),to:f.allowNull(t),value:f.allowNull(r),data:f.allowNull(c),type:f.allowNull(u),accessList:f.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:u,blockNumber:u,transactionHash:o,address:t,topics:f.arrayOf(o),data:i,logIndex:u,blockHash:o},e.receipt={to:f.allowNull(this.address,null),from:f.allowNull(this.address,null),contractAddress:f.allowNull(t,null),transactionIndex:u,root:f.allowNull(s),gasUsed:r,logsBloom:f.allowNull(i),blockHash:o,transactionHash:o,logs:f.arrayOf(this.receiptLog.bind(this)),blockNumber:u,confirmations:f.allowNull(u,null),cumulativeGasUsed:r,effectiveGasPrice:f.allowNull(r),status:f.allowNull(u),type:l},e.block={hash:f.allowNull(o),parentHash:o,number:u,timestamp:u,nonce:f.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:f.allowNull(t),extraData:i,transactions:f.allowNull(f.arrayOf(o)),baseFeePerGas:f.allowNull(r)},e.blockWithTransactions=(0,a.shallowCopy)(e.block),e.blockWithTransactions.transactions=f.allowNull(f.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:f.allowNull(n,void 0),toBlock:f.allowNull(n,void 0),blockHash:f.allowNull(o,void 0),address:f.allowNull(t,void 0),topics:f.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:f.allowNull(u),blockHash:f.allowNull(o),transactionIndex:u,removed:f.allowNull(this.boolean.bind(this)),address:t,data:f.allowFalsish(i,"0x"),topics:f.arrayOf(o),transactionHash:o,logIndex:u},e}accessList(e){return(0,u.accessListify)(e||[])}number(e){return"0x"===e?0:i.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:i.O$.from(e).toNumber()}bigNumber(e){return i.O$.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,o.isHexString)(e))?e.toLowerCase():h.throwArgumentError("invalid hash","value",e)}data(e,t){let r=this.hex(e,t);if(r.length%2!=0)throw Error("invalid data; odd-length - "+e);return r}address(e){return(0,n.getAddress)(e)}callAddress(e){if(!(0,o.isHexString)(e,32))return null;let t=(0,n.getAddress)((0,o.hexDataSlice)(e,12));return t===s.d?null:t}contractAddress(e){return(0,n.getContractAddress)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||(0,o.isHexString)(e))return(0,o.hexValue)(e);throw Error("invalid blockTag")}hash(e,t){let r=this.hex(e,t);return 32!==(0,o.hexDataLength)(r)?h.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;let t=i.O$.from(e);try{return t.toNumber()}catch(r){}return null}uint256(e){if(!(0,o.isHexString)(e))throw Error("invalid uint256");return(0,o.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);let r=null!=e._difficulty?e._difficulty:e.difficulty,n=f.check(t,e);return n._difficulty=null==r?null:i.O$.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return f.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&i.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),(1===e.type||2===e.type)&&null==e.accessList&&(e.accessList=[]);let t=f.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),t.chainId=r}else{let n=e.networkId;null==n&&null==t.v&&(n=e.chainId),(0,o.isHexString)(n)&&(n=i.O$.from(n).toNumber()),"number"!=typeof n&&null!=t.v&&((n=(t.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),t.chainId=n}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,u.parse)(e)}receiptLog(e){return f.check(this.formats.receiptLog,e)}receipt(e){let t=f.check(this.formats.receipt,e);if(null!=t.root){if(t.root.length<=4){let r=i.O$.from(t.root).toNumber();0===r||1===r?(null!=t.status&&t.status!==r&&h.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=r,delete t.root):h.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&h.throwArgumentError("invalid root hash","value.root",t.root)}return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map(e=>this.topics(e)):null!=e?this.hash(e,!0):null}filter(e){return f.check(this.formats.filter,e)}filterLog(e){return f.check(this.formats.filterLog,e)}static check(e,t){let r={};for(let n in e)try{let i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(o){throw o.checkKey=n,o.checkValue=t[n],o}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw Error("not an array");let r=[];return t.forEach(function(t){r.push(e(t))}),r}}}function d(e){return e&&"function"==typeof e.isCommunityResource}function p(e){return d(e)&&e.isCommunityResource()}let m=!1;function g(){m||(m=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}},5432:function(e,t,r){"use strict";r.r(t),r.d(t,{AlchemyProvider:function(){return k},AlchemyWebSocketProvider:function(){return E},AnkrProvider:function(){return x},BaseProvider:function(){return o.Zk},CloudflareProvider:function(){return _},EtherscanProvider:function(){return U},FallbackProvider:function(){return j.H},Formatter:function(){return a.Mb},InfuraProvider:function(){return z},InfuraWebSocketProvider:function(){return H},IpcProvider:function(){return q},JsonRpcBatchProvider:function(){return Q},JsonRpcProvider:function(){return l.r},JsonRpcSigner:function(){return l.C},NodesmithProvider:function(){return J},PocketProvider:function(){return Z},Provider:function(){return n.zt},Resolver:function(){return o.H2},StaticJsonRpcProvider:function(){return b.c},UrlJsonRpcProvider:function(){return b.l},Web3Provider:function(){return $.Q},WebSocketProvider:function(){return v},getDefaultProvider:function(){return ee},getNetwork:function(){return i.H},isCommunityResourcable:function(){return a.Ed},isCommunityResource:function(){return a.Gp},showThrottleMessage:function(){return a.vh}});var n=r(81556),i=r(45710),o=r(75361),s=r(6881),a=r(30032),u=r(2593),l=r(82169),c=r(1581),h=r(34216);let f=null;try{if(f=WebSocket,null==f)throw Error("inject please")}catch(p){let d=new c.Logger(h.i);f=function(){d.throwError("WebSockets not supported in this environment",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var m=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let g=new c.Logger(h.i),y=1;class v extends l.r{constructor(e,t){"any"===t&&g.throwError("WebSocketProvider does not support 'any' network yet",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),"string"==typeof e?super(e,t):super("_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof e?(0,s.defineReadOnly)(this,"_websocket",new f(this.connection.url)):(0,s.defineReadOnly)(this,"_websocket",e),(0,s.defineReadOnly)(this,"_requests",{}),(0,s.defineReadOnly)(this,"_subs",{}),(0,s.defineReadOnly)(this,"_subIds",{}),(0,s.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(e=>{this.websocket.send(this._requests[e].payload)})},this.websocket.onmessage=e=>{let t=e.data,r=JSON.parse(t);if(null!=r.id){let n=String(r.id),i=this._requests[n];if(delete this._requests[n],void 0!==r.result)i.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(i.payload),response:r.result,provider:this});else{let o=null;r.error?(o=Error(r.error.message||"unknown error"),(0,s.defineReadOnly)(o,"code",r.error.code||null),(0,s.defineReadOnly)(o,"response",t)):o=Error("unknown error"),i.callback(o,void 0),this.emit("debug",{action:"response",error:o,request:JSON.parse(i.payload),provider:this})}}else if("eth_subscription"===r.method){let a=this._subs[r.params.subscription];a&&a.processFunc(r.params.result)}else console.warn("this should not happen")};let r=setInterval(()=>{this.emit("poll")},1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){g.throwError("cannot reset events block on WebSocketProvider",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){g.throwError("cannot set polling interval on WebSocketProvider",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return m(this,void 0,void 0,function*(){return null})}set polling(e){e&&g.throwError("cannot set polling on WebSocketProvider",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){let r=y++;return new Promise((n,i)=>{let o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:o},this._wsReady&&this.websocket.send(o)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return m(this,void 0,void 0,function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then(e=>this.send("eth_subscribe",e)),this._subIds[e]=n);let i=yield n;this._subs[i]={tag:e,processFunc:r}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],e=>{let t=u.O$.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],e=>{this.emit("pending",e)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))});break;case"tx":{let t=e=>{let t=e.hash;this.getTransactionReceipt(t).then(e=>{e&&this.emit(t,e)})};t(e),this._subscribe("tx",["newHeads"],e=>{this._events.filter(e=>"tx"===e.type).forEach(t)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter(e=>"tx"===e.type).length)return;t="tx"}else if(this.listenerCount(e.event))return;let r=this._subIds[t];r&&(delete this._subIds[t],r.then(e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))}))}destroy(){return m(this,void 0,void 0,function*(){this.websocket.readyState===f.CONNECTING&&(yield new Promise(e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}})),this.websocket.close(1e3)})}}var b=r(93901);let w=new c.Logger(h.i),A="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class E extends v{constructor(e,t){let r=new k(e,t),n=r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(n,r.network),(0,s.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===A}}class k extends b.l{static getWebSocketProvider(e,t){return new E(e,t)}static getApiKey(e){return null==e?A:(e&&"string"!=typeof e&&w.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:w.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===A&&(0,a.vh)(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===A}}let S=new c.Logger(h.i),P="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class x extends b.l{isCommunityResource(){return this.apiKey===P}static getApiKey(e){return null==e?P:e}static getUrl(e,t){null==t&&(t=P);let r={allowGzip:!0,url:"https://"+function(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return S.throwArgumentError("unsupported network","name",e)}(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===P&&(0,a.vh)(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}let C=new c.Logger(h.i);class _ extends b.l{static getApiKey(e){return null!=e&&C.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;return"homestead"===e.name?r="https://cloudflare-eth.com/":C.throwArgumentError("unsupported network","network",arguments[0]),r}perform(e,t){var r,n,i,o;let s=Object.create(null,{perform:{get:()=>super.perform}});return r=this,n=void 0,i=void 0,o=function*(){if("getBlockNumber"===e){let r=yield s.perform.call(this,"getBlock",{blockTag:"latest"});return r.number}return s.perform.call(this,e,t)},new(i||(i=Promise))(function(e,t){function s(e){try{u(o.next(e))}catch(r){t(r)}}function a(e){try{u(o.throw(e))}catch(r){t(r)}}function u(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(s,a)}u((o=o.apply(r,n||[])).next())})}}var O=r(16441),R=r(83875),M=r(37707),N=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let I=new c.Logger(h.i);function T(e){let t={};for(let r in e){if(null==e[r])continue;let n=e[r];("type"!==r||0!==n)&&(n=({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0})[r]?(0,O.hexValue)((0,O.hexlify)(n)):"accessList"===r?"["+(0,R.accessListify)(n).map(e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`).join(",")+"]":(0,O.hexlify)(n),t[r]=n)}return t}function B(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){let t=Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function L(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){let t=Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){let r=Error("invalid response");throw r.result=JSON.stringify(e),r}if(e.error){let n=Error(e.error.message||"unknown error");throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function F(e){if("pending"===e)throw Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function D(e,t,r){if("call"===e&&t.code===c.Logger.errors.SERVER_ERROR){let n=t.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){let i=n.data;if(i&&(i="0x"+i.replace(/^.*0x/i,"")),(0,O.isHexString)(i))return i;I.throwError("missing revert data in call exception",c.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let o=t.message;throw t.code===c.Logger.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&I.throwError("insufficient funds for intrinsic transaction cost",c.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&I.throwError("nonce has already been used",c.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),o.match(/another transaction with same nonce/)&&I.throwError("replacement fee too low",c.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),o.match(/execution failed due to an exception|execution reverted/)&&I.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",c.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class U extends o.Zk{constructor(e,t){super(e),(0,s.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,s.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return I.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){let r=Object.keys(t).reduce((e,r)=>{let n=t[r];return null!=n&&(e+=`&${r}=${n}`),e},""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return N(this,void 0,void 0,function*(){let n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null;this.emit("debug",{action:"request",request:n,provider:this});let o={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&(0,a.vh)(),Promise.resolve(!0))},u=null;i&&(o.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(i).map(e=>`${e}=${i[e]}`).join("&"));let l=yield(0,M.fetchJson)(o,u,("proxy"===e?L:B)||L);return this.emit("debug",{action:"response",request:n,response:(0,s.deepCopy)(l),provider:this}),l})}detectNetwork(){return N(this,void 0,void 0,function*(){return this.network})}perform(e,t){let r=Object.create(null,{perform:{get:()=>super.perform}});return N(this,void 0,void 0,function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch(e=>D("sendTransaction",e,t.signedTransaction));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw Error("EtherscanProvider does not support blockTag for call");let n=T(t.transaction);n.module="proxy",n.action="eth_call";try{return yield this.fetch("proxy",n,!0)}catch(i){return D("call",i,t.transaction)}}case"estimateGas":{let o=T(t.transaction);o.module="proxy",o.action="eth_estimateGas";try{return yield this.fetch("proxy",o,!0)}catch(s){return D("estimateGas",s,t.transaction)}}case"getLogs":{let a={action:"getLogs"};if(t.filter.fromBlock&&(a.fromBlock=F(t.filter.fromBlock)),t.filter.toBlock&&(a.toBlock=F(t.filter.toBlock)),t.filter.address&&(a.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&I.throwError("unsupported topic count",c.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){let u=t.filter.topics[0];("string"!=typeof u||66!==u.length)&&I.throwError("unsupported topic format",c.Logger.errors.UNSUPPORTED_OPERATION,{topic0:u}),a.topic0=u}let l=yield this.fetch("logs",a),h={};for(let f=0;f{["contractAddress","to"].forEach(function(t){""==e[t]&&delete e[t]}),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);let t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t})})}isCommunityResource(){return null==this.apiKey}}var j=r(51619);let q=null,G=new c.Logger(h.i),K="84842078b09946638c03157f83405213";class H extends v{constructor(e,t){let r=new z(e,t),n=r.connection;n.password&&G.throwError("INFURA WebSocket project secrets unsupported",c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});let i=n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(i,e),(0,s.defineReadOnly)(this,"apiKey",r.projectId),(0,s.defineReadOnly)(this,"projectId",r.projectId),(0,s.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===K}}class z extends b.l{static getWebSocketProvider(e,t){return new H(e,t)}static getApiKey(e){let t={apiKey:K,projectId:K,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(G.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),G.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:G.throwError("unsupported network",c.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===K&&(0,a.vh)(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===K}}class Q extends l.r{send(e,t){let r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);let n={request:r,resolve:null,reject:null},i=new Promise((e,t)=>{n.resolve=e,n.reject=t});return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{let e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;let t=e.map(e=>e.request);return this.emit("debug",{action:"requestBatch",request:(0,s.deepCopy)(t),provider:this}),(0,M.fetchJson)(this.connection,JSON.stringify(t)).then(r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach((e,t)=>{let n=r[t];if(n.error){let i=Error(n.error.message);i.code=n.error.code,i.data=n.error.data,e.reject(i)}else e.resolve(n.result)})},r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach(e=>{e.reject(r)})})},10)),i}}let W=new c.Logger(h.i);class J extends b.l{static getApiKey(e){return e&&"string"!=typeof e&&W.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){W.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:W.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}let V=new c.Logger(h.i),Y="62e1ad51b37b8e00394bda3b";class Z extends b.l{static getApiKey(e){let t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=Y:"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:V.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:V.throwError("unsupported network",c.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n=`https://${r}/v1/lb/${t.applicationId}`,i={headers:{},url:n};return null!=t.applicationSecretKey&&(i.user="",i.password=t.applicationSecretKey),i}isCommunityResource(){return this.applicationId===Y}}var $=r(241);let X=new c.Logger(h.i);function ee(e,t){if(null==e&&(e="homestead"),"string"==typeof e){let r=e.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new l.r(e);case"ws":case"wss":return new v(e);default:X.throwArgumentError("unsupported URL scheme","network",e)}}let n=(0,i.H)(e);return n&&n._defaultProvider||X.throwError("unsupported getDefaultProvider network",c.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),n._defaultProvider({FallbackProvider:j.H,AlchemyProvider:k,AnkrProvider:x,CloudflareProvider:_,EtherscanProvider:U,InfuraProvider:z,JsonRpcProvider:l.r,NodesmithProvider:J,PocketProvider:Z,Web3Provider:$.Q,IpcProvider:q},t)}},82169:function(e,t,r){"use strict";r.d(t,{C:function(){return k},r:function(){return x}});var n=r(48088),i=r(2593),o=r(16441),s=r(67827),a=r(6881),u=r(29251),l=r(83875),c=r(37707),h=r(1581),f=r(34216),d=r(75361),p=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let m=new h.Logger(f.i),g=["call","estimateGas"];function y(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){let r=(0,o.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(let n in e){let i=y(e[n],t);if(i)return i}return null}if("string"==typeof e)try{return y(JSON.parse(e),t)}catch(s){}return null}function v(e,t,r){let n=r.transaction||r.signedTransaction;if("call"===e){let i=y(t,!0);if(i)return i.data;m.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let o=y(t.body,!1);null==o&&(o=y(t,!1)),o&&m.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:e,transaction:n,error:t})}let s=t.message;throw t.code===h.Logger.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?s=t.error.message:"string"==typeof t.body?s=t.body:"string"==typeof t.responseText&&(s=t.responseText),(s=(s||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&m.throwError("insufficient funds for intrinsic transaction cost",h.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),s.match(/nonce (is )?too low/i)&&m.throwError("nonce has already been used",h.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),s.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&m.throwError("replacement fee too low",h.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),s.match(/only replay-protected/i)&&m.throwError("legacy pre-eip-155 transactions not supported",h.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),g.indexOf(e)>=0&&s.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&m.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function b(e){return new Promise(function(t){setTimeout(t,e)})}function w(e){if(e.error){let t=Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function A(e){return e?e.toLowerCase():e}let E={};class k extends n.Signer{constructor(e,t,r){if(super(),e!==E)throw Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,a.defineReadOnly)(this,"provider",t),null==r&&(r=0),"string"==typeof r?((0,a.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,a.defineReadOnly)(this,"_index",null)):"number"==typeof r?((0,a.defineReadOnly)(this,"_index",r),(0,a.defineReadOnly)(this,"_address",null)):m.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return m.throwError("cannot alter JSON-RPC Signer connection",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new S(E,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&m.throwError("unknown account #"+this._index,h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=(0,a.shallowCopy)(e);let t=this.getAddress().then(e=>(e&&(e=e.toLowerCase()),e));if(null==e.gasLimit){let r=(0,a.shallowCopy)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then(e=>p(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.provider.resolveName(e);return null==t&&m.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))),(0,a.resolveProperties)({tx:(0,a.resolveProperties)(e),sender:t}).then(({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&m.throwArgumentError("from address mismatch","transaction",e):t.from=r;let n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then(e=>e,e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&m.throwError("user rejected transaction",h.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),v("sendTransaction",e,n)))})}signTransaction(e){return m.throwError("signing transactions is unsupported",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return p(this,void 0,void 0,function*(){let t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield(0,c.poll)(()=>p(this,void 0,void 0,function*(){let e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}})}signMessage(e){return p(this,void 0,void 0,function*(){let t="string"==typeof e?(0,u.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,o.hexlify)(t),r.toLowerCase()])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&m.throwError("user rejected signing",h.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),n}})}_legacySignMessage(e){return p(this,void 0,void 0,function*(){let t="string"==typeof e?(0,u.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,o.hexlify)(t)])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&m.throwError("user rejected signing",h.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),n}})}_signTypedData(e,t,r){return p(this,void 0,void 0,function*(){let n=yield s.E.resolveNames(e,t,r,e=>this.provider.resolveName(e)),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(s.E.getPayload(n.domain,t,n.value))])}catch(o){throw"string"==typeof o.message&&o.message.match(/user denied/i)&&m.throwError("user rejected signing",h.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),o}})}unlock(e){return p(this,void 0,void 0,function*(){let t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])})}}class S extends k{sendTransaction(e){return this.sendUncheckedTransaction(e).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)}))}}let P={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class x extends d.Zk{constructor(e,t){let r=t;null==r&&(r=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(t=>{e(t)},e=>{t(e)})},0)})),super(r),e||(e=(0,a.getStatic)(this.constructor,"defaultUrl")()),"string"==typeof e?(0,a.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,a.defineReadOnly)(this,"connection",Object.freeze((0,a.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return p(this,void 0,void 0,function*(){yield b(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(r){try{e=yield this.send("net_version",[])}catch(t){}}if(null!=e){let n=(0,a.getStatic)(this.constructor,"getNetwork");try{return n(i.O$.from(e).toNumber())}catch(o){return m.throwError("could not detect network",h.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:o})}}return m.throwError("could not detect network",h.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new k(E,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(e=>this.formatter.address(e)))}send(e,t){let r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,a.deepCopy)(r),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];let i=(0,c.fetchJson)(this.connection,JSON.stringify(r),w).then(e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e});return n&&(this._cache[e]=i,setTimeout(()=>{this._cache[e]=null},0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[A(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[A(t.address),t.blockTag]];case"getCode":return["eth_getCode",[A(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[A(t.address),(0,o.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":if(t.blockTag)return["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]];if(t.blockHash)return["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]];break;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":{let r=(0,a.getStatic)(this.constructor,"hexlifyTransaction");return["eth_call",[r(t.transaction,{from:!0}),t.blockTag]]}case"estimateGas":{let n=(0,a.getStatic)(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[n(t.transaction,{from:!0})]]}case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=A(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return p(this,void 0,void 0,function*(){if("call"===e||"estimateGas"===e){let r=t.transaction;if(r&&null!=r.type&&i.O$.from(r.type).isZero()&&null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas){let n=yield this.getFeeData();null==n.maxFeePerGas&&null==n.maxPriorityFeePerGas&&((t=(0,a.shallowCopy)(t)).transaction=(0,a.shallowCopy)(r),delete t.transaction.type)}}let o=this.prepareRequest(e,t);null==o&&m.throwError(e+" not implemented",h.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(o[0],o[1])}catch(s){return v(e,s,t)}})}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;let e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(r){return function n(){e.send("eth_getFilterChanges",[r]).then(function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach(function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then(function(){return e.getTransaction(t).then(function(t){return e.emit("pending",t),null})})}),n.then(function(){return b(1e3)})}).then(function(){if(e._pendingFilter!=t){e.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){n()},0),null}).catch(e=>{})}(),r}).catch(e=>{})}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){let r=(0,a.shallowCopy)(P);if(t)for(let n in t)t[n]&&(r[n]=!0);(0,a.checkProperties)(e,r);let s={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(t){if(null==e[t])return;let r=(0,o.hexValue)(i.O$.from(e[t]));"gasLimit"===t&&(t="gas"),s[t]=r}),["from","to","data"].forEach(function(t){null!=e[t]&&(s[t]=(0,o.hexlify)(e[t]))}),e.accessList&&(s.accessList=(0,l.accessListify)(e.accessList)),s}}},93901:function(e,t,r){"use strict";r.d(t,{c:function(){return u},l:function(){return l}});var n=r(6881),i=r(1581),o=r(34216),s=r(82169);let a=new i.Logger(o.i);class u extends s.r{detectNetwork(){var e,t,r,o;let s=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return e=this,t=void 0,r=void 0,o=function*(){let e=this.network;return null==e&&((e=yield s.detectNetwork.call(this))||a.throwError("no network detected",i.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,n.defineReadOnly)(this,"_network",e),this.emit("network",e,null))),e},new(r||(r=Promise))(function(n,i){function s(e){try{u(o.next(e))}catch(t){i(t)}}function a(e){try{u(o.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((o=o.apply(e,t||[])).next())})}}class l extends u{constructor(e,t){a.checkAbstract(new.target,l),e=(0,n.getStatic)(new.target,"getNetwork")(e),t=(0,n.getStatic)(new.target,"getApiKey")(t);let r=(0,n.getStatic)(new.target,"getUrl")(e,t);super(r,e),"string"==typeof t?(0,n.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach(e=>{(0,n.defineReadOnly)(this,e,t[e])})}_startPending(){a.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return a.throwError("API provider does not support signing",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return a.throwError("not implemented; sub-classes must override getUrl",i.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}},241:function(e,t,r){"use strict";r.d(t,{Q:function(){return c}});var n=r(6881),i=r(1581),o=r(34216),s=r(82169);let a=new i.Logger(o.i),u=1;function l(e,t){let r="Web3LegacyFetcher";return function(e,i){let o={method:e,params:i,id:u++,jsonrpc:"2.0"};return new Promise((e,i)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,n.deepCopy)(o),provider:this}),t(o,(t,n)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:o,provider:this}),i(t);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:n,provider:this}),n.error){let s=Error(n.error.message);return s.code=n.error.code,s.data=n.error.data,i(s)}e(n.result)})})}}class c extends s.r{constructor(e,t){null==e&&a.throwArgumentError("missing provider","provider",e);let r=null,i=null,o=null;"function"==typeof e?(r="unknown:",i=e):(((r=e.host||e.path||"")||!e.isMetaMask||(r="metamask"),o=e,e.request)?(""===r&&(r="eip-1193:"),i=function(t,r){null==r&&(r=[]);let i={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,n.deepCopy)(i),provider:this}),e.request(i).then(e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:e,provider:this}),e})}):e.sendAsync?i=l(e,e.sendAsync.bind(e)):e.send?i=l(e,e.send.bind(e)):a.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,n.defineReadOnly)(this,"jsonRpcFetchFunc",i),(0,n.defineReadOnly)(this,"provider",o)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}},22118:function(e,t,r){"use strict";r.r(t),r.d(t,{randomBytes:function(){return n.O},shuffled:function(){return i.y}});var n=r(5634),i=r(52472)},5634:function(e,t,r){"use strict";r.d(t,{O:function(){return u}});var n=r(16441),i=r(1581);let o=new i.Logger("random/5.7.0"),s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error("unable to locate global object")}(),a=s.crypto||s.msCrypto;function u(e){(e<=0||e>1024||e%1||e!=e)&&o.throwArgumentError("invalid length","length",e);let t=new Uint8Array(e);return a.getRandomValues(t),(0,n.arrayify)(t)}a&&a.getRandomValues||(o.warn("WARNING: Missing strong random number source"),a={getRandomValues:function(e){return o.throwError("no secure random source avaialble",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},52472:function(e,t,r){"use strict";function n(e){e=e.slice();for(let t=e.length-1;t>0;t--){let r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}r.d(t,{y:function(){return n}})},59052:function(e,t,r){"use strict";r.r(t),r.d(t,{decode:function(){return h},encode:function(){return u}});var n=r(16441),i=r(1581);let o=new i.Logger("rlp/5.7.0");function s(e){let t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function a(e,t,r){let n=0;for(let i=0;it+1+n&&o.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function c(e,t){if(0===e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){let r=e[t]-247;t+1+r>e.length&&o.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});let s=a(e,t+1,r);return t+1+r+s>e.length&&o.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+r,r+s)}if(e[t]>=192){let u=e[t]-192;return t+1+u>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,u)}if(e[t]>=184){let c=e[t]-183;t+1+c>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});let h=a(e,t+1,c);t+1+c+h>e.length&&o.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});let f=(0,n.hexlify)(e.slice(t+1+c,t+1+c+h));return{consumed:1+c+h,result:f}}if(e[t]>=128){let d=e[t]-128;t+1+d>e.length&&o.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{});let p=(0,n.hexlify)(e.slice(t+1,t+1+d));return{consumed:1+d,result:p}}return{consumed:1,result:(0,n.hexlify)(e[t])}}function h(e){let t=(0,n.arrayify)(e),r=c(t,0);return r.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),r.result}},91278:function(e,t,r){"use strict";r.r(t),r.d(t,{SupportedAlgorithm:function(){return i.p},computeHmac:function(){return n.Gy},ripemd160:function(){return n.bP},sha256:function(){return n.JQ},sha512:function(){return n.o}});var n=r(2006),i=r(21261)},2006:function(e,t,r){"use strict";r.d(t,{Gy:function(){return f},bP:function(){return l},JQ:function(){return c},o:function(){return h}});var n=r(33715),i=r.n(n),o=r(16441),s=r(21261),a=r(1581);let u=new a.Logger("sha2/5.7.0");function l(e){return"0x"+i().ripemd160().update((0,o.arrayify)(e)).digest("hex")}function c(e){return"0x"+i().sha256().update((0,o.arrayify)(e)).digest("hex")}function h(e){return"0x"+i().sha512().update((0,o.arrayify)(e)).digest("hex")}function f(e,t,r){return s.p[e]||u.throwError("unsupported algorithm "+e,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+i().hmac(i()[e],(0,o.arrayify)(t)).update((0,o.arrayify)(r)).digest("hex")}},21261:function(e,t,r){"use strict";var n,i;r.d(t,{p:function(){return n}}),(i=n||(n={})).sha256="sha256",i.sha512="sha512"},67669:function(e,t,r){"use strict";r.r(t),r.d(t,{SigningKey:function(){return K},computePublicKey:function(){return z},recoverPublicKey:function(){return H}});var n=r(13550),i=r.n(n),o=r(33715),s=r.n(o);function a(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e,null==t?r.path:t)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var u=l;function l(e,t){if(!e)throw Error(t||"Assertion failed")}l.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var c=a(function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}}),h=a(function(e,t){var r=t;r.assert=u,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function(e,t,r){var n=Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,s,a,u=e.andln(3)+n&3,l=t.andln(3)+i&3;3===u&&(u=-1),3===l&&(l=-1),s=(1&u)==0?0:(3==(o=e.andln(7)+n&7)||5===o)&&2===l?-u:u,r[0].push(s),a=(1&l)==0?0:(3==(o=t.andln(7)+i&7)||5===o)&&2===u?-l:l,r[1].push(a),2*n===s+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(i())(e,"hex","le")}}),f=h.getNAF,d=h.getJSF,p=h.assert;function m(e,t){this.type=e,this.p=new(i())(t.p,16),this.red=t.prime?i().red(t.prime):i().mont(this.p),this.zero=new(i())(0).toRed(this.red),this.one=new(i())(1).toRed(this.red),this.two=new(i())(2).toRed(this.red),this.n=t.n&&new(i())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function g(e,t){this.curve=e,this.type=t,this.precomputed=null}m.prototype.point=function(){throw Error("Not implemented")},m.prototype.validate=function(){throw Error("Not implemented")},m.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r,n,i=e._getDoubles(),o=f(t,1,this._bitLength),s=(1<=r;u--)n=(n<<1)+o[u];a.push(n)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),h=s;h>0;h--){for(r=0;r=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var l=o[a];p(0!==l),s="affine"===e.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},m.prototype._wnafMulAdd=function(e,t,r,n,i){var o,s,a,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,h=0;for(o=0;o=1;o-=2){var m=o-1,g=o;if(1!==u[m]||1!==u[g]){c[m]=f(r[m],u[m],this._bitLength),c[g]=f(r[g],u[g],this._bitLength),h=Math.max(c[m].length,h),h=Math.max(c[g].length,h);continue}var y=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(y[1]=t[m].add(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].add(t[g].neg())):(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[m],r[g]);for(s=0,h=Math.max(b[0].length,h),c[m]=Array(h),c[g]=Array(h);s=0;o--){for(var S=0;o>=0;){var P=!0;for(s=0;s=0&&S++,E=E.dblp(S),o<0)break;for(s=0;s0?a=l[s][x-1>>1]:x<0&&(a=l[s][-x-1>>1].neg()),E="affine"===a.type?E.mixedAdd(a):E.add(a))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},g.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;io[0].cmp(o[1])?o[0]:o[1]).toRed(this.red)}if(e.lambda)r=new(i())(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],v(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return n=e.basis?e.basis.map(function(e){return{a:new(i())(e.a,16),b:new(i())(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:n}}},b.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i().mont(e),r=new(i())(2).toRed(t).redInvm(),n=r.redNeg(),o=new(i())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},b.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,u,l,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),p=new(i())(1),m=new(i())(0),g=new(i())(0),y=new(i())(1),v=0;0!==f.cmpn(0);){var b=d.div(f);l=d.sub(b.mul(f)),c=g.sub(b.mul(p));var w=y.sub(b.mul(m));if(!n&&0>l.cmp(h))t=u.neg(),r=p,n=l.neg(),o=c;else if(n&&2==++v)break;u=l,d=f,f=l,g=p,p=c,y=m,m=w}s=l.neg(),a=c;var A=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(A)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},b.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(l).neg()}},b.prototype.pointFromX=function(e,t){(e=new(i())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},b.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},b.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},w.prototype.isInfinity=function(){return this.inf},w.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},w.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},w.prototype.getX=function(){return this.x.fromRed()},w.prototype.getY=function(){return this.y.fromRed()},w.prototype.mul=function(e){return(e=new(i())(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},w.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},w.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},w.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},w.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},w.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(A,m.BasePoint),b.prototype.jpoint=function(e,t,r){return new A(this,e,t,r)},A.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},A.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},A.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),c=l.redMul(a),h=n.redMul(l),f=u.redSqr().redIAdd(c).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,d,p)},A.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),c=r.redMul(u),h=a.redSqr().redIAdd(l).redISub(c).redISub(c),f=a.redMul(c.redISub(h)).redISub(i.redMul(l)),d=this.z.redMul(s);return this.curve.jpoint(h,f,d)},A.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},A.prototype.inspect=function(){return this.isInfinity()?"":""},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var E=a(function(e,t){var r=t;r.base=m,r.short=b,r.mont=null,r.edwards=null}),k=a(function(e,t){var r,n=t,i=h.assert;function o(e){"short"===e.type?this.curve=new E.short(e):"edwards"===e.type?this.curve=new E.edwards(e):this.curve=new E.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(u){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function S(e){if(!(this instanceof S))return new S(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=c.toArray(e.entropy,e.entropyEnc||"hex"),r=c.toArray(e.nonce,e.nonceEnc||"hex"),n=c.toArray(e.pers,e.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}S.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},S.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=c.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var C=h.assert;function _(e,t){if(e instanceof _)return e;this._importDER(e,t)||(C(e.r&&e.s,"Signature without r or s"),this.r=new(i())(e.r,16),this.s=new(i())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function O(){this.place=0}function R(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o>>=0;return!(i<=127)&&(t.place=s,i)}function M(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}_.prototype._importDER=function(e,t){e=h.toArray(e,t);var r=new O;if(48!==e[r.place++])return!1;var n=R(e,r);if(!1===n||n+r.place!==e.length||2!==e[r.place++])return!1;var o=R(e,r);if(!1===o)return!1;var s=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var a=R(e,r);if(!1===a||e.length!==a+r.place)return!1;var u=e.slice(r.place,a+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new(i())(s),this.s=new(i())(u),this.recoveryParam=null,!0},_.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=M(t),r=M(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];N(n,t.length),(n=n.concat(t)).push(2),N(n,r.length);var i=n.concat(r),o=[48];return N(o,i.length),o=o.concat(i),h.encode(o,e)};var I=function(){throw Error("unsupported")},T=h.assert;function B(e){if(!(this instanceof B))return new B(e);"string"==typeof e&&(T(Object.prototype.hasOwnProperty.call(k,e),"Unknown curve "+e),e=k[e]),e instanceof k.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}B.prototype.keyPair=function(e){return new x(this,e)},B.prototype.keyFromPrivate=function(e,t){return x.fromPrivate(this,e,t)},B.prototype.keyFromPublic=function(e,t){return x.fromPublic(this,e,t)},B.prototype.genKeyPair=function(e){e||(e={});for(var t=new S({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||I(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(i())(2));;){var o=new(i())(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},B.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return(r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},B.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(i())(e,16));for(var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),a=e.toArray("be",o),u=new S({hash:this.hash,entropy:s,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new(i())(1)),c=0;;c++){var h=n.k?n.k(c):new(i())(u.generate(this.n.byteLength()));if(!(0>=(h=this._truncateToN(h,!0)).cmpn(1)||h.cmp(l)>=0)){var f=this.g.mul(h);if(!f.isInfinity()){var d=f.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var m=h.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(f.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new _({r:p,s:m,recoveryParam:g})}}}}}},B.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(i())(e,16)),r=this.keyFromPublic(r,n);var o,s=(t=new _(t,"hex")).r,a=t.s;if(0>s.cmpn(1)||s.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var u=a.invm(this.n),l=u.mul(e).umod(this.n),c=u.mul(s).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&o.eqXToP(s):!(o=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===o.getX().umod(this.n).cmp(s)},B.prototype.recoverPubKey=function(e,t,r,n){T((3&r)===r,"The recovery param is more than two bits"),t=new _(t,n);var o=this.n,s=new(i())(e),a=t.r,u=t.s,l=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var h=t.r.invm(o),f=o.sub(s).mul(h).umod(o),d=u.mul(h).umod(o);return this.g.mulAdd(f,a,d)},B.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new _(t,n)).recoveryParam)return t.recoveryParam;for(var i,o=0;o<4;o++){try{i=this.recoverPubKey(e,t,o)}catch(s){continue}if(i.eq(r))return o}throw Error("Unable to find valid recovery factor")};var L=a(function(e,t){var r=t;r.version="6.5.4",r.utils=h,r.rand=function(){throw Error("unsupported")},r.curve=E,r.curves=k,r.ec=B,r.eddsa=null}).ec,F=r(16441),D=r(6881),U=r(1581);let j=new U.Logger("signing-key/5.7.0"),q=null;function G(){return q||(q=new L("secp256k1")),q}class K{constructor(e){(0,D.defineReadOnly)(this,"curve","secp256k1"),(0,D.defineReadOnly)(this,"privateKey",(0,F.hexlify)(e)),32!==(0,F.hexDataLength)(this.privateKey)&&j.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=G().keyFromPrivate((0,F.arrayify)(this.privateKey));(0,D.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,D.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,D.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){let t=G().keyFromPublic((0,F.arrayify)(this.publicKey)),r=G().keyFromPublic((0,F.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){let t=G().keyFromPrivate((0,F.arrayify)(this.privateKey)),r=(0,F.arrayify)(e);32!==r.length&&j.throwArgumentError("bad digest length","digest",e);let n=t.sign(r,{canonical:!0});return(0,F.splitSignature)({recoveryParam:n.recoveryParam,r:(0,F.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,F.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let t=G().keyFromPrivate((0,F.arrayify)(this.privateKey)),r=G().keyFromPublic((0,F.arrayify)(z(e)));return(0,F.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function H(e,t){let r=(0,F.splitSignature)(t),n={r:(0,F.arrayify)(r.r),s:(0,F.arrayify)(r.s)};return"0x"+G().recoverPubKey((0,F.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function z(e,t){let r=(0,F.arrayify)(e);if(32===r.length){let n=new K(r);return t?"0x"+G().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?(0,F.hexlify)(r):"0x"+G().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+G().keyFromPublic(r).getPublic(!0,"hex"):(0,F.hexlify)(r):j.throwArgumentError("invalid public or private key","key","[REDACTED]")}},31886:function(e,t,r){"use strict";r.r(t),r.d(t,{keccak256:function(){return p},pack:function(){return d},sha256:function(){return m}});var n=r(2593),i=r(16441),o=r(38197),s=r(2006),a=r(29251),u=r(1581);let l=RegExp("^bytes([0-9]+)$"),c=RegExp("^(u?int)([0-9]*)$"),h=RegExp("^(.*)\\[([0-9]*)\\]$"),f=new u.Logger("solidity/5.7.0");function d(e,t){e.length!=t.length&&f.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);let r=[];return e.forEach(function(e,o){r.push(function e(t,r,o){switch(t){case"address":if(o)return(0,i.zeroPad)(r,32);return(0,i.arrayify)(r);case"string":return(0,a.Y0)(r);case"bytes":return(0,i.arrayify)(r);case"bool":if(r=r?"0x01":"0x00",o)return(0,i.zeroPad)(r,32);return(0,i.arrayify)(r)}let s=t.match(c);if(s){let u=parseInt(s[2]||"256");return(s[2]&&String(u)!==s[2]||u%8!=0||0===u||u>256)&&f.throwArgumentError("invalid number type","type",t),o&&(u=256),r=n.O$.from(r).toTwos(u),(0,i.zeroPad)(r,u/8)}if(s=t.match(l)){let d=parseInt(s[1]);return((String(d)!==s[1]||0===d||d>32)&&f.throwArgumentError("invalid bytes type","type",t),(0,i.arrayify)(r).byteLength!==d&&f.throwArgumentError(`invalid value for ${t}`,"value",r),o)?(0,i.arrayify)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((s=t.match(h))&&Array.isArray(r)){let p=s[1],m=parseInt(s[2]||String(r.length));m!=r.length&&f.throwArgumentError(`invalid array length for ${t}`,"value",r);let g=[];return r.forEach(function(t){g.push(e(p,t,!0))}),(0,i.concat)(g)}return f.throwArgumentError("invalid type","type",t)}(e,t[o]))}),(0,i.hexlify)((0,i.concat)(r))}function p(e,t){return(0,o.keccak256)(d(e,t))}function m(e,t){return(0,s.JQ)(d(e,t))}},22384:function(e,t,r){"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:function(){return o.Uj},Utf8ErrorFuncs:function(){return o.te},Utf8ErrorReason:function(){return o.Uw},_toEscapedUtf8String:function(){return o.U$},formatBytes32String:function(){return s},nameprep:function(){return v},parseBytes32String:function(){return a},toUtf8Bytes:function(){return o.Y0},toUtf8CodePoints:function(){return o.XL},toUtf8String:function(){return o.ZN}});var n=r(57218),i=r(16441),o=r(29251);function s(e){let t=(0,o.Y0)(e);if(t.length>31)throw Error("bytes32 string must be less than 32 bytes");return(0,i.hexlify)((0,i.concat)([t,n.R]).slice(0,32))}function a(e){let t=(0,i.arrayify)(e);if(32!==t.length)throw Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,o.ZN)(t.slice(0,r))}function u(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach(e=>{let i=e.split(":");n[r+=parseInt(i[0],16)]=t(i[1])}),n}function l(e){let t=0;return e.split(",").map(e=>{let r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}})}function c(e,t){let r=0;for(let n=0;n=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}let h=l("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),f="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(e=>parseInt(e,16)),d=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],p=u("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),m=u("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),g=u("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(e){if(e.length%4!=0)throw Error("bad data");let t=[];for(let r=0;rf.indexOf(e)>=0||e>=65024&&e<=65039?[]:function(e){let t=c(e,d);if(t)return[e+t.s];let r=p[e];if(r)return r;let n=m[e];return n?[e+n[0]]:g[e]||null}(e)||[e]).reduce((e,t)=>(t.forEach(t=>{e.push(t)}),e),[]),(t=(0,o.XL)((0,o.uu)(t),o.Uj.NFKC)).forEach(e=>{if(c(e,y))throw Error("STRINGPREP_CONTAINS_PROHIBITED")}),t.forEach(e=>{if(c(e,h))throw Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=(0,o.uu)(t);if("-"===r.substring(0,1)||"--"===r.substring(2,4)||"-"===r.substring(r.length-1))throw Error("invalid hyphen");return r}},29251:function(e,t,r){"use strict";r.d(t,{Uj:function(){return o},te:function(){return h},Uw:function(){return s},U$:function(){return m},uu:function(){return g},Y0:function(){return d},XL:function(){return v},ZN:function(){return y}});var n,i,o,s,a=r(16441),u=r(1581);let l=new u.Logger("strings/5.7.0");function c(e,t,r,n,i){if(e===s.BAD_PREFIX||e===s.UNEXPECTED_CONTINUE){let o=0;for(let a=t+1;a>6==2;a++)o++;return o}return e===s.OVERRUN?r.length-t-1:0}(n=o||(o={})).current="",n.NFC="NFC",n.NFD="NFD",n.NFKC="NFKC",n.NFKD="NFKD",(i=s||(s={})).UNEXPECTED_CONTINUE="unexpected continuation byte",i.BAD_PREFIX="bad codepoint prefix",i.OVERRUN="string overrun",i.MISSING_CONTINUE="missing continuation byte",i.OUT_OF_RANGE="out of UTF-8 range",i.UTF16_SURROGATE="UTF-16 surrogate",i.OVERLONG="overlong representation";let h=Object.freeze({error:function(e,t,r,n,i){return l.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:c,replace:function(e,t,r,n,i){return e===s.OVERLONG?(n.push(i),0):(n.push(65533),c(e,t,r,n,i))}});function f(e,t){null==t&&(t=h.error),e=(0,a.arrayify)(e);let r=[],n=0;for(;n>7==0){r.push(i);continue}let o=null,u=null;if((224&i)==192)o=1,u=127;else if((240&i)==224)o=2,u=2047;else if((248&i)==240)o=3,u=65535;else{(192&i)==128?n+=t(s.UNEXPECTED_CONTINUE,n-1,e,r):n+=t(s.BAD_PREFIX,n-1,e,r);continue}if(n-1+o>=e.length){n+=t(s.OVERRUN,n-1,e,r);continue}let l=i&(1<<8-o-1)-1;for(let c=0;c1114111){n+=t(s.OUT_OF_RANGE,n-1-o,e,r,l);continue}if(l>=55296&&l<=57343){n+=t(s.UTF16_SURROGATE,n-1-o,e,r,l);continue}if(l<=u){n+=t(s.OVERLONG,n-1-o,e,r,l);continue}r.push(l)}}return r}function d(e,t=o.current){t!=o.current&&(l.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n>6|192),r.push(63&i|128);else if((64512&i)==55296){n++;let s=e.charCodeAt(n);if(n>=e.length||(64512&s)!=56320)throw Error("invalid utf-8 string");let u=65536+((1023&i)<<10)+(1023&s);r.push(u>>18|240),r.push(u>>12&63|128),r.push(u>>6&63|128),r.push(63&u|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return(0,a.arrayify)(r)}function p(e){let t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function m(e,t){return'"'+f(e,t).map(e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?p(e):p(((e-=65536)>>10&1023)+55296)+p((1023&e)+56320)}).join("")+'"'}function g(e){return e.map(e=>e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10&1023)+55296,(1023&e)+56320)).join("")}function y(e,t){return g(f(e,t))}function v(e,t=o.current){return f(d(e,t))}},83875:function(e,t,r){"use strict";r.r(t),r.d(t,{TransactionTypes:function(){return i},accessListify:function(){return k},computeAddress:function(){return b},parse:function(){return O},recoverAddress:function(){return w},serialize:function(){return C}});var n,i,o=r(19485),s=r(2593),a=r(16441),u=r(21046),l=r(38197),c=r(6881),h=r(59052),f=r(67669),d=r(1581);let p=new d.Logger("transactions/5.7.0");function m(e){return"0x"===e?null:(0,o.getAddress)(e)}function g(e){return"0x"===e?u._Y:s.O$.from(e)}(n=i||(i={}))[n.legacy=0]="legacy",n[n.eip2930=1]="eip2930",n[n.eip1559=2]="eip1559";let y=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],v={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function b(e){let t=(0,f.computePublicKey)(e);return(0,o.getAddress)((0,a.hexDataSlice)((0,l.keccak256)((0,a.hexDataSlice)(t,1)),12))}function w(e,t){return b((0,f.recoverPublicKey)((0,a.arrayify)(e),t))}function A(e,t){let r=(0,a.stripZeros)(s.O$.from(e).toHexString());return r.length>32&&p.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function E(e,t){return{address:(0,o.getAddress)(e),storageKeys:(t||[]).map((t,r)=>(32!==(0,a.hexDataLength)(t)&&p.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase()))}}function k(e){if(Array.isArray(e))return e.map((e,t)=>Array.isArray(e)?(e.length>2&&p.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),E(e[0],e[1])):E(e.address,e.storageKeys));let t=Object.keys(e).map(t=>{let r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return E(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function S(e){return k(e).map(e=>[e.address,e.storageKeys])}function P(e,t){if(null!=e.gasPrice){let r=s.O$.from(e.gasPrice),n=s.O$.from(e.maxFeePerGas||0);r.eq(n)||p.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}let i=[A(e.chainId||0,"chainId"),A(e.nonce||0,"nonce"),A(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),A(e.maxFeePerGas||0,"maxFeePerGas"),A(e.gasLimit||0,"gasLimit"),null!=e.to?(0,o.getAddress)(e.to):"0x",A(e.value||0,"value"),e.data||"0x",S(e.accessList||[])];if(t){let u=(0,a.splitSignature)(t);i.push(A(u.recoveryParam,"recoveryParam")),i.push((0,a.stripZeros)(u.r)),i.push((0,a.stripZeros)(u.s))}return(0,a.hexConcat)(["0x02",h.encode(i)])}function x(e,t){let r=[A(e.chainId||0,"chainId"),A(e.nonce||0,"nonce"),A(e.gasPrice||0,"gasPrice"),A(e.gasLimit||0,"gasLimit"),null!=e.to?(0,o.getAddress)(e.to):"0x",A(e.value||0,"value"),e.data||"0x",S(e.accessList||[])];if(t){let n=(0,a.splitSignature)(t);r.push(A(n.recoveryParam,"recoveryParam")),r.push((0,a.stripZeros)(n.r)),r.push((0,a.stripZeros)(n.s))}return(0,a.hexConcat)(["0x01",h.encode(r)])}function C(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&p.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.checkProperties)(e,v);let r=[];y.forEach(function(t){let n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=(0,a.arrayify)((0,a.hexlify)(n,i)),t.length&&n.length!==t.length&&n.length>0&&p.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,a.stripZeros)(n)).length>t.maxLength&&p.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push((0,a.hexlify)(n))});let n=0;if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&p.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!(0,a.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,a.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return h.encode(r);let i=(0,a.splitSignature)(t),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,a.hexlify)(o)),r.push((0,a.stripZeros)((0,a.arrayify)(i.r))),r.push((0,a.stripZeros)((0,a.arrayify)(i.s))),h.encode(r)}(e,t);switch(e.type){case 1:return x(e,t);case 2:return P(e,t)}return p.throwError(`unsupported transaction type: ${e.type}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function _(e,t,r){try{let n=g(t[0]).toNumber();if(0!==n&&1!==n)throw Error("bad recid");e.v=n}catch(i){p.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,a.hexZeroPad)(t[1],32),e.s=(0,a.hexZeroPad)(t[2],32);try{let o=(0,l.keccak256)(r(e));e.from=w(o,{r:e.r,s:e.s,recoveryParam:e.v})}catch(s){}}function O(e){let t=(0,a.arrayify)(e);if(t[0]>127)return function(e){let t=h.decode(e);9!==t.length&&6!==t.length&&p.throwArgumentError("invalid raw transaction","rawTransaction",e);let r={nonce:g(t[0]).toNumber(),gasPrice:g(t[1]),gasLimit:g(t[2]),to:m(t[3]),value:g(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=s.O$.from(t[6]).toNumber()}catch(n){return r}if(r.r=(0,a.hexZeroPad)(t[7],32),r.s=(0,a.hexZeroPad)(t[8],32),s.O$.from(r.r).isZero()&&s.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let i=r.v-27,o=t.slice(0,6);0!==r.chainId&&(o.push((0,a.hexlify)(r.chainId)),o.push("0x"),o.push("0x"),i-=2*r.chainId+8);let u=(0,l.keccak256)(h.encode(o));try{r.from=w(u,{r:(0,a.hexlify)(r.r),s:(0,a.hexlify)(r.s),recoveryParam:i})}catch(c){}r.hash=(0,l.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){let t=h.decode(e.slice(1));8!==t.length&&11!==t.length&&p.throwArgumentError("invalid component count for transaction type: 1","payload",(0,a.hexlify)(e));let r={type:1,chainId:g(t[0]).toNumber(),nonce:g(t[1]).toNumber(),gasPrice:g(t[2]),gasLimit:g(t[3]),to:m(t[4]),value:g(t[5]),data:t[6],accessList:k(t[7])};return 8===t.length||(r.hash=(0,l.keccak256)(e),_(r,t.slice(8),x)),r}(t);case 2:return function(e){let t=h.decode(e.slice(1));9!==t.length&&12!==t.length&&p.throwArgumentError("invalid component count for transaction type: 2","payload",(0,a.hexlify)(e));let r=g(t[2]),n=g(t[3]),i={type:2,chainId:g(t[0]).toNumber(),nonce:g(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:g(t[4]),to:m(t[5]),value:g(t[6]),data:t[7],accessList:k(t[8])};return 9===t.length||(i.hash=(0,l.keccak256)(e),_(i,t.slice(9),P)),i}(t)}return p.throwError(`unsupported transaction type: ${t[0]}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},61744:function(e,t,r){"use strict";r.r(t),r.d(t,{commify:function(){return a},formatEther:function(){return c},formatUnits:function(){return u},parseEther:function(){return h},parseUnits:function(){return l}});var n=r(20335),i=r(1581);let o=new i.Logger("units/5.7.0"),s=["wei","kwei","mwei","gwei","szabo","finney","ether"];function a(e){let t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&o.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);let s=[];for(;r.length;){if(r.length<=3){s.unshift(r);break}{let a=r.length-3;s.unshift(r.substring(a)),r=r.substring(0,a)}}return n+s.join(",")+i}function u(e,t){if("string"==typeof t){let r=s.indexOf(t);-1!==r&&(t=3*r)}return(0,n.S5)(e,null!=t?t:18)}function l(e,t){if("string"!=typeof e&&o.throwArgumentError("value must be a string","value",e),"string"==typeof t){let r=s.indexOf(t);-1!==r&&(t=3*r)}return(0,n.Ox)(e,null!=t?t:18)}function c(e){return u(e,18)}function h(e){return l(e,18)}},79911:function(e,t,r){"use strict";r.r(t),r.d(t,{Wallet:function(){return w},verifyMessage:function(){return A},verifyTypedData:function(){return E}});var n=r(19485),i=r(81556),o=r(48088),s=r(16441),a=r(93684),u=r(67827),l=r(84178),c=r(38197),h=r(6881),f=r(5634),d=r(67669),p=r(81964),m=r(45659),g=r(83875),y=r(1581),v=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};let b=new y.Logger("wallet/5.7.0");class w extends o.Signer{constructor(e,t){var r;if(super(),null!=(r=e)&&(0,s.isHexString)(r.privateKey,32)&&null!=r.address){let o=new d.SigningKey(e.privateKey);if((0,h.defineReadOnly)(this,"_signingKey",()=>o),(0,h.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(e.address)&&b.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){let t=e.mnemonic;return t&&t.phrase}(e)){let a=e.mnemonic;(0,h.defineReadOnly)(this,"_mnemonic",()=>({phrase:a.phrase,path:a.path||l.defaultPath,locale:a.locale||"en"}));let u=this.mnemonic,c=l.HDNode.fromMnemonic(u.phrase,null,u.locale).derivePath(u.path);(0,g.computeAddress)(c.privateKey)!==this.address&&b.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,h.defineReadOnly)(this,"_mnemonic",()=>null)}else{if(d.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&b.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,h.defineReadOnly)(this,"_signingKey",()=>e);else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);let f=new d.SigningKey(e);(0,h.defineReadOnly)(this,"_signingKey",()=>f)}(0,h.defineReadOnly)(this,"_mnemonic",()=>null),(0,h.defineReadOnly)(this,"address",(0,g.computeAddress)(this.publicKey))}t&&!i.zt.isProvider(t)&&b.throwArgumentError("invalid provider","provider",t),(0,h.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new w(this,e)}signTransaction(e){return(0,h.resolveProperties)(e).then(t=>{null!=t.from&&((0,n.getAddress)(t.from)!==this.address&&b.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);let r=this._signingKey().signDigest((0,c.keccak256)((0,g.serialize)(t)));return(0,g.serialize)(t,r)})}signMessage(e){return v(this,void 0,void 0,function*(){return(0,s.joinSignature)(this._signingKey().signDigest((0,a.r)(e)))})}_signTypedData(e,t,r){return v(this,void 0,void 0,function*(){let n=yield u.E.resolveNames(e,t,r,e=>(null==this.provider&&b.throwError("cannot resolve ENS names without a provider",y.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e)));return(0,s.joinSignature)(this._signingKey().signDigest(u.E.hash(n.domain,t,n.value)))})}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw Error("invalid callback");return t||(t={}),(0,p.HI)(this,e,t,r)}static createRandom(e){let t=(0,f.O)(16);e||(e={}),e.extraEntropy&&(t=(0,s.arrayify)((0,s.hexDataSlice)((0,c.keccak256)((0,s.concat)([t,e.extraEntropy])),0,16)));let r=(0,l.entropyToMnemonic)(t,e.locale);return w.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return(0,m.decryptJsonWallet)(e,t,r).then(e=>new w(e))}static fromEncryptedJsonSync(e,t){return new w((0,m.decryptJsonWalletSync)(e,t))}static fromMnemonic(e,t,r){return t||(t=l.defaultPath),new w(l.HDNode.fromMnemonic(e,null,r).derivePath(t))}}function A(e,t){return(0,g.recoverAddress)((0,a.r)(e),t)}function E(e,t,r,n){return(0,g.recoverAddress)(u.E.hash(e,t,r),n)}},37707:function(e,t,r){"use strict";r.r(t),r.d(t,{_fetchData:function(){return h},fetchJson:function(){return f},poll:function(){return d}});var n=r(59567),i=r(16441),o=r(6881),s=r(29251),a=r(1581);let u=new a.Logger("web/5.7.1");function l(e){return new Promise(t=>{setTimeout(t,e)})}function c(e,t){if(null==e)return null;if("string"==typeof e)return e;if((0,i.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,s.ZN)(e)}catch(r){}return(0,i.hexlify)(e)}return e}function h(e,t,r){let h="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;u.assertArgument(h>0&&h%1==0,"invalid connection throttle limit","connection.throttleLimit",h);let f="object"==typeof e?e.throttleCallback:null,d="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;u.assertArgument(d>0&&d%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",d);let p="object"==typeof e&&!!e.errorPassThrough,m={},g=null,y={method:"GET"},v=!1,b=12e4;if("string"==typeof e)g=e;else if("object"==typeof e){if((null==e||null==e.url)&&u.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"==typeof e.timeout&&e.timeout>0&&(b=e.timeout),e.headers)for(let w in e.headers)m[w.toLowerCase()]={key:w,value:String(e.headers[w])},["if-none-match","if-modified-since"].indexOf(w.toLowerCase())>=0&&(v=!0);if(y.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&u.throwError("basic authentication requires a secure https url",a.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});let A=e.user+":"+e.password;m.authorization={key:"Authorization",value:"Basic "+(0,n.c)((0,s.Y0)(A))}}null!=e.skipFetchSetup&&(y.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(y.fetchOptions=(0,o.shallowCopy)(e.fetchOptions))}let E=RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),k=g?g.match(E):null;if(k)try{var S;let P={statusCode:200,statusMessage:"OK",headers:{"content-type":k[1]||"text/plain"},body:k[2]?(0,n.J)(k[3]):(S=k[3],(0,s.Y0)(S.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))))},x=P.body;return r&&(x=r(P.body,P)),Promise.resolve(x)}catch(C){u.throwError("processing response error",a.Logger.errors.SERVER_ERROR,{body:c(k[1],k[2]),error:C,requestBody:null,requestMethod:"GET",url:g})}t&&(y.method="POST",y.body=t,null==m["content-type"]&&(m["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==m["content-length"]&&(m["content-length"]={key:"Content-Length",value:String(t.length)}));let _={};Object.keys(m).forEach(e=>{let t=m[e];_[t.key]=t.value}),y.headers=_;let O=function(){let e=null,t=new Promise(function(t,r){b&&(e=setTimeout(()=>{null!=e&&(e=null,r(u.makeError("timeout",a.Logger.errors.TIMEOUT,{requestBody:c(y.body,_["content-type"]),requestMethod:y.method,timeout:b,url:g})))},b))});return{promise:t,cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),R=function(){var e,t,n,o;return e=this,t=void 0,n=void 0,o=function*(){for(let e=0;e{a[t.toLowerCase()]=e}):o.headers.keys().forEach(e=>{a[e.toLowerCase()]=o.headers.get(e)}),{headers:a,statusCode:o.status,statusMessage:o.statusText,body:(0,i.arrayify)(new Uint8Array(s))}},new(o||(o=Promise))(function(e,t){function i(e){try{u(s.next(e))}catch(r){t(r)}}function a(e){try{u(s.throw(e))}catch(r){t(r)}}function u(t){var r;t.done?e(t.value):((r=t.value)instanceof o?r:new o(function(e){e(r)})).then(i,a)}u((s=s.apply(r,n||[])).next())})}(g,y),e=300)&&(O.cancel(),u.throwError("bad response",a.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:c(b,t.headers?t.headers["content-type"]:null),requestBody:c(y.body,_["content-type"]),requestMethod:y.method,url:g})),r)try{let w=yield r(b,t);return O.cancel(),w}catch(k){if(k.throttleRetry&&e{let n=null;if(null!=e)try{n=JSON.parse((0,s.ZN)(e))}catch(i){u.throwError("invalid JSON",a.Logger.errors.SERVER_ERROR,{body:e,error:i})}return r&&(n=r(n,t)),n},i=null;if(null!=t){i=(0,s.Y0)(t);let l="string"==typeof e?{url:e}:(0,o.shallowCopy)(e);if(l.headers){let c=0!==Object.keys(l.headers).filter(e=>"content-type"===e.toLowerCase()).length;c||(l.headers=(0,o.shallowCopy)(l.headers),l.headers["content-type"]="application/json")}else l.headers={"content-type":"application/json"};e=l}return h(e,i,n)}function d(e,t){return t||(t={}),null==(t=(0,o.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise(function(r,n){let i=null,o=!1,s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout(()=>{s()&&n(Error("timeout"))},t.timeout));let a=t.retryLimit,u=0;!function i(){return e().then(function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(++u>a){s()&&n(Error("retry limit reached"));return}let l=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));lt.ceiling&&(l=t.ceiling),setTimeout(i,l)}return null},function(e){s()&&n(e)})}()})}},78435:function(e,t,r){"use strict";r.r(t),r.d(t,{Wordlist:function(){return n.D},logger:function(){return n.k},wordlists:function(){return i.E}});var n=r(48812),i=r(10234)},48812:function(e,t,r){"use strict";r.d(t,{D:function(){return a},k:function(){return s}});var n=r(32046),i=r(6881),o=r(1581);let s=new o.Logger("wordlists/5.7.0");class a{constructor(e){s.checkAbstract(new.target,a),(0,i.defineReadOnly)(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){let t=[];for(let r=0;r<2048;r++){let i=e.getWord(r);if(r!==e.getWordIndex(i))return"0x";t.push(i)}return(0,n.id)(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}},10234:function(e,t,r){"use strict";r.d(t,{E:function(){return u}});var n=r(48812);let i=null;function o(e){if(null==i&&(i="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==n.D.check(e)))throw i=null,Error("BIP39 Wordlist for en (English) FAILED")}class s extends n.D{constructor(){super("en")}getWord(e){return o(this),i[e]}getWordIndex(e){return o(this),i.indexOf(e)}}let a=new s;n.D.register(a);let u={en:a}},82775:function(e,t,r){"use strict";r.d(t,{i:function(){return u}});var n=r(97231);r(26729);var i=new WeakMap,o=new WeakMap,s=new WeakSet,a=new WeakSet;class u extends n.I{constructor(){let{chains:e,options:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={name:"MetaMask",shimDisconnect:!0,shimChainChangedDisconnect:!0,...t};super({chains:e,options:r}),(0,n._)(this,a),(0,n._)(this,s),(0,n.t)(this,"id","metaMask"),(0,n.t)(this,"ready","undefined"!=typeof window&&!!(0,n.u)(this,a,c).call(this,window.ethereum)),(0,n.v)(this,i,{writable:!0,value:void 0}),(0,n.v)(this,o,{writable:!0,value:void 0}),(0,n.w)(this,o,r.UNSTABLE_shimOnConnectSelectAccount)}async connect(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,r,i,s;let a=await this.getProvider();if(!a)throw new n.d;if(a.on&&(a.on("accountsChanged",this.onAccountsChanged),a.on("chainChanged",this.onChainChanged),a.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"}),(0,n.x)(this,o)&&null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&!(null!==(r=(0,n.g)().storage)&&void 0!==r&&r.getItem(this.shimDisconnectKey))){let u=await a.request({method:"eth_accounts"}).catch(()=>[]),l=!!u[0];l&&await a.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]})}let c=await this.getAccount(),h=await this.getChainId(),f=this.isChainUnsupported(h);if(e&&h!==e){let d=await this.switchChain(e);h=d.id,f=this.isChainUnsupported(h)}return null!==(i=this.options)&&void 0!==i&&i.shimDisconnect&&(null===(s=(0,n.g)().storage)||void 0===s||s.setItem(this.shimDisconnectKey,!0)),{account:c,chain:{id:h,unsupported:f},provider:a}}catch(p){if(this.isUserRejectedRequestError(p))throw new n.U(p);if(-32002===p.code)throw new n.R(p);throw p}}async getProvider(){return"undefined"!=typeof window&&(0,n.w)(this,i,(0,n.u)(this,a,c).call(this,window.ethereum)),(0,n.x)(this,i)}}function l(e){let t=!!(null!=e&&e.isMetaMask);if(t&&(!e.isBraveWallet||e._events||e._state)&&!e.isAvalanche&&!e.isKuCoinWallet&&!e.isPortal&&!e.isTokenPocket&&!e.isTokenary)return e}function c(e){return null!=e&&e.providers?e.providers.find((0,n.u)(this,s,l)):(0,n.u)(this,s,l).call(this,e)}},81226:function(e,t,r){"use strict";r.d(t,{c:function(){return P},d:function(){return x}});let n={mainnet:"https://eth-mainnet.alchemyapi.io/v2",ropsten:"https://eth-ropsten.alchemyapi.io/v2",rinkeby:"https://eth-rinkeby.alchemyapi.io/v2",goerli:"https://eth-goerli.alchemyapi.io/v2",kovan:"https://eth-kovan.alchemyapi.io/v2",optimism:"https://opt-mainnet.g.alchemy.com/v2",optimismKovan:"https://opt-kovan.g.alchemy.com/v2",optimismGoerli:"https://opt-goerli.g.alchemy.com/v2",polygon:"https://polygon-mainnet.g.alchemy.com/v2",polygonMumbai:"https://polygon-mumbai.g.alchemy.com/v2",arbitrum:"https://arb-mainnet.g.alchemy.com/v2",arbitrumRinkeby:"https://arb-rinkeby.g.alchemy.com/v2",arbitrumGoerli:"https://arb-goerli.g.alchemy.com/v2"},i={mainnet:"https://mainnet.infura.io/v3",ropsten:"https://ropsten.infura.io/v3",rinkeby:"https://rinkeby.infura.io/v3",goerli:"https://goerli.infura.io/v3",kovan:"https://kovan.infura.io/v3",sepolia:"https://sepolia.infura.io/v3",optimism:"https://optimism-mainnet.infura.io/v3",optimismKovan:"https://optimism-kovan.infura.io/v3",optimismGoerli:"https://optimism-goerli.infura.io/v3",polygon:"https://polygon-mainnet.infura.io/v3",polygonMumbai:"https://polygon-mumbai.infura.io/v3",arbitrum:"https://arbitrum-mainnet.infura.io/v3",arbitrumRinkeby:"https://arbitrum-rinkeby.infura.io/v3",arbitrumGoerli:"https://arbitrum-goerli.infura.io/v3"},o={mainnet:"https://cloudflare-eth.com",ropsten:"https://rpc.ankr.com/eth_ropsten",rinkeby:"https://rpc.ankr.com/eth_rinkeby",goerli:"https://rpc.ankr.com/eth_goerli",kovan:`${i.kovan}/84842078b09946638c03157f83405213`,sepolia:"https://rpc.sepolia.org",optimism:"https://mainnet.optimism.io",optimismKovan:"https://kovan.optimism.io",optimismGoerli:"https://goerli.optimism.io",polygon:"https://polygon-rpc.com",polygonMumbai:"https://matic-mumbai.chainstacklabs.com",arbitrum:"https://arb1.arbitrum.io/rpc",arbitrumRinkeby:"https://rinkeby.arbitrum.io/rpc",arbitrumGoerli:"https://goerli-rollup.arbitrum.io/rpc"},s={mainnet:{name:"Etherscan",url:"https://etherscan.io"},ropsten:{name:"Etherscan",url:"https://ropsten.etherscan.io"},rinkeby:{name:"Etherscan",url:"https://rinkeby.etherscan.io"},goerli:{name:"Etherscan",url:"https://goerli.etherscan.io"},kovan:{name:"Etherscan",url:"https://kovan.etherscan.io"},sepolia:{name:"Etherscan",url:"https://sepolia.etherscan.io"},optimism:{name:"Etherscan",url:"https://optimistic.etherscan.io"},optimismKovan:{name:"Etherscan",url:"https://kovan-optimistic.etherscan.io"},optimismGoerli:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},polygon:{name:"PolygonScan",url:"https://polygonscan.com"},polygonMumbai:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},arbitrum:{name:"Arbiscan",url:"https://arbiscan.io"},arbitrumRinkeby:{name:"Arbiscan",url:"https://testnet.arbiscan.io"},arbitrumGoerli:{name:"Arbiscan",url:"https://goerli.arbiscan.io"}},a={mainnet:1,ropsten:3,rinkeby:4,goerli:5,kovan:42,sepolia:11155111,optimism:10,optimismKovan:69,optimismGoerli:420,polygon:137,polygonMumbai:80001,arbitrum:42161,arbitrumRinkeby:421611,arbitrumGoerli:421613,localhost:1337,hardhat:31337,foundry:31337},u={id:a.mainnet,name:"Ethereum",network:"homestead",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.mainnet,default:o.mainnet,infura:i.mainnet,public:o.mainnet},blockExplorers:{etherscan:s.mainnet,default:s.mainnet},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}},l={id:a.ropsten,name:"Ropsten",network:"ropsten",nativeCurrency:{name:"Ropsten Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.ropsten,default:o.ropsten,infura:i.ropsten,public:o.ropsten},blockExplorers:{etherscan:s.ropsten,default:s.ropsten},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:12063863},testnet:!0},c={id:a.rinkeby,name:"Rinkeby",network:"rinkeby",nativeCurrency:{name:"Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.rinkeby,default:o.rinkeby,infura:i.rinkeby,public:o.rinkeby},blockExplorers:{etherscan:s.rinkeby,default:s.rinkeby},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10299530},testnet:!0},h={id:a.goerli,name:"Goerli",network:"goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.goerli,default:o.goerli,infura:i.goerli,public:o.goerli},blockExplorers:{etherscan:s.goerli,default:s.goerli},ens:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670},testnet:!0},f={id:a.kovan,name:"Kovan",network:"kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.kovan,default:o.kovan,infura:i.kovan,public:o.kovan},blockExplorers:{etherscan:s.kovan,default:s.kovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:30285908},testnet:!0},d={id:a.sepolia,name:"Sepolia",network:"sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:o.sepolia,infura:i.sepolia,public:o.sepolia},blockExplorers:{etherscan:s.sepolia,default:s.sepolia},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},testnet:!0},p={id:a.optimism,name:"Optimism",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimism,default:o.optimism,infura:i.optimism,public:o.optimism},blockExplorers:{etherscan:s.optimism,default:s.optimism},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263}},m={id:a.optimismKovan,name:"Optimism Kovan",network:"optimism-kovan",nativeCurrency:{name:"Kovan Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimismKovan,default:o.optimismKovan,infura:i.optimismKovan,public:o.optimismKovan},blockExplorers:{etherscan:s.optimismKovan,default:s.optimismKovan},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1418387},testnet:!0},g={id:a.optimismGoerli,name:"Optimism Goerli",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.optimismGoerli,default:o.optimismGoerli,infura:i.optimismGoerli,public:o.optimismGoerli},blockExplorers:{etherscan:s.optimismGoerli,default:s.optimismGoerli},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:49461},testnet:!0},y={id:a.polygon,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:n.polygon,default:o.polygon,infura:i.polygon,public:o.polygon},blockExplorers:{etherscan:s.polygon,default:s.polygon},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}},v={id:a.polygonMumbai,name:"Polygon Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:n.polygonMumbai,default:o.polygonMumbai,infura:i.polygonMumbai,public:o.polygonMumbai},blockExplorers:{etherscan:s.polygonMumbai,default:s.polygonMumbai},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25444704},testnet:!0},b={id:a.arbitrum,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrum,default:o.arbitrum,infura:i.arbitrum,public:o.arbitrum},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://explorer.arbitrum.io"},etherscan:s.arbitrum,default:s.arbitrum},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}},w={id:a.arbitrumRinkeby,name:"Arbitrum Rinkeby",network:"arbitrum-rinkeby",nativeCurrency:{name:"Arbitrum Rinkeby Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrumRinkeby,default:o.arbitrumRinkeby,infura:i.arbitrumRinkeby,public:o.arbitrumRinkeby},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://rinkeby-explorer.arbitrum.io"},etherscan:s.arbitrumRinkeby,default:s.arbitrumRinkeby},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:10228837},testnet:!0},A={id:a.arbitrumGoerli,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:n.arbitrumGoerli,default:o.arbitrumGoerli,infura:i.arbitrumGoerli,public:o.arbitrumGoerli},blockExplorers:{arbitrum:{name:"Arbitrum Explorer",url:"https://goerli-rollup-explorer.arbitrum.io"},etherscan:s.arbitrumGoerli,default:s.arbitrumGoerli},multicall:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:88114},testnet:!0},E={id:a.localhost,name:"Localhost",network:"localhost",rpcUrls:{default:"http://127.0.0.1:8545"}},k={id:a.hardhat,name:"Hardhat",network:"hardhat",rpcUrls:{default:"http://127.0.0.1:8545"}},S={id:a.foundry,name:"Foundry",network:"foundry",rpcUrls:{default:"http://127.0.0.1:8545"}},P={mainnet:u,ropsten:l,rinkeby:c,goerli:h,kovan:f,sepolia:d,optimism:p,optimismGoerli:g,optimismKovan:m,polygon:y,polygonMumbai:v,arbitrum:b,arbitrumGoerli:A,arbitrumRinkeby:w,localhost:E,hardhat:k,foundry:S},x=[u,l,c,h,f]},97231:function(e,t,r){"use strict";let n;r.d(t,{C:function(){return _},I:function(){return j},R:function(){return N},S:function(){return T},U:function(){return B},_:function(){return v},a:function(){return O},b:function(){return R},d:function(){return M},f:function(){return Y},g:function(){return V},k:function(){return J},n:function(){return L},t:function(){return w},u:function(){return k},v:function(){return b},w:function(){return S},x:function(){return E}});let i=e=>(t,r,n)=>{let i=n.subscribe;n.subscribe=(e,t,r)=>{let o=e;if(t){let s=(null==r?void 0:r.equalityFn)||Object.is,a=e(n.getState());o=r=>{let n=e(r);if(!s(a,n)){let i=a;t(a=n,i)}},(null==r?void 0:r.fireImmediately)&&t(a,a)}return i(o)};let o=e(t,r,n);return o},o=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>o(e)(r),catch(e){return this}}}catch(n){return{then(e){return this},catch:e=>o(e)(n)}}},s=(e,t)=>(r,n,i)=>{let s,a,u={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,c=new Set,h=new Set;try{s=u.getStorage()}catch(f){}if(!s)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),r(...e)},n,i);let d=o(u.serialize),p=()=>{let e;let t=u.partialize({...n()}),r=d({state:t,version:u.version}).then(e=>s.setItem(u.name,e)).catch(t=>{e=t});if(e)throw e;return r},m=i.setState;i.setState=(e,t)=>{m(e,t),p()};let g=e((...e)=>{r(...e),p()},n,i),y=()=>{var e;if(!s)return;l=!1,c.forEach(e=>e(n()));let t=(null==(e=u.onRehydrateStorage)?void 0:e.call(u,n()))||void 0;return o(s.getItem.bind(s))(u.name).then(e=>{if(e)return u.deserialize(e)}).then(e=>{if(e){if("number"!=typeof e.version||e.version===u.version)return e.state;if(u.migrate)return u.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return r(a=u.merge(e,null!=(t=n())?t:g),!0),p()}).then(()=>{null==t||t(a,void 0),l=!0,h.forEach(e=>e(a))}).catch(e=>{null==t||t(void 0,e)})};return i.persist={setOptions(e){u={...u,...e},e.getStorage&&(s=e.getStorage())},clearStorage(){null==s||s.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(h.add(e),()=>{h.delete(e)})},y(),a||g},a=(e,t)=>(r,n,i)=>{let s,a={storage:function(e,t){let r;try{r=e()}catch(n){return}return{getItem(e){var n;let i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(n=r.getItem(e))?n:null;return o instanceof Promise?o.then(i):i(o)},setItem:(e,n)=>r.setItem(e,JSON.stringify(n,null==t?void 0:t.replacer)),removeItem:e=>r.removeItem(e)}}(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},u=!1,l=new Set,c=new Set,h=a.storage;if(!h)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...e)},n,i);let f=()=>{let e=a.partialize({...n()});return h.setItem(a.name,{state:e,version:a.version})},d=i.setState;i.setState=(e,t)=>{d(e,t),f()};let p=e((...e)=>{r(...e),f()},n,i),m=()=>{var e,t;if(!h)return;u=!1,l.forEach(e=>{var t;return e(null!=(t=n())?t:p)});let i=(null==(t=a.onRehydrateStorage)?void 0:t.call(a,null!=(e=n())?e:p))||void 0;return o(h.getItem.bind(h))(a.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===a.version)return e.state;if(a.migrate)return a.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return r(s=a.merge(e,null!=(t=n())?t:p),!0),f()}).then(()=>{null==i||i(s,void 0),s=n(),u=!0,c.forEach(e=>e(s))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions(e){a={...a,...e},e.storage&&(h=e.storage)},clearStorage(){null==h||h.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>m(),hasHydrated:()=>u,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},a.skipHydration||m(),s||p},u=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),s(e,t)):a(e,t),l=e=>{let t;let r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let o=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(e=>e(t,o))}},i=()=>t,o=e=>(r.add(e),()=>r.delete(e)),s=()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()},a={setState:n,getState:i,subscribe:o,destroy:s};return t=e(n,i,a),a},c=e=>e?l(e):l;var h=e=>(console.warn("[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'."),c(e)),f=r(241),d=r(56371),p=r(26729),m=r.n(p),g=r(81226);function y(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function v(e,t){y(e,t),t.add(e)}function b(e,t,r){y(e,t),t.set(e,r)}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e,t,r){if(!t.has(e))throw TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function E(e,t){var r=A(e,t,"get");return r.get?r.get.call(e):r.value}function k(e,t,r){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return r}function S(e,t,r){var n=A(e,t,"set");return!function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=r}}(e,n,r),r}class P extends Error{constructor(e,t,r,n){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),w(this,"code",void 0),w(this,"data",void 0),w(this,"internal",void 0),this.code=e,this.data=n,this.internal=r}}class x extends P{constructor(e,t,r,n){if(!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r,n)}}class C extends Error{constructor(){super(...arguments),w(this,"name","AddChainError"),w(this,"message","Error adding chain")}}class _ extends Error{constructor(e){let{activeChain:t,targetChain:r}=e;super(`Chain mismatch: Expected "${r}", received "${t}".`),w(this,"name","ChainMismatchError")}}class O extends Error{constructor(e){let{chainId:t,connectorId:r}=e;super(`Chain "${t}" not configured for connector "${r}".`),w(this,"name","ChainNotConfigured")}}class R extends Error{constructor(){super(...arguments),w(this,"name","ConnectorAlreadyConnectedError"),w(this,"message","Connector already connected")}}class M extends Error{constructor(){super(...arguments),w(this,"name","ConnectorNotFoundError"),w(this,"message","Connector not found")}}class N extends P{constructor(e){super(-32002,"Resource unavailable",e),w(this,"name","ResourceUnavailable")}}class I extends x{constructor(e){super(4902,"Error switching chain",e),w(this,"name","SwitchChainError")}}class T extends Error{constructor(e){let{connector:t}=e;super(`"${t.name}" does not support programmatic chain switching.`),w(this,"name","SwitchChainNotSupportedError")}}class B extends x{constructor(e){super(4001,"User rejected request",e),w(this,"name","UserRejectedRequestError")}}function L(e){return"string"==typeof e?Number.parseInt(e,"0x"===e.trim().substring(0,2)?16:10):"bigint"==typeof e?Number(e):e}class F extends m(){constructor(e){let{chains:t=g.d,options:r}=e;super(),w(this,"id",void 0),w(this,"name",void 0),w(this,"chains",void 0),w(this,"options",void 0),w(this,"ready",void 0),this.chains=t,this.options=r}getBlockExplorerUrls(e){let{default:t,...r}=e.blockExplorers??{};if(t)return[t.url,...Object.values(r).map(e=>e.url)]}isChainUnsupported(e){return!this.chains.some(t=>t.id===e)}}var D=new WeakMap,U=new WeakMap;class j extends F{constructor(){let{chains:e,options:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={shimDisconnect:!0,shimChainChangedDisconnect:!0,...t};super({chains:e,options:r}),w(this,"id",void 0),w(this,"name",void 0),w(this,"ready","undefined"!=typeof window&&!!window.ethereum),b(this,D,{writable:!0,value:void 0}),b(this,U,{writable:!0,value:void 0}),w(this,"shimDisconnectKey","injected.shimDisconnect"),w(this,"onAccountsChanged",e=>{0===e.length?this.emit("disconnect"):this.emit("change",{account:(0,d.getAddress)(e[0])})}),w(this,"onChainChanged",e=>{let t=L(e),r=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:r}})}),w(this,"onDisconnect",()=>{var e,t,r;if(null!==(e=this.options)&&void 0!==e&&e.shimChainChangedDisconnect&&E(this,U)){S(this,U,!1);return}this.emit("disconnect"),null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&(null===(r=V().storage)||void 0===r||r.removeItem(this.shimDisconnectKey))});let n="Injected",i=r.name;if("string"==typeof i)n=i;else if("undefined"!=typeof window){let o=function(e){var t;if(!e)return"Injected";let r=e=>e.isAvalanche?"Core Wallet":e.isBitKeep?"BitKeep":e.isBraveWallet?"Brave Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isExodus?"Exodus":e.isFrame?"Frame":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOpera?"Opera":e.isPortal?"Ripio Portal":e.isTally?"Tally":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isMetaMask?"MetaMask":void 0;if(null!==(t=e.providers)&&void 0!==t&&t.length){let n=new Set,i=1;for(let o of e.providers){let s=r(o);s||(s=`Unknown Wallet #${i}`,i+=1),n.add(s)}let a=[...n];return a.length?a:a[0]??"Injected"}return r(e)??"Injected"}(window.ethereum);n=i?i(o):"string"==typeof o?o:o[0]}this.id="injected",this.name=n}async connect(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,r;let n=await this.getProvider();if(!n)throw new M;n.on&&(n.on("accountsChanged",this.onAccountsChanged),n.on("chainChanged",this.onChainChanged),n.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let i=await this.getAccount(),o=await this.getChainId(),s=this.isChainUnsupported(o);if(e&&o!==e){let a=await this.switchChain(e);o=a.id,s=this.isChainUnsupported(o)}return null!==(t=this.options)&&void 0!==t&&t.shimDisconnect&&(null===(r=V().storage)||void 0===r||r.setItem(this.shimDisconnectKey,!0)),{account:i,chain:{id:o,unsupported:s},provider:n}}catch(u){if(this.isUserRejectedRequestError(u))throw new B(u);if(-32002===u.code)throw new N(u);throw u}}async disconnect(){var e,t;let r=await this.getProvider();null!=r&&r.removeListener&&(r.removeListener("accountsChanged",this.onAccountsChanged),r.removeListener("chainChanged",this.onChainChanged),r.removeListener("disconnect",this.onDisconnect),null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&(null===(t=V().storage)||void 0===t||t.removeItem(this.shimDisconnectKey)))}async getAccount(){let e=await this.getProvider();if(!e)throw new M;let t=await e.request({method:"eth_requestAccounts"});return(0,d.getAddress)(t[0])}async getChainId(){let e=await this.getProvider();if(!e)throw new M;return e.request({method:"eth_chainId"}).then(L)}async getProvider(){return"undefined"!=typeof window&&window.ethereum&&S(this,D,window.ethereum),E(this,D)}async getSigner(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,r]=await Promise.all([this.getProvider(),this.getAccount()]);return new f.Q(t,e).getSigner(r)}async isAuthorized(){try{var e,t;if(null!==(e=this.options)&&void 0!==e&&e.shimDisconnect&&!(null!==(t=V().storage)&&void 0!==t&&t.getItem(this.shimDisconnectKey)))return!1;let r=await this.getProvider();if(!r)throw new M;let n=await r.request({method:"eth_accounts"}),i=n[0];return!!i}catch{return!1}}async switchChain(e){var t,r,n;null!==(t=this.options)&&void 0!==t&&t.shimChainChangedDisconnect&&S(this,U,!0);let i=await this.getProvider();if(!i)throw new M;let o=(0,d.hexValue)(e);try{return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]}),this.chains.find(t=>t.id===e)??{id:e,name:`Chain ${o}`,network:`${o}`,rpcUrls:{default:""}}}catch(u){let s=this.chains.find(t=>t.id===e);if(!s)throw new O({chainId:e,connectorId:this.id});if(4902===u.code||(null==u?void 0:null===(r=u.data)||void 0===r?void 0:null===(n=r.originalError)||void 0===n?void 0:n.code)===4902)try{return await i.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[s.rpcUrls.public??s.rpcUrls.default],blockExplorerUrls:this.getBlockExplorerUrls(s)}]}),s}catch(a){if(this.isUserRejectedRequestError(a))throw new B(u);throw new C}if(this.isUserRejectedRequestError(u))throw new B(u);throw new I(u)}}async watchAsset(e){let{address:t,decimals:r=18,image:n,symbol:i}=e,o=await this.getProvider();if(!o)throw new M;return o.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,decimals:r,image:n,symbol:i}}})}isUserRejectedRequestError(e){return 4001===e.code}}let q={getItem:e=>"",setItem:(e,t)=>null,removeItem:e=>null},G="store";var K=new WeakMap,H=new WeakMap,z=new WeakSet;class Q{constructor(e){let t,{autoConnect:r=!1,connectors:n=[new j],provider:o,storage:s=function(e){let{storage:t,key:r="wagmi"}=e;return{...t,getItem:function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=t.getItem(`${r}.${e}`);try{return i?JSON.parse(i):n}catch(o){return console.warn(o),n}},setItem(e,n){if(null===n)t.removeItem(`${r}.${e}`);else try{t.setItem(`${r}.${e}`,JSON.stringify(n))}catch(i){console.error(i)}},removeItem:e=>t.removeItem(`${r}.${e}`)}}({storage:"undefined"!=typeof window?window.localStorage:q}),logger:a={warn:console.warn},webSocketProvider:l}=e;v(this,z),w(this,"config",void 0),w(this,"providers",new Map),w(this,"storage",void 0),w(this,"store",void 0),w(this,"webSocketProviders",new Map),b(this,K,{writable:!0,value:void 0}),b(this,H,{writable:!0,value:void 0}),this.config={autoConnect:r,connectors:n,logger:a,provider:o,storage:s,webSocketProvider:l};let c="disconnected";if(r)try{var f,d,p;let m=s.getItem(G,""),g=null===(f=JSON.parse(m||"{}"))||void 0===f?void 0:null===(d=f.state)||void 0===d?void 0:d.data;c=null!=g&&g.account?"reconnecting":"connecting",t=null==g?void 0:null===(p=g.chain)||void 0===p?void 0:p.id}catch(y){}this.store=h(i(u(()=>({connectors:"function"==typeof n?n():n,provider:this.getProvider({chainId:t}),status:c,webSocketProvider:this.getWebSocketProvider({chainId:t})}),{name:G,getStorage:()=>s,partialize(e){var t,n;return{...r&&{data:{account:null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.account,chain:null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.chain}},chains:null==e?void 0:e.chains}},version:1}))),this.storage=s,S(this,H,null==s?void 0:s.getItem("wallet")),k(this,z,W).call(this),r&&"undefined"!=typeof window&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var e,t;return null===(e=this.data)||void 0===e?void 0:null===(t=e.chain)||void 0===t?void 0:t.id}get provider(){return this.store.getState().provider}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketProvider(){return this.store.getState().webSocketProvider}setState(e){let t="function"==typeof e?e(this.store.getState()):e;this.store.setState(t,!0)}clearState(){this.setState(e=>({...e,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var e,t;this.connector&&await (null===(e=(t=this.connector).disconnect)||void 0===e?void 0:e.call(t)),S(this,K,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(E(this,K))return;S(this,K,!0),this.setState(e=>{var t;return{...e,status:null!==(t=e.data)&&void 0!==t&&t.account?"reconnecting":"connecting"}});let e=E(this,H)?[...this.connectors].sort(e=>e.id===E(this,H)?-1:1):this.connectors,t=!1;for(let r of e){if(!r.ready||!r.isAuthorized)continue;let n=await r.isAuthorized();if(!n)continue;let i=await r.connect();this.setState(e=>({...e,connector:r,chains:null==r?void 0:r.chains,data:i,status:"connected"})),t=!0;break}return t||this.setState(e=>({...e,data:void 0,status:"disconnected"})),S(this,K,!1),this.data}getProvider(){let{bust:e,chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.providers.get(t??-1);if(r&&!e)return r;let{provider:n}=this.config;return r="function"==typeof n?n({chainId:t}):n,this.providers.set(t??-1,r),r}getWebSocketProvider(){let{bust:e,chainId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.webSocketProviders.get(t??-1);if(r&&!e)return r;let{webSocketProvider:n}=this.config;return(r="function"==typeof n?n({chainId:t}):n)&&this.webSocketProviders.set(t??-1,r),r}setLastUsedConnector(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===(e=this.storage)||void 0===e||e.setItem("wallet",t)}}function W(){let e=e=>{this.setState(t=>({...t,data:{...t.data,...e}}))},t=()=>{this.clearState()},r=e=>{this.setState(t=>({...t,error:e}))};this.store.subscribe(e=>{let{connector:t}=e;return t},(n,i)=>{var o,s,a,u,l,c;null==i||null===(o=i.off)||void 0===o||o.call(i,"change",e),null==i||null===(s=i.off)||void 0===s||s.call(i,"disconnect",t),null==i||null===(a=i.off)||void 0===a||a.call(i,"error",r),n&&(null===(u=n.on)||void 0===u||u.call(n,"change",e),null===(l=n.on)||void 0===l||l.call(n,"disconnect",t),null===(c=n.on)||void 0===c||c.call(n,"error",r))});let{provider:n,webSocketProvider:i}=this.config;("function"==typeof n||"function"==typeof i)&&this.store.subscribe(e=>{var t;let{data:r}=e;return null==r?void 0:null===(t=r.chain)||void 0===t?void 0:t.id},e=>{this.setState(t=>({...t,provider:this.getProvider({bust:!0,chainId:e}),webSocketProvider:this.getWebSocketProvider({bust:!0,chainId:e})}))})}function J(e){let t=new Q(e);return n=t,t}function V(){if(!n)throw Error("No wagmi client found. Ensure you have set up a client: https://wagmi.sh/docs/client");return n}function Y(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=V();return e&&t.getProvider({chainId:e})||t.provider}},2984:function(e,t,r){"use strict";r.d(t,{QB:function(){return a},$j:function(){return l},vZ:function(){return function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){let n,i;if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)&&Array.isArray(r)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();let o=Object.keys(t);if((n=o.length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){let s=o[i];if(s&&!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},zP:function(){return c},em:function(){return u},DG:function(){return d},D0:function(){return p},uN:function(){return h},Hy:function(){return m},xq:function(){return g},If:function(){return y},uH:function(){return v},QC:function(){return b},b0:function(){return f},rn:function(){return w}});var n=r(97231),i=r(51619),o=r(64146),s=(e,t)=>(console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`."),function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[r,n]of e)if(!Object.is(n,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let i of e)if(!t.has(i))return!1;return!0}let o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(let s=0;s2&&void 0!==arguments[2]?arguments[2]:{};if(!e.length)throw Error("must have at least one chain");if(o{let{id:t}=e;return t===c.id})||(a=[...a,d.chain]),u[c.id]=[...u[c.id]||[],d.provider],d.webSocketProvider&&(l[c.id]=[...l[c.id]||[],d.webSocketProvider]))}if(!h)throw Error(`Could not find valid provider configuration for chain "${c.name}". + +You may need to add \`jsonRpcProvider\` to \`configureChains\` with the chain's RPC URLs. +Read more: https://wagmi.sh/docs/providers/jsonRpc`)}return{chains:a,provider(t){let l,{chainId:c}=t,h=a.find(e=>e.id===c)??e[0],f=u[h.id];if(!f||!f[0])throw Error(`No providers configured for chain "${h.id}"`);return l=1===f.length?f[0]():function e(t,r,n,o){let{stallTimeout:s}=o;try{return new i.H(n.map((e,t)=>{let r=e();return{provider:r,priority:r.priority??t,stallTimeout:r.stallTimeout??s,weight:r.weight}}),t)}catch(u){var a;if(null!=u&&null!==(a=u.message)&&void 0!==a&&a.includes("quorum will always fail; larger than total weight")){if(t===r)throw u;return e(t-1,r,n,{stallTimeout:s})}throw u}}(o,r,f,{stallTimeout:s}),42220===h.id&&(l.formatter.formats.block={...l.formatter.formats.block,difficulty:()=>0,gasLimit:()=>0}),Object.assign(l,{chains:a,pollingInterval:n})},webSocketProvider(t){var r;let{chainId:n}=t,i=a.find(e=>e.id===n)??e[0],o=l[i.id];if(!o)return;let s=null===(r=o[0])||void 0===r?void 0:r.call(o);return s&&42220===i.id&&(s.formatter.formats.block={...s.formatter.formats.block,difficulty:()=>0,gasLimit:()=>0}),Object.assign(s||{},{chains:a})}}}r(26729);let u=[{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:[{name:"",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{name:"",type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];async function l(e){let{chainId:t,connector:r}=e,i=(0,n.g)(),o=i.connector;if(r.id===(null==o?void 0:o.id))throw new n.b;try{i.setState(e=>({...e,status:"connecting"}));let s=await r.connect({chainId:t});return i.setLastUsedConnector(r.id),i.setState(e=>({...e,connector:r,chains:null==r?void 0:r.chains,data:s,status:"connected"})),i.storage.setItem("connected",!0),{...s,connector:r}}catch(a){throw i.setState(e=>({...e,status:e.connector?"connected":"disconnected"})),a}}async function c(){let e=(0,n.g)();e.connector&&await e.connector.disconnect(),e.clearState(),e.storage.removeItem("connected")}function h(e){let{address:t,abi:r,signerOrProvider:n}=e;return new o.Contract(t,r,n)}function f(e,t){let r=(0,n.g)(),i=async()=>t((0,n.f)(e)),o=r.subscribe(e=>{let{provider:t}=e;return t},i);return o}async function d(){var e,t;let{chainId:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,n.g)(),o=await (null===(e=i.connector)||void 0===e?void 0:null===(t=e.getSigner)||void 0===t?void 0:t.call(e,{chainId:r}))||null;return o}function p(){let{data:e,connector:t,status:r}=(0,n.g)();switch(r){case"connected":return{address:null==e?void 0:e.account,connector:t,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:null==e?void 0:e.account,connector:t,isConnected:!!(null!=e&&e.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:r};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:r}}}function m(){var e,t,r;let i=(0,n.g)(),o=null===(e=i.data)||void 0===e?void 0:null===(t=e.chain)||void 0===t?void 0:t.id,s=i.chains??[],a=[...i.provider.chains||[],...s].find(e=>e.id===o)??{id:o,name:`Chain ${o}`,network:`${o}`,rpcUrls:{default:""}};return{chain:o?{...a,...null===(r=i.data)||void 0===r?void 0:r.chain,id:o}:void 0,chains:s}}async function g(e){let{domain:t,types:r,value:i}=e,o=await d();if(!o)throw new n.d;let{chainId:s}=t,a=s?(0,n.n)(s):void 0;return a&&function(e){var t,r,i,o;let{chainId:s,signer:a}=e,{chain:u,chains:l}=m(),c=null==u?void 0:u.id;if(c&&s!==c)throw new n.C({activeChain:(null===(t=l.find(e=>e.id===c))||void 0===t?void 0:t.name)??`Chain ${c}`,targetChain:(null===(r=l.find(e=>e.id===s))||void 0===r?void 0:r.name)??`Chain ${s}`});if(a){let h=null===(i=a.provider)||void 0===i?void 0:null===(o=i.network)||void 0===o?void 0:o.chainId;if(h&&s!==h){let f=(0,n.g)().connector;throw new n.a({chainId:s,connectorId:(null==f?void 0:f.id)??"unknown"})}}}({chainId:a,signer:o}),o._signTypedData(t,r,i)}async function y(e){let{chainId:t}=e,{connector:r}=(0,n.g)();if(!r)throw new n.d;if(!r.switchChain)throw new n.S({connector:r});return r.switchChain(t)}function v(e){let{selector:t=e=>e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.g)(),i=()=>e(p()),o=r.subscribe(e=>{let{data:r,connector:n,status:i}=e;return t({address:null==r?void 0:r.account,connector:n,status:i})},i,{equalityFn:s});return o}function b(e){let{selector:t=e=>e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.g)(),i=()=>e(m()),o=r.subscribe(e=>{var r;let{data:n,chains:i}=e;return t({chainId:null==n?void 0:null===(r=n.chain)||void 0===r?void 0:r.id,chains:i})},i,{equalityFn:s});return o}function w(e,t){let{chainId:r}=e,i=(0,n.g)(),o=async()=>t(await d({chainId:r})),a=i.subscribe(e=>{var t;let{data:r,connector:n}=e;return{account:null==r?void 0:r.account,chainId:null==r?void 0:null===(t=r.chain)||void 0===t?void 0:t.id,connector:n}},o,{equalityFn:s});return a}},78826:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function s(e,t,r,n,i){(null!=n||null!=i)&&(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var a,u=(a="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+a[15&n])}return t.join("")}}),l={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],k=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function P(e){for(var t=[],r=0;r>2,this._Ke[o][t%4]=i[t],this._Kd[e-o][t%4]=i[t];for(var o,s,a=0,u=n;u>16&255]<<24^h[s>>8&255]<<16^h[255&s]<<8^h[s>>24&255]^c[a]<<24,a+=1,8!=n)for(var t=1;t>8&255]<<8^h[s>>16&255]<<16^h[s>>24&255]<<24;for(var t=n/2+1;t>2,d=u%4,this._Ke[f][d]=i[t],this._Kd[e-f][d]=i[t++],u++}for(var f=1;f>24&255]^E[s>>16&255]^k[s>>8&255]^S[255&s]},x.prototype.encrypt=function(e){if(16!=e.length)throw Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=P(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s>24&255]^p[n[(i+1)%4]>>16&255]^m[n[(i+2)%4]>>8&255]^g[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}for(var a,u=o(16),i=0;i<4;i++)a=this._Ke[t][i],u[4*i]=(h[n[i]>>24&255]^a>>24)&255,u[4*i+1]=(h[n[(i+1)%4]>>16&255]^a>>16)&255,u[4*i+2]=(h[n[(i+2)%4]>>8&255]^a>>8)&255,u[4*i+3]=(h[255&n[(i+3)%4]]^a)&255;return u},x.prototype.decrypt=function(e){if(16!=e.length)throw Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=P(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s>24&255]^v[n[(i+3)%4]>>16&255]^b[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}for(var a,u=o(16),i=0;i<4;i++)a=this._Kd[t][i],u[4*i]=(f[n[i]>>24&255]^a>>24)&255,u[4*i+1]=(f[n[(i+3)%4]>>16&255]^a>>16)&255,u[4*i+2]=(f[n[(i+2)%4]>>8&255]^a>>8)&255,u[4*i+3]=(f[255&n[(i+1)%4]]^a)&255;return u};var C=function(e){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new x(e)};C.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},M.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},M.prototype.increment=function(){for(var e=15;e>=0;e--)if(255===this._counter[e])this._counter[e]=0;else{this._counter[e]++;break}};var N=function(e,t){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof M||(t=new M(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new x(e)};N.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}}},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=o(e.length+t);s(e,r);for(var n=e.length;n16)throw Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}for(r=0,t=o(t);rt)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var a=(e=n).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var u=e.slice(0,a),l=e.slice(a+1);if(l.length<6)return"Data too short";var c=s(u);if("string"==typeof c)return c;for(var h=[],f=0;f=l.length||h.push(p)}return 1!==c?"Invalid checksum for "+e:{prefix:u,words:h}}function u(e,t,r,n){for(var i=0,o=0,s=(1<=r;)a.push(i>>(o-=r)&s);if(n)o>0&&a.push(i<=t)return"Excess padding";if(i<n)throw TypeError("Exceeds length limit");var i=s(e=e.toLowerCase());if("string"==typeof i)throw Error(i);for(var a=e+"1",u=0;u>5!=0)throw Error("Non 5-bit word");i=o(i)^l,a+=t.charAt(l)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){var c=i>>(5-u)*5&31;a+=t.charAt(c)}return a},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw Error(t)}}},13550:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{d="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(46601).Buffer}catch(s){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function l(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&s0?e:t},o.min=function(e,t){return 0>e.cmp(t)?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;s-=3)o=e[s]|e[s-1]<<8|e[s-2]<<16,this.words[i]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var n,i=0;i=t;i-=2)n=u(e,t,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(h){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d,p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var l=1;l>>26,h=67108863&u,f=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=f;d++){var p=l-d|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[d])+h)/67108864|0,h=67108863&s}r.words[l]=0|h,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}o.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?p[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=m[e],c=g[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modrn(c).toString(e);r=(h=h.idivn(c)).isZero()?f+r:p[l-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},d&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(d,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=e.allocUnsafe?e.allocUnsafe(o):new e(o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var t,r,n,i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,n=this.iadd(e);return e.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(t=this,r=e):(t=e,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&n;for(;0!==o&&s>26,this.words[s]=67108863&n;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,A=b>>>13,E=0|s[4],k=8191&E,S=E>>>13,P=0|s[5],x=8191&P,C=P>>>13,_=0|s[6],O=8191&_,R=_>>>13,M=0|s[7],N=8191&M,I=M>>>13,T=0|s[8],B=8191&T,L=T>>>13,F=0|s[9],D=8191&F,U=F>>>13,j=0|a[0],q=8191&j,G=j>>>13,K=0|a[1],H=8191&K,z=K>>>13,Q=0|a[2],W=8191&Q,J=Q>>>13,V=0|a[3],Y=8191&V,Z=V>>>13,$=0|a[4],X=8191&$,ee=$>>>13,et=0|a[5],er=8191&et,en=et>>>13,ei=0|a[6],eo=8191&ei,es=ei>>>13,ea=0|a[7],eu=8191&ea,el=ea>>>13,ec=0|a[8],eh=8191&ec,ef=ec>>>13,ed=0|a[9],ep=8191&ed,em=ed>>>13;r.negative=e.negative^t.negative,r.length=19;var eg=(l+(n=Math.imul(h,q))|0)+((8191&(i=(i=Math.imul(h,G))+Math.imul(f,q)|0))<<13)|0;l=((o=Math.imul(f,G))+(i>>>13)|0)+(eg>>>26)|0,eg&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,G))+Math.imul(m,q)|0,o=Math.imul(m,G);var ey=(l+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(f,H)|0))<<13)|0;l=((o=o+Math.imul(f,z)|0)+(i>>>13)|0)+(ey>>>26)|0,ey&=67108863,n=Math.imul(y,q),i=(i=Math.imul(y,G))+Math.imul(v,q)|0,o=Math.imul(v,G),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,z)|0;var ev=(l+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,W)|0))<<13)|0;l=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ev>>>26)|0,ev&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,G))+Math.imul(A,q)|0,o=Math.imul(A,G),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,z)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,z)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0;var eb=(l+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(f,Y)|0))<<13)|0;l=((o=o+Math.imul(f,Z)|0)+(i>>>13)|0)+(eb>>>26)|0,eb&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,G))+Math.imul(S,q)|0,o=Math.imul(S,G),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var ew=(l+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(f,X)|0))<<13)|0;l=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(ew>>>26)|0,ew&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,G))+Math.imul(C,q)|0,o=Math.imul(C,G),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,z)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var eA=(l+(n=n+Math.imul(h,er)|0)|0)+((8191&(i=(i=i+Math.imul(h,en)|0)+Math.imul(f,er)|0))<<13)|0;l=((o=o+Math.imul(f,en)|0)+(i>>>13)|0)+(eA>>>26)|0,eA&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,G))+Math.imul(R,q)|0,o=Math.imul(R,G),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,z)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,z)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,ee)|0,n=n+Math.imul(p,er)|0,i=(i=i+Math.imul(p,en)|0)+Math.imul(m,er)|0,o=o+Math.imul(m,en)|0;var eE=(l+(n=n+Math.imul(h,eo)|0)|0)+((8191&(i=(i=i+Math.imul(h,es)|0)+Math.imul(f,eo)|0))<<13)|0;l=((o=o+Math.imul(f,es)|0)+(i>>>13)|0)+(eE>>>26)|0,eE&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,G))+Math.imul(I,q)|0,o=Math.imul(I,G),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,z)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,er)|0,i=(i=i+Math.imul(y,en)|0)+Math.imul(v,er)|0,o=o+Math.imul(v,en)|0,n=n+Math.imul(p,eo)|0,i=(i=i+Math.imul(p,es)|0)+Math.imul(m,eo)|0,o=o+Math.imul(m,es)|0;var ek=(l+(n=n+Math.imul(h,eu)|0)|0)+((8191&(i=(i=i+Math.imul(h,el)|0)+Math.imul(f,eu)|0))<<13)|0;l=((o=o+Math.imul(f,el)|0)+(i>>>13)|0)+(ek>>>26)|0,ek&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,G))+Math.imul(L,q)|0,o=Math.imul(L,G),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,z)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,z)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,Z)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,er)|0,i=(i=i+Math.imul(w,en)|0)+Math.imul(A,er)|0,o=o+Math.imul(A,en)|0,n=n+Math.imul(y,eo)|0,i=(i=i+Math.imul(y,es)|0)+Math.imul(v,eo)|0,o=o+Math.imul(v,es)|0,n=n+Math.imul(p,eu)|0,i=(i=i+Math.imul(p,el)|0)+Math.imul(m,eu)|0,o=o+Math.imul(m,el)|0;var eS=(l+(n=n+Math.imul(h,eh)|0)|0)+((8191&(i=(i=i+Math.imul(h,ef)|0)+Math.imul(f,eh)|0))<<13)|0;l=((o=o+Math.imul(f,ef)|0)+(i>>>13)|0)+(eS>>>26)|0,eS&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,G))+Math.imul(U,q)|0,o=Math.imul(U,G),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,z)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,z)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(x,X)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(k,er)|0,i=(i=i+Math.imul(k,en)|0)+Math.imul(S,er)|0,o=o+Math.imul(S,en)|0,n=n+Math.imul(w,eo)|0,i=(i=i+Math.imul(w,es)|0)+Math.imul(A,eo)|0,o=o+Math.imul(A,es)|0,n=n+Math.imul(y,eu)|0,i=(i=i+Math.imul(y,el)|0)+Math.imul(v,eu)|0,o=o+Math.imul(v,el)|0,n=n+Math.imul(p,eh)|0,i=(i=i+Math.imul(p,ef)|0)+Math.imul(m,eh)|0,o=o+Math.imul(m,ef)|0;var eP=(l+(n=n+Math.imul(h,ep)|0)|0)+((8191&(i=(i=i+Math.imul(h,em)|0)+Math.imul(f,ep)|0))<<13)|0;l=((o=o+Math.imul(f,em)|0)+(i>>>13)|0)+(eP>>>26)|0,eP&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(x,er)|0,i=(i=i+Math.imul(x,en)|0)+Math.imul(C,er)|0,o=o+Math.imul(C,en)|0,n=n+Math.imul(k,eo)|0,i=(i=i+Math.imul(k,es)|0)+Math.imul(S,eo)|0,o=o+Math.imul(S,es)|0,n=n+Math.imul(w,eu)|0,i=(i=i+Math.imul(w,el)|0)+Math.imul(A,eu)|0,o=o+Math.imul(A,el)|0,n=n+Math.imul(y,eh)|0,i=(i=i+Math.imul(y,ef)|0)+Math.imul(v,eh)|0,o=o+Math.imul(v,ef)|0;var ex=(l+(n=n+Math.imul(p,ep)|0)|0)+((8191&(i=(i=i+Math.imul(p,em)|0)+Math.imul(m,ep)|0))<<13)|0;l=((o=o+Math.imul(m,em)|0)+(i>>>13)|0)+(ex>>>26)|0,ex&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,J))+Math.imul(U,W)|0,o=Math.imul(U,J),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(O,er)|0,i=(i=i+Math.imul(O,en)|0)+Math.imul(R,er)|0,o=o+Math.imul(R,en)|0,n=n+Math.imul(x,eo)|0,i=(i=i+Math.imul(x,es)|0)+Math.imul(C,eo)|0,o=o+Math.imul(C,es)|0,n=n+Math.imul(k,eu)|0,i=(i=i+Math.imul(k,el)|0)+Math.imul(S,eu)|0,o=o+Math.imul(S,el)|0,n=n+Math.imul(w,eh)|0,i=(i=i+Math.imul(w,ef)|0)+Math.imul(A,eh)|0,o=o+Math.imul(A,ef)|0;var eC=(l+(n=n+Math.imul(y,ep)|0)|0)+((8191&(i=(i=i+Math.imul(y,em)|0)+Math.imul(v,ep)|0))<<13)|0;l=((o=o+Math.imul(v,em)|0)+(i>>>13)|0)+(eC>>>26)|0,eC&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,Z))+Math.imul(U,Y)|0,o=Math.imul(U,Z),n=n+Math.imul(B,X)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(N,er)|0,i=(i=i+Math.imul(N,en)|0)+Math.imul(I,er)|0,o=o+Math.imul(I,en)|0,n=n+Math.imul(O,eo)|0,i=(i=i+Math.imul(O,es)|0)+Math.imul(R,eo)|0,o=o+Math.imul(R,es)|0,n=n+Math.imul(x,eu)|0,i=(i=i+Math.imul(x,el)|0)+Math.imul(C,eu)|0,o=o+Math.imul(C,el)|0,n=n+Math.imul(k,eh)|0,i=(i=i+Math.imul(k,ef)|0)+Math.imul(S,eh)|0,o=o+Math.imul(S,ef)|0;var e_=(l+(n=n+Math.imul(w,ep)|0)|0)+((8191&(i=(i=i+Math.imul(w,em)|0)+Math.imul(A,ep)|0))<<13)|0;l=((o=o+Math.imul(A,em)|0)+(i>>>13)|0)+(e_>>>26)|0,e_&=67108863,n=Math.imul(D,X),i=(i=Math.imul(D,ee))+Math.imul(U,X)|0,o=Math.imul(U,ee),n=n+Math.imul(B,er)|0,i=(i=i+Math.imul(B,en)|0)+Math.imul(L,er)|0,o=o+Math.imul(L,en)|0,n=n+Math.imul(N,eo)|0,i=(i=i+Math.imul(N,es)|0)+Math.imul(I,eo)|0,o=o+Math.imul(I,es)|0,n=n+Math.imul(O,eu)|0,i=(i=i+Math.imul(O,el)|0)+Math.imul(R,eu)|0,o=o+Math.imul(R,el)|0,n=n+Math.imul(x,eh)|0,i=(i=i+Math.imul(x,ef)|0)+Math.imul(C,eh)|0,o=o+Math.imul(C,ef)|0;var eO=(l+(n=n+Math.imul(k,ep)|0)|0)+((8191&(i=(i=i+Math.imul(k,em)|0)+Math.imul(S,ep)|0))<<13)|0;l=((o=o+Math.imul(S,em)|0)+(i>>>13)|0)+(eO>>>26)|0,eO&=67108863,n=Math.imul(D,er),i=(i=Math.imul(D,en))+Math.imul(U,er)|0,o=Math.imul(U,en),n=n+Math.imul(B,eo)|0,i=(i=i+Math.imul(B,es)|0)+Math.imul(L,eo)|0,o=o+Math.imul(L,es)|0,n=n+Math.imul(N,eu)|0,i=(i=i+Math.imul(N,el)|0)+Math.imul(I,eu)|0,o=o+Math.imul(I,el)|0,n=n+Math.imul(O,eh)|0,i=(i=i+Math.imul(O,ef)|0)+Math.imul(R,eh)|0,o=o+Math.imul(R,ef)|0;var eR=(l+(n=n+Math.imul(x,ep)|0)|0)+((8191&(i=(i=i+Math.imul(x,em)|0)+Math.imul(C,ep)|0))<<13)|0;l=((o=o+Math.imul(C,em)|0)+(i>>>13)|0)+(eR>>>26)|0,eR&=67108863,n=Math.imul(D,eo),i=(i=Math.imul(D,es))+Math.imul(U,eo)|0,o=Math.imul(U,es),n=n+Math.imul(B,eu)|0,i=(i=i+Math.imul(B,el)|0)+Math.imul(L,eu)|0,o=o+Math.imul(L,el)|0,n=n+Math.imul(N,eh)|0,i=(i=i+Math.imul(N,ef)|0)+Math.imul(I,eh)|0,o=o+Math.imul(I,ef)|0;var eM=(l+(n=n+Math.imul(O,ep)|0)|0)+((8191&(i=(i=i+Math.imul(O,em)|0)+Math.imul(R,ep)|0))<<13)|0;l=((o=o+Math.imul(R,em)|0)+(i>>>13)|0)+(eM>>>26)|0,eM&=67108863,n=Math.imul(D,eu),i=(i=Math.imul(D,el))+Math.imul(U,eu)|0,o=Math.imul(U,el),n=n+Math.imul(B,eh)|0,i=(i=i+Math.imul(B,ef)|0)+Math.imul(L,eh)|0,o=o+Math.imul(L,ef)|0;var eN=(l+(n=n+Math.imul(N,ep)|0)|0)+((8191&(i=(i=i+Math.imul(N,em)|0)+Math.imul(I,ep)|0))<<13)|0;l=((o=o+Math.imul(I,em)|0)+(i>>>13)|0)+(eN>>>26)|0,eN&=67108863,n=Math.imul(D,eh),i=(i=Math.imul(D,ef))+Math.imul(U,eh)|0,o=Math.imul(U,ef);var eI=(l+(n=n+Math.imul(B,ep)|0)|0)+((8191&(i=(i=i+Math.imul(B,em)|0)+Math.imul(L,ep)|0))<<13)|0;l=((o=o+Math.imul(L,em)|0)+(i>>>13)|0)+(eI>>>26)|0,eI&=67108863;var eT=(l+(n=Math.imul(D,ep))|0)+((8191&(i=(i=Math.imul(D,em))+Math.imul(U,ep)|0))<<13)|0;return l=((o=Math.imul(U,em))+(i>>>13)|0)+(eT>>>26)|0,eT&=67108863,u[0]=eg,u[1]=ey,u[2]=ev,u[3]=eb,u[4]=ew,u[5]=eA,u[6]=eE,u[7]=ek,u[8]=eS,u[9]=eP,u[10]=ex,u[11]=eC,u[12]=e_,u[13]=eO,u[14]=eR,u[15]=eM,u[16]=eN,u[17]=eI,u[18]=eT,0!==l&&(u[19]=l,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function w(e,t){this.x=e,this.y=t}Math.imul||(v=y),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return 10===this.length&&10===e.length?v(this,e,t):n<63?y(this,e,t):b(this,e,t)},w.prototype.makeRBT=function(e){for(var t=Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},w.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,r+=(o/67108864|0)+(s>>>26),this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var i,o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,l=0;l=0&&(0!==c||l>=i);l--){var h=0|this.words[l];this.words[l]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var t=e%26,r=(e-t)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r,n=this.length-e.length,i=this.clone(),s=e,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var u=i.length-s.length;if("mod"!==t){(r=new o(null)).length=u+1,r.words=Array(r.length);for(var l=0;l=0;h--){var f=(0|i.words[s.length+h])*67108864+(0|i.words[s.length+h-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(s,f,h);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,h),i.isZero()||(i.negative^=1);r&&(r.words[h]=f)}return r&&r._strip(),i._strip(),"div"!==t&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(e,t,r){var i,s,a;return(n(!e.isZero()),this.isZero())?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&e.negative)!=0?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||0>this.cmp(e)?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t)},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=67108864%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var f=0,d=1;(t.words[0]&d)==0&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;(r.words[0]&m)==0&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(l)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t,r=this,i=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),u=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,c=1;(r.words[0]&c)==0&&l<26;++l,c<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;(i.words[0]&f)==0&&h<26;++h,f<<=1);if(h>0)for(i.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(t=0===r.cmpn(1)?s:a).cmpn(0)&&t.iadd(e),t},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return -1===this.cmpn(e)},o.prototype.lt=function(e){return -1===this.cmp(e)},o.prototype.lten=function(e){return 0>=this.cmpn(e)},o.prototype.lte=function(e){return 0>=this.cmp(e)},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new C(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var A={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new o(null);return e.words=Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},i(k,E),k.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){var t;if(A[e])return A[e];if("k256"===e)t=new k;else if("p224"===e)t=new S;else if("p192"===e)t=new P;else if("p25519"===e)t=new x;else throw Error("Unknown prime "+e);return A[e]=t,t},C.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){n((e.negative|t.negative)==0,"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},C.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var h=l>>c&1;if(i!==r[0]&&(i=this.sqr(i)),0===h&&0===s){a=0;continue}s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)}u=26}return i},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},i(_,C),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},94184:function(e,t){var r; /*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ !function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(o=8,n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;othis.blockSize&&(e=new this.Hash().update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},26436:function(e,t,r){"use strict";var n=r(79746),i=r(35717);function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function a(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;if(2===e.length)return"000000"+e;if(1===e.length)return"0000000"+e;else return e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e){if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):(o=e,s=i,(64512&o.charCodeAt(s))!=55296||s<0||s+1>=o.length?1:(64512&o.charCodeAt(s+1))!=56320)?(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128):(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128)}}else for(i=0;i>>0;return a},t.split32=function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0;e[t]=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u,l=t;return e+r+i+s+(0+((l=l+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,l){var c,h=t;return e+r+i+s+u+(0+((h=h+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,l){return t+n+o+a+l>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},8679:function(e,t,r){"use strict";var n=r(59864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(e){return n.isMemo(e)?s:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=s;var l=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var i=d(r);i&&i!==p&&e(t,i,n)}var s=c(r);h&&(s=s.concat(h(r)));for(var a=u(t),m=u(r),g=0;g>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){B.call(this,e,t,r)}B.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(o);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw Error(o)}else throw Error(o);t=!0}for(var n,i,s=this.blocks,a=this.byteCount,u=e.length,l=this.blockCount,c=0,f=this.s;c>2]|=e[c]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=s[l],n=0;n>=8,r=255&e;r>0;)i.unshift(r),e>>=8,r=255&e,++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(o);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw Error(o)}else throw Error(o);t=!0}var n=0,i=e.length;if(t)n=i;else for(var s=0;s=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(t=1,e[0]=e[r];t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t==0&&(F(r),o=0)}return i&&(a+=f[(e=r[o])>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},B.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=new ArrayBuffer(i?n+1<<2:a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&F(n)}return o&&(e=a<<2,t=n[s],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},L.prototype=new B,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var F=function(e){var t,r,n,i,o,s,a,u,l,c,h,f,d,p,g,y,v,b,w,A,E,k,S,P,x,C,_,O,R,M,N,I,T,B,L,F,D,U,j,q,G,K,H,z,Q,W,J,V,Y,Z,$,X,ee,et,er,en,ei,eo,es,ea,eu,el,ec;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49],t=f^(s<<1|a>>>31),r=d^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|l>>>31),r=o^(l<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(c<<1|h>>>31),r=a^(h<<1|c>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(f<<1|d>>>31),r=l^(d<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=c^(i<<1|o>>>31),r=h^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,O=e[20]<<3|e[21]>>>29,R=e[21]<<3|e[20]>>>29,ea=e[31]<<9|e[30]>>>23,eu=e[30]<<9|e[31]>>>23,K=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,M=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,el=e[42]<<2|e[43]>>>30,ec=e[43]<<2|e[42]>>>30,et=e[5]<<30|e[4]>>>2,er=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,$=e[35]<<15|e[34]>>>17,I=e[45]<<29|e[44]>>>3,T=e[44]<<29|e[45]>>>3,P=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,en=e[17]<<23|e[16]>>>9,ei=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,Q=e[9]<<27|e[8]>>>5,C=e[18]<<20|e[19]>>>12,_=e[19]<<20|e[18]>>>12,eo=e[29]<<7|e[28]>>>25,es=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,G=e[39]<<8|e[38]>>>24,k=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=p^~y&b,e[1]=g^~v&w,e[10]=P^~C&O,e[11]=x^~_&R,e[20]=B^~F&U,e[21]=L^~D&j,e[30]=z^~W&V,e[31]=Q^~J&Y,e[40]=et^~en&eo,e[41]=er^~ei&es,e[2]=y^~b&A,e[3]=v^~w&E,e[12]=C^~O&M,e[13]=_^~R&N,e[22]=F^~U&q,e[23]=D^~j&G,e[32]=W^~V&Z,e[33]=J^~Y&$,e[42]=en^~eo&ea,e[43]=ei^~es&eu,e[4]=b^~A&k,e[5]=w^~E&S,e[14]=O^~M&I,e[15]=R^~N&T,e[24]=U^~q&K,e[25]=j^~G&H,e[34]=V^~Z&X,e[35]=Y^~$&ee,e[44]=eo^~ea&el,e[45]=es^~eu&ec,e[6]=A^~k&p,e[7]=E^~S&g,e[16]=M^~I&P,e[17]=N^~T&x,e[26]=q^~K&B,e[27]=G^~H&L,e[36]=Z^~X&z,e[37]=$^~ee&Q,e[46]=ea^~el&et,e[47]=eu^~ec&er,e[8]=k^~p&y,e[9]=S^~g&v,e[18]=I^~P&C,e[19]=T^~x&_,e[28]=K^~B&F,e[29]=H^~L&D,e[38]=X^~z&W,e[39]=ee^~Q&J,e[48]=el^~et&en,e[49]=ec^~er&ei,e[0]^=m[n],e[1]^=m[n+1]};if(l)e.exports=C;else{for(O=0;O<_.length;++O)a[_[O]]=C[_[O]];c&&void 0!==(n=(function(){return C}).call(t,r,t,e))&&(e.exports=n)}}()},79746:function(e){function t(e,t){if(!e)throw Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)}},6840:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(36526)}])},78082:function(e,t,r){"use strict";r.d(t,{C5:function(){return v},EH:function(){return p},GG:function(){return c},HE:function(){return b},Jh:function(){return o},PD:function(){return f},XL:function(){return u},_D:function(){return a},fL:function(){return d},gi:function(){return g},k0:function(){return l},pg:function(){return h},sl:function(){return y},sr:function(){return m}});var n=r(52196),i=r(81226);let o="0x",s=new Map([[i.c.mainnet.id,"0x587ad7a26C5acae69D683fE923fD3f5B0700f3Ef"],[i.c.goerli.id,"0x398663842680332A1AbA3B03bd6dB47aE984994C"],[i.c.arbitrum.id,"0xe42719cDA4CCa7Abd2243e18604372C6B1c5790c"],[i.c.arbitrumGoerli.id,"0x1f0C5b696da48f5E93B1c3b3220E42b11b9a9E96"]]);function a(e){o=s.get(e)}let u=n.TQ||n.Cg?[i.c.goerli,i.c.arbitrumGoerli]:[i.c.mainnet,i.c.arbitrum],l=(()=>{let e=new Map;for(let t of u)e.set(t.id,t);return e})(),c="a".repeat(64),h=416001,f=1279692951,d="MWUNSC7QGZS6Y7KROX544EJD7ME6H6XLM5VX3TSIY6JZQW24FMPXWOM7T4",p="https://mainnet-api.algonode.cloud",m="https://algoexplorer.io/",g=[{location:"Seattle, US",name:"Thunder Gateway",value:"https://gw-seattle.crustcloud.io"}],y="https://gw.crustfiles.app",v="https://ipfs.io",b="https://ipfsgw.live"},52196:function(e,t,r){"use strict";r.d(t,{Cg:function(){return i},Kc:function(){return o},TQ:function(){return n}});let n=!1,i=!1,o=!1},36526:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return x}});var n=r(35944),i=r(29282),o=r.n(i),s=r(40924),a=r.n(s),u=r(82463),l=r.n(u),c=r(21056),h=r.n(c);r(16853);var f=r(78082),d=r(9008),p=r.n(d),m=r(2984),g=r(38109),y=r(82775),v=r(93901);r(58669);var b=r(94184),w=r.n(b);let A=[o(),a(),l(),h()].map(e=>e.variable).join(" "),E=new y.i,{provider:k,webSocketProvider:S}=(0,m.QB)(f.XL,[function(){let{priority:e,stallTimeout:t,weight:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){return n.rpcUrls.default?{chain:n,provider(){let i=new v.c(n.rpcUrls.default,{chainId:n.id,name:n.network});return Object.assign(i,{priority:e,stallTimeout:t,weight:r})}}:null}}()]),P=(0,g.eI)({autoConnect:!0,provider:k,webSocketProvider:S,connectors:[E]});function x(e){let{Component:t,pageProps:r}=e;return(0,n.BX)("div",{suppressHydrationWarning:!0,className:w()("App font-WorkSans",A),children:[(0,n.BX)(p(),{children:[(0,n.tZ)("meta",{name:"viewport",content:"width=device-width,user-scalable=no"}),(0,n.tZ)("title",{children:"Crust Cloud"})]}),(0,n.tZ)(g.eM,{client:P,children:(0,n.tZ)(t,{...r})})]})}},58669:function(){},82463:function(e){e.exports={style:{fontFamily:"'__Roboto_9e7bcd', '__Roboto_Fallback_9e7bcd'",fontWeight:400,fontStyle:"normal"},className:"__className_9e7bcd",variable:"__variable_9e7bcd"}},21056:function(e){e.exports={style:{fontFamily:"'__Roboto_Mono_f18e28', '__Roboto_Mono_Fallback_f18e28'",fontWeight:700,fontStyle:"normal"},className:"__className_f18e28",variable:"__variable_f18e28"}},29282:function(e){e.exports={style:{fontFamily:"'__Squada_One_4f93f4', '__Squada_One_Fallback_4f93f4'",fontWeight:400,fontStyle:"normal"},className:"__className_4f93f4",variable:"__variable_4f93f4"}},40924:function(e){e.exports={style:{fontFamily:"'__Work_Sans_57f497', '__Work_Sans_Fallback_57f497'",fontStyle:"normal"},className:"__className_57f497",variable:"__variable_57f497"}},16853:function(){},9008:function(e,t,r){e.exports=r(83121)},34155:function(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(n){r=s}}();var u=[],l=!1,c=-1;function h(){l&&n&&(l=!1,n.length?u=n.concat(u):c=-1,u.length&&f())}function f(){if(!l){var e=a(h);l=!0;for(var t=u.length;t;){for(n=u,u=[];++c1)for(var r=1;r=64;){let d=r,p=n,m=i,g=o,y=s,v=a,b=u,w=l,A,E,k,S,P;for(E=0;E<16;E++)k=h+4*E,c[E]=(255&e[k])<<24|(255&e[k+1])<<16|(255&e[k+2])<<8|255&e[k+3];for(E=16;E<64;E++)S=((A=c[E-2])>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,P=((A=c[E-15])>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,c[E]=(S+c[E-7]|0)+(P+c[E-16]|0)|0;for(E=0;E<64;E++)S=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&v^~y&b)|0)+(w+(t[E]+c[E]|0)|0)|0,P=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&p^d&m^p&m)|0,w=b,b=v,v=y,y=g+S|0,g=m,m=p,p=d,d=S+P|0;r=r+d|0,n=n+p|0,i=i+m|0,o=o+g|0,s=s+y|0,a=a+v|0,u=u+b|0,l=l+w|0,h+=64,f-=64}}h(e);let f,d=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=d<56?56:120,y=e.slice(e.length-d,e.length);for(y.push(128),f=d+1;f>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),h(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255]}function n(e,t,n){let i;e=e.length<=64?e:r(e);let o=64+t.length+4,s=Array(o),a=Array(64),u=[];for(i=0;i<64;i++)s[i]=54;for(i=0;i=o-4;e--){if(s[e]++,s[e]<=255)return;s[e]=0}}for(;n>=32;)l(),u=u.concat(r(a.concat(r(s)))),n-=32;return n>0&&(l(),u=u.concat(r(a.concat(r(s))).slice(0,n))),u}function i(e,t,r,n,i){let u;for(a(e,(2*r-1)*16,i,0,16),u=0;u<2*r;u++)s(e,16*u,i,16),function(e,t){a(e,0,t,0,16);for(let r=8;r>0;r-=2)t[4]^=o(t[0]+t[12],7),t[8]^=o(t[4]+t[0],9),t[12]^=o(t[8]+t[4],13),t[0]^=o(t[12]+t[8],18),t[9]^=o(t[5]+t[1],7),t[13]^=o(t[9]+t[5],9),t[1]^=o(t[13]+t[9],13),t[5]^=o(t[1]+t[13],18),t[14]^=o(t[10]+t[6],7),t[2]^=o(t[14]+t[10],9),t[6]^=o(t[2]+t[14],13),t[10]^=o(t[6]+t[2],18),t[3]^=o(t[15]+t[11],7),t[7]^=o(t[3]+t[15],9),t[11]^=o(t[7]+t[3],13),t[15]^=o(t[11]+t[7],18),t[1]^=o(t[0]+t[3],7),t[2]^=o(t[1]+t[0],9),t[3]^=o(t[2]+t[1],13),t[0]^=o(t[3]+t[2],18),t[6]^=o(t[5]+t[4],7),t[7]^=o(t[6]+t[5],9),t[4]^=o(t[7]+t[6],13),t[5]^=o(t[4]+t[7],18),t[11]^=o(t[10]+t[9],7),t[8]^=o(t[11]+t[10],9),t[9]^=o(t[8]+t[11],13),t[10]^=o(t[9]+t[8],18),t[12]^=o(t[15]+t[14],7),t[13]^=o(t[12]+t[15],9),t[14]^=o(t[13]+t[12],13),t[15]^=o(t[14]+t[13],18);for(let n=0;n<16;++n)e[n]+=t[n]}(i,n),a(i,0,e,t+16*u,16);for(u=0;u>>32-t}function s(e,t,r,n){for(let i=0;i=256)return!1}return!0}function l(e,t){if("number"!=typeof e||e%1)throw Error("invalid "+t);return e}function c(e,t,r,o,c,h,f){let d;if(r=l(r,"N"),o=l(o,"r"),c=l(c,"p"),h=l(h,"dkLen"),0===r||(r&r-1)!=0)throw Error("N must be power of 2");if(r>2147483647/128/o)throw Error("N too large");if(o>2147483647/128/c)throw Error("r too large");if(!u(e))throw Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!u(t))throw Error("salt must be an array or buffer");let p=n(e,t=Array.prototype.slice.call(t),128*c*o),m=new Uint32Array(32*c*o);for(let g=0;gR&&(t=R);for(let u=0;uR&&(t=R);for(let g=0;g>0&255),p.push(m[B]>>8&255),p.push(m[B]>>16&255),p.push(m[B]>>24&255);let L=n(e,p,h);return f&&f(null,1,L),L}f&&M(N)};if(!f)for(;;){let I=N();if(void 0!=I)return I}N()}e.exports={scrypt:function(e,t,r,n,i,o,s){return new Promise(function(a,u){let l=0;s&&s(0),c(e,t,r,n,i,o,function(e,t,r){if(e)u(e);else if(r)s&&1!==l&&s(1),a(new Uint8Array(r));else if(s&&t!==l)return l=t,s(t)})})},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(c(e,t,r,n,i,o))}}}(0)},53250:function(e,t,r){"use strict";/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ var n=r(67294),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,s=n.useEffect,a=n.useLayoutEffect,u=n.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(n){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=o({inst:{value:r,getSnapshot:t}}),i=n[0].inst,c=n[1];return a(function(){i.value=r,i.getSnapshot=t,l(i)&&c({inst:i})},[e,r,t]),s(function(){return l(i)&&c({inst:i}),e(function(){l(i)&&c({inst:i})})},[e]),u(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},50139:function(e,t,r){"use strict";/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ var n=r(67294),i=r(61688),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=i.useSyncExternalStore,a=n.useRef,u=n.useEffect,l=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var h=a(null);if(null===h.current){var f={hasValue:!1,value:null};h.current=f}else f=h.current;h=l(function(){function e(e){if(!u){if(u=!0,s=e,e=n(e),void 0!==i&&f.hasValue){var t=f.value;if(i(t,e))return a=t}return a=e}if(t=a,o(s,e))return t;var r=n(e);return void 0!==i&&i(t,r)?t:(s=e,a=r)}var s,a,u=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,i]);var d=s(e,h[0],h[1]);return u(function(){f.hasValue=!0,f.value=d},[d]),c(d),d}},61688:function(e,t,r){"use strict";e.exports=r(53250)},52798:function(e,t,r){"use strict";e.exports=r(50139)},38109:function(e,t,r){"use strict";let n;function i(){}r.d(t,{eM:function(){return eC},eI:function(){return eS},mA:function(){return eB},$4:function(){return eD},cq:function(){return eZ},qL:function(){return eq},LN:function(){return eG},yL:function(){return eN},yw:function(){return eW},mx:function(){return ez},g0:function(){return eY}});let o="undefined"==typeof window||"Deno"in window;function s(){}function a(e){return"number"==typeof e&&e>=0&&e!==1/0}function u(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t,r){return A(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function c(e,t,r){return A(e)?"function"==typeof t?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:"function"==typeof e?{...t,mutationFn:e}:{...e}}function h(e,t,r){return A(e)?[{...t,queryKey:e},r]:[e||{},t]}function f(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(A(s)){if(n){if(t.queryHash!==p(s,t.options))return!1}else{if(!g(t.queryKey,s))return!1}}if("all"!==r){let u=t.isActive();if("active"===r&&!u||"inactive"===r&&u)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(void 0===i||i===t.state.fetchStatus)&&(!o||!!o(t))}function d(e,t){let{exact:r,fetching:n,predicate:i,mutationKey:o}=e;if(A(o)){if(!t.options.mutationKey)return!1;if(r){if(m(t.options.mutationKey)!==m(o))return!1}else{if(!g(t.options.mutationKey,o))return!1}}return("boolean"!=typeof n||"loading"===t.state.status===n)&&(!i||!!i(t))}function p(e,t){let r=(null==t?void 0:t.queryKeyHashFn)||m;return r(e)}function m(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(r=>!g(e[r],t[r]))}function y(e,t){if(e&&!t||t&&!e)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!w(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(w(r)&&r.hasOwnProperty("isPrototypeOf"))}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function A(e){return Array.isArray(e)}function E(e){return new Promise(t=>{setTimeout(t,e)})}function k(e){E(0).then(e)}function S(e,t,r){return null!=r.isDataEqual&&r.isDataEqual(e,t)?e:"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=v(t)&&v(r);if(n||b(t)&&b(r)){let i=n?t.length:Object.keys(t).length,o=n?r:Object.keys(r),s=o.length,a=n?[]:{},u=0;for(let l=0;l{e()},n=e=>{e()},i=e=>{let r;t++;try{r=e()}finally{--t||a()}return r},o=n=>{t?e.push(n):k(()=>{r(n)})},s=e=>(...t)=>{o(()=>{e(...t)})},a=()=>{let t=e;e=[],t.length&&k(()=>{n(()=>{t.forEach(e=>{r(e)})})})},u=e=>{r=e},l=e=>{n=e};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:u,setBatchNotifyFunction:l}}();class C{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){let t={listener:e};return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}let _=new class extends C{constructor(){super(),this.setup=e=>{if(!o&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){let t=this.focused!==e;t&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},O=["online","offline"],R=new class extends C{constructor(){super(),this.setup=e=>{if(!o&&window.addEventListener){let t=()=>e();return O.forEach(e=>{window.addEventListener(e,t,!1)}),()=>{O.forEach(e=>{window.removeEventListener(e,t)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()})}setOnline(e){let t=this.online!==e;t&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}};function M(e){return Math.min(1e3*2**e,3e4)}function N(e){return(null!=e?e:"online")!=="online"||R.isOnline()}class I{constructor(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}}function T(e){return e instanceof I}function B(e){let t,r,n,i=!1,o=0,s=!1,a=new Promise((e,t)=>{r=e,n=t}),u=t=>{s||(d(new I(t)),null==e.abort||e.abort())},l=()=>{i=!0},c=()=>{i=!1},h=()=>!_.isFocused()||"always"!==e.networkMode&&!R.isOnline(),f=n=>{s||(s=!0,null==e.onSuccess||e.onSuccess(n),null==t||t(),r(n))},d=r=>{s||(s=!0,null==e.onError||e.onError(r),null==t||t(),n(r))},p=()=>new Promise(r=>{t=e=>{let t=s||!h();return t&&r(e),t},null==e.onPause||e.onPause()}).then(()=>{t=void 0,s||null==e.onContinue||e.onContinue()}),m=()=>{let t;if(!s){try{t=e.fn()}catch(r){t=Promise.reject(r)}Promise.resolve(t).then(f).catch(t=>{var r,n;if(s)return;let a=null!=(r=e.retry)?r:3,u=null!=(n=e.retryDelay)?n:M,l="function"==typeof u?u(o,t):u,c=!0===a||"number"==typeof a&&o{if(h())return p()}).then(()=>{i?d(t):m()})})}};return N(e.networkMode)?m():p().then(m),{promise:a,cancel:u,continue(){let e=null==t?void 0:t();return e?a:Promise.resolve()},cancelRetry:l,continueRetry:c}}class L{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:o?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class F extends L{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||P,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){let r=S(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),r}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;let r=this.promise;return null==(t=this.retryer)||t.cancel(e),r?r.then(s).catch(s):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>!1!==e.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!u(this.state.dataUpdatedAt,e)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var r,n,i,o;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){let s=this.observers.find(e=>e.options.queryFn);s&&this.setOptions(s.options)}let a=function(){if("function"==typeof AbortController)return new AbortController}(),u={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(u);let c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(u)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),h={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};l(h),null==(r=this.options.behavior)||r.onFetch(h),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=h.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(o=h.fetchOptions)?void 0:o.meta});let f=e=>{if(T(e)&&e.silent||this.dispatch({type:"error",error:e}),!T(e)){var t,r,n,i;null==(t=(r=this.cache.config).onError)||t.call(r,e,this),null==(n=(i=this.cache.config).onSettled)||n.call(i,this.state.data,e,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=B({fn:h.fetchFn,abort:null==a?void 0:a.abort.bind(a),onSuccess:e=>{var t,r,n,i;if(void 0===e){f(Error(this.queryHash+" data is undefined"));return}this.setData(e),null==(t=(r=this.cache.config).onSuccess)||t.call(r,e,this),null==(n=(i=this.cache.config).onSettled)||n.call(i,e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:f,onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var r,n;switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(r=e.meta)?r:null,fetchStatus:N(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(n=e.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=e.error;if(T(i)&&i.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),x.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}class D extends C{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,r){var n;let i=t.queryKey,o=null!=(n=t.queryHash)?n:p(i,t),s=this.get(o);return s||(s=new F({cache:this,logger:e.getLogger(),queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){let t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter(t=>t!==e),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){x.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){let[r]=h(e,t);return void 0===r.exact&&(r.exact=!0),this.queries.find(e=>f(r,e))}findAll(e,t){let[r]=h(e,t);return Object.keys(r).length>0?this.queries.filter(e=>f(r,e)):this.queries}notify(e){x.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}onFocus(){x.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){x.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class U extends L{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||P,this.observers=[],this.state=e.state||j(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){var e,t,r,n,i,o,s,a,u,l,c,h,f,d,p,m,g,y,v,b;let w="loading"===this.state.status;try{if(!w){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(u=(l=this.mutationCache.config).onMutate)?void 0:u.call(l,this.state.variables,this));let A=await (null==(c=(h=this.options).onMutate)?void 0:c.call(h,this.state.variables));A!==this.state.context&&this.dispatch({type:"loading",context:A,variables:this.state.variables})}let E=await (()=>{var e;return this.retryer=B({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return await (null==(e=(t=this.mutationCache.config).onSuccess)?void 0:e.call(t,E,this.state.variables,this.state.context,this)),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,E,this.state.variables,this.state.context)),await (null==(i=(o=this.mutationCache.config).onSettled)?void 0:i.call(o,E,null,this.state.variables,this.state.context,this)),await (null==(s=(a=this.options).onSettled)?void 0:s.call(a,E,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:E}),E}catch(k){try{throw await (null==(f=(d=this.mutationCache.config).onError)?void 0:f.call(d,k,this.state.variables,this.state.context,this)),await (null==(p=(m=this.options).onError)?void 0:p.call(m,k,this.state.variables,this.state.context)),await (null==(g=(y=this.mutationCache.config).onSettled)?void 0:g.call(y,void 0,k,this.state.variables,this.state.context,this)),await (null==(v=(b=this.options).onSettled)?void 0:v.call(b,void 0,k,this.state.variables,this.state.context)),k}finally{this.dispatch({type:"error",error:k})}}}dispatch(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!N(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...t,...e.state}}})(this.state),x.batch(()=>{this.observers.forEach(t=>{t.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function j(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class q extends C{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,r){let n=new U({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(n),n}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(t=>t!==e),this.notify({type:"removed",mutation:e})}clear(){x.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find(t=>d(e,t))}findAll(e){return this.mutations.filter(t=>d(e,t))}notify(e){x.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}resumePausedMutations(){var e;return this.resuming=(null!=(e=this.resuming)?e:Promise.resolve()).then(()=>{let e=this.mutations.filter(e=>e.state.isPaused);return x.batch(()=>e.reduce((e,t)=>e.then(()=>t.continue().catch(s)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function G(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}class K{constructor(e={}){this.queryCache=e.queryCache||new D,this.mutationCache=e.mutationCache||new q,this.logger=e.logger||P,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=_.subscribe(()=>{_.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=R.subscribe(()=>{R.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,t;this.mountCount--,0===this.mountCount&&(null==(e=this.unsubscribeFocus)||e.call(this),this.unsubscribeFocus=void 0,null==(t=this.unsubscribeOnline)||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){let[r]=h(e,t);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state.data}ensureQueryData(e,t,r){let n=l(e,t,r),i=this.getQueryData(n.queryKey);return i?Promise.resolve(i):this.fetchQuery(n)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:e,state:t})=>{let r=t.data;return[e,r]})}setQueryData(e,t,r){let n=this.queryCache.find(e),i=null==n?void 0:n.state.data,o="function"==typeof t?t(i):t;if(void 0===o)return;let s=l(e),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return x.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state}removeQueries(e,t){let[r]=h(e,t),n=this.queryCache;x.batch(()=>{n.findAll(r).forEach(e=>{n.remove(e)})})}resetQueries(e,t,r){let[n,i]=h(e,t,r),o=this.queryCache,s={type:"active",...n};return x.batch(()=>(o.findAll(n).forEach(e=>{e.reset()}),this.refetchQueries(s,i)))}cancelQueries(e,t,r){let[n,i={}]=h(e,t,r);void 0===i.revert&&(i.revert=!0);let o=x.batch(()=>this.queryCache.findAll(n).map(e=>e.cancel(i)));return Promise.all(o).then(s).catch(s)}invalidateQueries(e,t,r){let[n,i]=h(e,t,r);return x.batch(()=>{var e,t;if(this.queryCache.findAll(n).forEach(e=>{e.invalidate()}),"none"===n.refetchType)return Promise.resolve();let r={...n,type:null!=(e=null!=(t=n.refetchType)?t:n.type)?e:"active"};return this.refetchQueries(r,i)})}refetchQueries(e,t,r){let[n,i]=h(e,t,r),o=x.batch(()=>this.queryCache.findAll(n).filter(e=>!e.isDisabled()).map(e=>{var t;return e.fetch(void 0,{...i,cancelRefetch:null==(t=null==i?void 0:i.cancelRefetch)||t,meta:{refetchPage:n.refetchPage}})})),a=Promise.all(o).then(s);return null!=i&&i.throwOnError||(a=a.catch(s)),a}fetchQuery(e,t,r){let n=l(e,t,r),i=this.defaultQueryOptions(n);void 0===i.retry&&(i.retry=!1);let o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}prefetchQuery(e,t,r){return this.fetchQuery(e,t,r).then(s).catch(s)}fetchInfiniteQuery(e,t,r){let n=l(e,t,r);return n.behavior={onFetch(e){e.fetchFn=()=>{var t,r,n,i,o,s,a;let u;let l=null==(t=e.fetchOptions)?void 0:null==(r=t.meta)?void 0:r.refetchPage,c=null==(n=e.fetchOptions)?void 0:null==(i=n.meta)?void 0:i.fetchMore,h=null==c?void 0:c.pageParam,f=(null==c?void 0:c.direction)==="forward",d=(null==c?void 0:c.direction)==="backward",p=(null==(o=e.state.data)?void 0:o.pages)||[],m=(null==(s=e.state.data)?void 0:s.pageParams)||[],g=m,y=!1,v=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get(){var t,r;return null!=(t=e.signal)&&t.aborted?y=!0:null==(r=e.signal)||r.addEventListener("abort",()=>{y=!0}),e.signal}})},b=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),w=(e,t,r,n)=>(g=n?[t,...g]:[...g,t],n?[r,...e]:[...e,r]),A=(t,r,n,i)=>{if(y)return Promise.reject("Cancelled");if(void 0===n&&!r&&t.length)return Promise.resolve(t);let o={queryKey:e.queryKey,pageParam:n,meta:e.options.meta};v(o);let s=b(o),a=Promise.resolve(s).then(e=>w(t,n,e,i));return a};if(p.length){if(f){let E=void 0!==h,k=E?h:G(e.options,p);u=A(p,E,k)}else if(d){let S=void 0!==h,P=S?h:null==(a=e.options).getPreviousPageParam?void 0:a.getPreviousPageParam(p[0],p);u=A(p,S,P,!0)}else{g=[];let x=void 0===e.options.getNextPageParam,C=!l||!p[0]||l(p[0],0,p);u=C?A([],x,m[0]):Promise.resolve(w([],m[0],p[0]));for(let _=1;_{let r=!l||!p[_]||l(p[_],_,p);if(r){let n=x?m[_]:G(e.options,t);return A(t,x,n)}return Promise.resolve(w(t,m[_],p[_]))})}}else u=A([]);let O=u.then(e=>({pages:e,pageParams:g}));return O}}},this.fetchQuery(n)}prefetchInfiniteQuery(e,t,r){return this.fetchInfiniteQuery(e,t,r).then(s).catch(s)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){let r=this.queryDefaults.find(t=>m(e)===m(t.queryKey));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;let t=this.queryDefaults.find(t=>g(e,t.queryKey));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){let r=this.mutationDefaults.find(t=>m(e)===m(t.mutationKey));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;let t=this.mutationDefaults.find(t=>g(e,t.mutationKey));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;let t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=p(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}var H=r(67294);let z=H.createContext(void 0),Q=H.createContext(!1);function W(e,t){return e||(t&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=z),window.ReactQueryClientContext):z)}let J=({context:e}={})=>{let t=H.useContext(W(e,H.useContext(Q)));if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},V=({client:e,children:t,context:r,contextSharing:n=!1})=>{H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);let i=W(r,n);return H.createElement(Q.Provider,{value:!r&&n},H.createElement(i.Provider,{value:e},t))},Y=H.createContext(!1),Z=()=>H.useContext(Y);Y.Provider;let $=H.createContext((n=!1,{clearReset(){n=!1},reset(){n=!0},isReset:()=>n})),X=()=>H.useContext($);class ee extends C{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let r=this.options;this.options=this.client.defaultMutationOptions(e),y(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:j(),t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){x.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var t,r,n,i,o,s,a,u;e.onSuccess?(null==(t=(r=this.mutateOptions).onSuccess)||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(i=this.mutateOptions).onSettled)||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(o=(s=this.mutateOptions).onError)||o.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(u=this.mutateOptions).onSettled)||a.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}}var et=r(61688);let er=et.useSyncExternalStore;function en(){}class ei extends C{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),eo(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return es(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return es(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){let r=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),y(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();let i=this.hasListeners();i&&ea(this.currentQuery,n,this.options,r)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();let o=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==r.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){let t=this.client.getQueryCache().build(this.client,e),r=this.createResult(t,e);return e.keepPreviousData||(void 0!==e.placeholderData?!r.isPlaceholderData:y(this.getCurrentResult(),r))||(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(e){let t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){let t=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(s)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),o||this.currentResult.isStale||!a(this.options.staleTime))return;let e=u(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},e+1)}computeRefetchInterval(){var e;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!o&&!1!==this.options.enabled&&a(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||_.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){let r;let n=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,a=this.currentResultOptions,u=e!==n,l=u?e.state:this.currentQueryInitialState,c=u?this.currentResult:this.previousQueryResult,{state:h}=e,{dataUpdatedAt:f,error:d,errorUpdatedAt:p,fetchStatus:m,status:g}=h,y=!1,v=!1;if(t._optimisticResults){let b=this.hasListeners(),w=!b&&eo(e,t),A=b&&ea(e,n,t,i);(w||A)&&(m=N(e.options.networkMode)?"fetching":"paused",f||(g="loading")),"isRestoring"===t._optimisticResults&&(m="idle")}if(t.keepPreviousData&&!h.dataUpdatedAt&&null!=c&&c.isSuccess&&"error"!==g)r=c.data,f=c.dataUpdatedAt,g=c.status,y=!0;else if(t.select&&void 0!==h.data){if(o&&h.data===(null==s?void 0:s.data)&&t.select===this.selectFn)r=this.selectResult;else try{this.selectFn=t.select,r=t.select(h.data),r=S(null==o?void 0:o.data,r,t),this.selectResult=r,this.selectError=null}catch(E){this.selectError=E}}else r=h.data;if(void 0!==t.placeholderData&&void 0===r&&"loading"===g){let k;if(null!=o&&o.isPlaceholderData&&t.placeholderData===(null==a?void 0:a.placeholderData))k=o.data;else if(k="function"==typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&void 0!==k)try{k=t.select(k),this.selectError=null}catch(P){this.selectError=P}void 0!==k&&(g="success",r=S(null==o?void 0:o.data,k,t),v=!0)}this.selectError&&(d=this.selectError,r=this.selectResult,p=Date.now(),g="error");let x="fetching"===m,C="loading"===g,_="error"===g,O={status:g,fetchStatus:m,isLoading:C,isSuccess:"success"===g,isError:_,isInitialLoading:C&&x,data:r,dataUpdatedAt:f,error:d,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>l.dataUpdateCount||h.errorUpdateCount>l.errorUpdateCount,isFetching:x,isRefetching:x&&!C,isLoadingError:_&&0===h.dataUpdatedAt,isPaused:"paused"===m,isPlaceholderData:v,isPreviousData:y,isRefetchError:_&&0!==h.dataUpdatedAt,isStale:eu(e,t),refetch:this.refetch,remove:this.remove};return O}updateResult(e){let t=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,y(r,t))return;this.currentResult=r;let n={cache:!0};(null==e?void 0:e.listeners)!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.trackedProps.size)return!0;let n=new Set(null!=r?r:this.trackedProps);return this.options.useErrorBoundary&&n.add("error"),Object.keys(this.currentResult).some(e=>{let r=this.currentResult[e]!==t[e];return r&&n.has(e)})})()&&(n.listeners=!0),this.notify({...n,...e})}updateQuery(){let e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;let t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){let t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||T(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){x.batch(()=>{var t,r,n,i,o,s,a,u;e.onSuccess?(null==(t=(r=this.options).onSuccess)||t.call(r,this.currentResult.data),null==(n=(i=this.options).onSettled)||n.call(i,this.currentResult.data,null)):e.onError&&(null==(o=(s=this.options).onError)||o.call(s,this.currentResult.error),null==(a=(u=this.options).onSettled)||a.call(u,void 0,this.currentResult.error)),e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function eo(e,t){return!1!==t.enabled&&!e.state.dataUpdatedAt&&!("error"===e.state.status&&!1===t.retryOnMount)||e.state.dataUpdatedAt>0&&es(e,t,t.refetchOnMount)}function es(e,t,r){if(!1!==t.enabled){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&eu(e,t)}return!1}function ea(e,t,r,n){return!1!==r.enabled&&(e!==t||!1===n.enabled)&&(!r.suspense||"error"!==e.state.status)&&eu(e,r)}function eu(e,t){return e.isStaleByTime(t.staleTime)}function el(e){return e.state.isPaused}function ec(e){return"success"===e.state.status}let eh=["added","removed","updated"];function ef(e){return eh.includes(e)}async function ed({queryClient:e,persister:t,maxAge:r=864e5,buster:n="",hydrateOptions:i}){try{let o=await t.restoreClient();if(o){if(o.timestamp){let s=Date.now()-o.timestamp>r,a=o.buster!==n;s||a?t.removeClient():function(e,t,r){if("object"!=typeof t||null===t)return;let n=e.getMutationCache(),i=e.getQueryCache(),o=t.mutations||[],s=t.queries||[];o.forEach(t=>{var i;n.build(e,{...null==r?void 0:null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:t.mutationKey},t.state)}),s.forEach(({queryKey:t,state:n,queryHash:o})=>{var s;let a=i.get(o);if(a){if(a.state.dataUpdatedAt{i(e)&&r.push({mutationKey:e.options.mutationKey,state:e.state})})}if(!1!==t.dehydrateQueries){let o=t.shouldDehydrateQuery||ec;e.getQueryCache().getAll().forEach(e=>{o(e)&&n.push({state:e.state,queryKey:e.queryKey,queryHash:e.queryHash})})}return{mutations:r,queries:n}}(e,n)};await t.persistClient(i)}var em=r(97231),eg=r(2984),ey=r(5151),ev=r(52798);let eb=(e,t)=>{let{find:r,replace:n}=t;return e&&r(e)?n(e):"object"!=typeof e?e:Array.isArray(e)?e.map(e=>eb(e,{find:r,replace:n})):e instanceof Object?Object.entries(e).reduce((e,t)=>{let[i,o]=t;return{...e,[i]:eb(o,{find:r,replace:n})}},{}):e};function ew(e){let t=JSON.parse(e),r=eb(t,{find:e=>"BigNumber"===e.type,replace:e=>ey.BigNumber.from(e.hex)});return r}function eA(e,t){return e.slice(0,t).join(".")||"."}function eE(e,t){let{length:r}=e;for(let n=0;n{try{e.setItem(t,n(r));return}catch(i){return i}};return{persistClient:function(e,t=100){let r=null;return function(...n){null===r&&(r=setTimeout(()=>{e(...n),r=null},t))}}(e=>{let t=e,r=a(t),n=0;for(;r&&t;)n++,(t=null==s?void 0:s({persistedClient:t,error:r,errorCount:n}))&&(r=a(t))},r),restoreClient(){let r=e.getItem(t);if(r)return o(r)},removeClient(){e.removeItem(t)}}}return{persistClient:i,restoreClient:()=>void 0,removeClient:i}}({key:"wagmi.cache",storage:window.localStorage,serialize:ek,deserialize:ew}):void 0,...n}=e,o=(0,em.k)(n);return r&&function(e){let t;ed(e).then(()=>{(function(e){let t=e.queryClient.getQueryCache().subscribe(t=>{ef(t.type)&&ep(e)}),r=e.queryClient.getMutationCache().subscribe(t=>{ef(t.type)&&ep(e)});()=>{t(),r()}})(e)})}({queryClient:t,persister:r,dehydrateOptions:{shouldDehydrateQuery:e=>0!==e.cacheTime&&!1!==e.queryKey[0].persist}}),Object.assign(o,{queryClient:t})}let eP=H.createContext(void 0),ex=H.createContext(void 0);function eC(e){let{children:t,client:r}=e;return H.createElement(eP.Provider,{value:r},H.createElement(V,{client:r.queryClient,context:ex},t))}function e_(){let e=H.useContext(eP);if(!e)throw Error("`useClient` must be used within `WagmiConfig`.\n\nRead more: https://wagmi.sh/docs/WagmiConfig");return e}let eO=et.useSyncExternalStore;function eR(e,t,r){let n=c(e,t,r);return function(e,t,r){var n,i;let o=c(e,void 0,void 0),s=J({context:o.context}),[a]=H.useState(()=>new ee(s,o));H.useEffect(()=>{a.setOptions(o)},[a,o]);let u=er(H.useCallback(e=>a.subscribe(x.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),l=H.useCallback((e,t)=>{a.mutate(e,t).catch(en)},[a]);if(u.error&&(n=a.options.useErrorBoundary,i=[u.error],"function"==typeof n?n(...i):!!n))throw u.error;return{...u,mutate:l,mutateAsync:u.mutate}}({context:ex,...n})}let eM=()=>J({context:ex});function eN(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ev.useSyncExternalStoreWithSelector)(t=>(0,eg.b0)({chainId:e},t),()=>(0,em.f)({chainId:e}),()=>(0,em.f)({chainId:e}),e=>e,(e,t)=>e.network.chainId===t.network.chainId)}let eI=e=>"object"==typeof e&&!Array.isArray(e);function eT(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:eg.vZ,i=H.useRef([]),o=(0,ev.useSyncExternalStoreWithSelector)(e,t,r,e=>e,(e,t)=>{if(eI(e)&&eI(t)){for(let r of i.current){let o=n(e[r],t[r]);if(!o)return!1}return!0}return n(e,t)});if(eI(o)){let s={...o};return Object.defineProperties(s,Object.entries(s).reduce((e,t)=>{let[r,n]=t;return{...e,[r]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(r)||i.current.push(r),n)}}},{})),s}return o}function eB(){var e,t,r;let{onConnect:n,onDisconnect:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=eT(eg.uH,eg.D0),s=H.useRef();return n&&(null===(e=s.current)||void 0===e?void 0:e.status)!=="connected"&&"connected"===o.status&&n({address:o.address,connector:o.connector,isReconnected:(null===(t=s.current)||void 0===t?void 0:t.status)==="reconnecting"}),i&&(null===(r=s.current)||void 0===r?void 0:r.status)=="connected"&&"disconnected"===o.status&&i(),s.current=o,o}let eL=e=>[{entity:"connect",...e}],eF=e=>{let{connector:t,chainId:r}=e;if(!t)throw Error("connector is required");return(0,eg.$j)({connector:t,chainId:r})};function eD(){let{chainId:e,connector:t,onError:r,onMutate:n,onSettled:i,onSuccess:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=e_(),{data:a,error:u,isError:l,isIdle:c,isLoading:h,isSuccess:f,mutate:d,mutateAsync:p,reset:m,status:g,variables:y}=eR(eL({connector:t,chainId:e}),eF,{onError:r,onMutate:n,onSettled:i,onSuccess:o}),v=H.useCallback(r=>d({chainId:(null==r?void 0:r.chainId)??e,connector:(null==r?void 0:r.connector)??t}),[e,t,d]),b=H.useCallback(r=>p({chainId:(null==r?void 0:r.chainId)??e,connector:(null==r?void 0:r.connector)??t}),[e,t,p]);return{connect:v,connectAsync:b,connectors:s.connectors,data:a,error:u,isError:l,isIdle:c,isLoading:h,isSuccess:f,pendingConnector:null==y?void 0:y.connector,reset:m,status:g,variables:y}}let eU=[{entity:"disconnect"}],ej=()=>(0,eg.zP)();function eq(){let{onError:e,onMutate:t,onSettled:r,onSuccess:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{error:i,isError:o,isIdle:s,isLoading:a,isSuccess:u,mutate:l,mutateAsync:c,reset:h,status:f}=eR(eU,ej,{...e?{onError(t,r,n){e(t,n)}}:{},onMutate:t,...r?{onSettled(e,t,n,i){r(t,i)}}:{},...n?{onSuccess(e,t,r){n(r)}}:{}});return{disconnect:l,disconnectAsync:c,error:i,isError:o,isIdle:s,isLoading:a,isSuccess:u,reset:h,status:f}}function eG(){return eT(eg.QC,eg.Hy)}function eK(e){let{chainId:t}=e;return[{entity:"signer",chainId:t,persist:!1}]}function eH(e){let{queryKey:[{chainId:t}]}=e;return(0,eg.DG)({chainId:t})}function ez(){let{chainId:e,suspense:t,onError:r,onSettled:n,onSuccess:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=function(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=eN({chainId:e});return t.network.chainId}({chainId:e}),s=function(e,t,r){let n=Array.isArray(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e,i=function(e,t){var r,n;let i=J({context:e.context}),o=Z(),s=X(),a=i.defaultQueryOptions(e);a._optimisticResults=o?"isRestoring":"optimistic",a.onError&&(a.onError=x.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=x.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=x.batchCalls(a.onSettled)),a.suspense&&"number"!=typeof a.staleTime&&(a.staleTime=1e3),(a.suspense||a.useErrorBoundary)&&!s.isReset()&&(a.retryOnMount=!1);let[u]=H.useState(()=>new t(i,a)),l=u.getOptimisticResult(a);if(eO(H.useCallback(e=>o?()=>void 0:u.subscribe(x.batchCalls(e)),[u,o]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),H.useEffect(()=>{s.clearReset()},[s]),H.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),a.suspense&&l.isLoading&&l.isFetching&&!o)throw u.fetchOptimistic(a).then(e=>{var t,r;let{data:n}=e;null===(t=a.onSuccess)||void 0===t||t.call(a,n),null===(r=a.onSettled)||void 0===r||r.call(a,n,null)}).catch(e=>{var t,r;s.clearReset(),null===(t=a.onError)||void 0===t||t.call(a,e),null===(r=a.onSettled)||void 0===r||r.call(a,void 0,e)});if(l.isError&&!s.isReset()&&!l.isFetching&&(r=a.useErrorBoundary,n=[l.error,u.getCurrentQuery()],"function"==typeof r?r(...n):!!r))throw l.error;let c="loading"===l.status&&"idle"===l.fetchStatus?"idle":l.status,h="loading"===c&&"fetching"===l.fetchStatus;return{...l,defaultedOptions:a,isIdle:"idle"===c,isLoading:h,observer:u,status:c}}({context:ex,...n},ei),o={data:i.data,error:i.error,fetchStatus:i.fetchStatus,isError:i.isError,isFetched:i.isFetched,isFetchedAfterMount:i.isFetchedAfterMount,isFetching:i.isFetching,isIdle:i.isIdle,isLoading:i.isLoading,isRefetching:i.isRefetching,isSuccess:i.isSuccess,refetch:i.refetch,status:i.status,internal:{dataUpdatedAt:i.dataUpdatedAt,errorUpdatedAt:i.errorUpdatedAt,failureCount:i.failureCount,isFetchedAfterMount:i.isFetchedAfterMount,isLoadingError:i.isLoadingError,isPaused:i.isPaused,isPlaceholderData:i.isPlaceholderData,isPreviousData:i.isPreviousData,isRefetchError:i.isRefetchError,isStale:i.isStale,remove:i.remove}};return i.defaultedOptions.notifyOnChangeProps?o:function(e,t){let r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(t.trackedProps.add(n),e[n])})}),r}(o,i.observer)}(eK({chainId:o}),eH,{cacheTime:0,staleTime:1/0,suspense:t,onError:r,onSettled:n,onSuccess:i}),a=eM();return H.useEffect(()=>{let e=(0,eg.rn)({chainId:o},e=>a.setQueryData(eK({chainId:o}),e));return e},[a,o]),s}function eQ(e){let{domain:t,types:r,value:n}=e;if(!t)throw Error("domain is required");if(!r)throw Error("types is required");if(!n)throw Error("value is required");return(0,eg.xq)({domain:t,types:r,value:n})}function eW(){let{domain:e,types:t,value:r,onError:n,onMutate:i,onSettled:o,onSuccess:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:a,error:u,isError:l,isIdle:c,isLoading:h,isSuccess:f,mutate:d,mutateAsync:p,reset:m,status:g,variables:y}=eR(function(e){let{domain:t,types:r,value:n}=e;return[{entity:"signTypedData",domain:t,types:r,value:n}]}({domain:e,types:t,value:r}),eQ,{onError:n,onMutate:i,onSettled:o,onSuccess:s}),v=H.useCallback(n=>d({domain:(null==n?void 0:n.domain)??e,types:(null==n?void 0:n.types)??t,value:(null==n?void 0:n.value)??r}),[e,t,r,d]),b=H.useCallback(n=>p({domain:(null==n?void 0:n.domain)??e,types:(null==n?void 0:n.types)??t,value:(null==n?void 0:n.value)??r}),[e,t,r,p]);return{data:a,error:u,isError:l,isIdle:c,isLoading:h,isSuccess:f,reset:m,signTypedData:v,signTypedDataAsync:b,status:g,variables:y}}let eJ=e=>[{entity:"switchNetwork",...e}],eV=e=>{let{chainId:t}=e;if(!t)throw Error("chainId is required");return(0,eg.If)({chainId:t})};function eY(){var e;let t,r;let{chainId:n,throwForSwitchChainNotSupported:i,onError:o,onMutate:s,onSettled:a,onSuccess:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=e_(),c=function(){let[,e]=H.useReducer(e=>e+1,0);return e}(),{data:h,error:f,isError:d,isIdle:p,isLoading:m,isSuccess:g,mutate:y,mutateAsync:v,reset:b,status:w,variables:A}=eR(eJ({chainId:n}),eV,{onError:o,onMutate:s,onSettled:a,onSuccess:u}),E=H.useCallback(e=>y({chainId:e??n}),[n,y]),k=H.useCallback(e=>v({chainId:e??n}),[n,v]);H.useEffect(()=>{let e=l.subscribe(e=>{let{chains:t,connector:r}=e;return{chains:t,connector:r}},c);return e},[l,c]);let S=!!(null!==(e=l.connector)&&void 0!==e&&e.switchChain);return(i||S)&&(t=E,r=k),{chains:l.chains??[],data:h,error:f,isError:d,isIdle:p,isLoading:m,isSuccess:g,pendingChainId:null==A?void 0:A.chainId,reset:b,status:w,switchNetwork:t,switchNetworkAsync:r,variables:A}}function eZ(){let{address:e,abi:t,signerOrProvider:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return H.useMemo(()=>e&&t?(0,eg.uN)({address:e,abi:t,signerOrProvider:null===r?void 0:r}):null,[e,t,r])}},46601:function(){}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],function(){return t(6840),t(80880)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/webpack-28cbdd38ac42e69d.js b/_next/static/chunks/webpack-87aef16517057517.js similarity index 95% rename from _next/static/chunks/webpack-28cbdd38ac42e69d.js rename to _next/static/chunks/webpack-87aef16517057517.js index 5321f53..ca52924 100644 --- a/_next/static/chunks/webpack-28cbdd38ac42e69d.js +++ b/_next/static/chunks/webpack-87aef16517057517.js @@ -1 +1 @@ -!function(){"use strict";var e,t,n,r,o,u,a,i,c,f,d,l,s={},p={};function b(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={id:e,loaded:!1,exports:{}},r=!0;try{s[e].call(n.exports,n,n.exports,b),r=!1}finally{r&&delete p[e]}return n.loaded=!0,n.exports}b.m=s,b.amdO={},e=[],b.O=function(t,n,r,o){if(n){o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var a=1/0,u=0;u=o&&Object.keys(b.O).every(function(e){return b.O[e](n[c])})?n.splice(c--,1):(i=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o];return}for(var a=1/0,u=0;u=o&&Object.keys(b.O).every(function(e){return b.O[e](n[c])})?n.splice(c--,1):(i=!1,oCrust Cloud
\ No newline at end of file +Crust Cloud
\ No newline at end of file